From 1c46afbb8b585d4740e7f98947684fad07213adf Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Fri, 12 May 2023 01:28:23 +0200 Subject: [PATCH 01/31] Add initial refactoring --- .../languages/DartDioClientCodegen.java | 17 ++- .../resources/dart/libraries/dio/api.mustache | 143 +----------------- .../dart/libraries/dio/api_client.mustache | 32 ++-- .../dart/libraries/dio/api_raw.mustache | 95 ++++++++++++ .../dart/libraries/dio/api_typed.mustache | 130 ++++++++++++++++ .../libraries/dio/auth/auth_exports.mustache | 5 + .../resources/dart/libraries/dio/lib.mustache | 13 +- .../libraries/dio/lib_api_exports.mustache | 3 + .../libraries/dio/lib_model_exports.mustache | 7 + .../built_value/api/constructor.mustache | 3 - .../built_value/api/deserialize.mustache | 23 --- .../built_value/api/imports.mustache | 1 - .../built_value/api/query_param.mustache | 1 - .../built_value/api/serialize.mustache | 30 ---- .../built_value/date_serializer.mustache | 2 +- .../repository_construction.mustache | 1 + ...util.mustache => repository_impl.mustache} | 38 +++++ .../built_value/serializers.mustache | 7 +- .../api/constructor.mustache | 1 - .../api/deserialize.mustache | 2 - .../json_serializable/api/imports.mustache | 3 - .../api/query_param.mustache | 1 - .../json_serializable/api/serialize.mustache | 1 - .../repository_construction.mustache | 1 + .../repository_impl.mustache | 29 ++++ .../serialization/repository_base.mustache | 54 +++++++ .../dio/types/recursion_base_type.mustache | 0 .../types/recursion_base_type_info.mustache | 1 + 28 files changed, 397 insertions(+), 247 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache rename modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/{api_util.mustache => repository_impl.mustache} (69%) delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 6d127c990f54..a7b705b03385 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -192,18 +192,22 @@ public void processOpts() { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "api.dart")); + supportingFiles.add(new SupportingFile("lib_model_exports.mustache", libPath, "models.dart")); supportingFiles.add(new SupportingFile("lib.mustache", libPath, pubName + ".dart")); final String srcFolder = libPath + sourceFolder; - supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api.dart")); + supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api_client.dart")); + supportingFiles.add(new SupportingFile("serialization/repository_base.mustache", srcFolder, "repository_base.dart")); final String authFolder = srcFolder + File.separator + "auth"; + supportingFiles.add(new SupportingFile("auth/auth_exports.mustache", authFolder, "_exports.dart")); supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); supportingFiles.add(new SupportingFile("auth/basic_auth.mustache", authFolder, "basic_auth.dart")); supportingFiles.add(new SupportingFile("auth/bearer_auth.mustache", authFolder, "bearer_auth.dart")); supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); - + configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); } @@ -245,9 +249,9 @@ private void configureSerializationLibrary(String srcFolder) { } private void configureSerializationLibraryBuiltValue(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/built_value/repository_impl.mustache", srcFolder, "repository_impl.dart")); supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); - + typeMapping.put("Array", "BuiltList"); typeMapping.put("array", "BuiltList"); typeMapping.put("List", "BuiltList"); @@ -267,6 +271,7 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { } private void configureSerializationLibraryJsonSerializable(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/json_serializable/repository_impl.mustache", srcFolder, "repository_impl.dart")); supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", "" /* main project dir */, "build.yaml")); supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, "deserialize.dart")); @@ -674,10 +679,6 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, Listheader}} import 'dart:async'; - -{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} import 'package:dio/dio.dart'; - +import 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart'; +import 'package:{{pubName}}/models.dart'; {{#operations}} {{#imports}}import '{{.}}'; {{/imports}} -class {{classname}} { - - final Dio _dio; - -{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} - - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; - final _options = Options( - method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', - {{#isResponseFile}} - responseType: ResponseType.bytes, - {{/isResponseFile}} - headers: { - {{#httpUserAgent}} - r'User-Agent': r'{{{.}}}', - {{/httpUserAgent}} - {{#headerParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, - {{/headerParams}} - ...?headers, - }, - extra: { - 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} - {{#authMethods}}{ - 'type': '{{type}}',{{#scheme}} - 'scheme': '{{.}}',{{/scheme}} - 'name': '{{name}}',{{#isApiKey}} - 'keyName': '{{keyParamName}}', - 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} - },{{/authMethods}} - ],{{/hasAuthMethods}} - ...?extra, - },{{#hasConsumes}} - contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} - validateStatus: validateStatus, - );{{#hasQueryParams}} - - final _queryParameters = { - {{#queryParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, - {{/queryParams}} - };{{/hasQueryParams}}{{#hasBodyOrFormParams}} - - dynamic _bodyData; - - try { -{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - }{{/hasBodyOrFormParams}} - - final _response = await _dio.request( - _path,{{#hasBodyOrFormParams}} - data: _bodyData,{{/hasBodyOrFormParams}} - options: _options,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - {{#returnType}} - - {{{.}}}? _responseData; - - try { -{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response<{{{returnType}}}>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - );{{/returnType}}{{^returnType}} - return _response;{{/returnType}} - } +{{>api_typed}} +{{>api_raw}} - {{/operation}} -} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache index d0cc2dfb2096..a2ef2125b197 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -1,33 +1,29 @@ {{>header}} -import 'package:dio/dio.dart';{{#useBuiltValue}} -import 'package:built_value/serializer.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} -import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; -{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; -{{/apis}}{{/apiInfo}} +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:{{pubName}}/api.dart'; +import 'package:{{pubName}}/models.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; + class {{clientName}} { static const String basePath = r'{{{basePath}}}'; final Dio dio; -{{#useBuiltValue}} - final Serializers serializers; + final SerializationRepositoryBase serializationRepository; + -{{/useBuiltValue}} {{clientName}}({ - Dio? dio,{{#useBuiltValue}} - Serializers? serializers,{{/useBuiltValue}} + Dio? dio, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? {{#includeLibraryTemplate}}repository_construction{{/includeLibraryTemplate}} { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -67,6 +63,6 @@ class {{clientName}} { /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed {{classname}} get{{classname}}() { - return {{classname}}(dio{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + return {{classname}}({{classname}}Raw(dio), serializationRepository); }{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache new file mode 100644 index 000000000000..f35d4e947fc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache @@ -0,0 +1,95 @@ +class {{classname}}Raw { + + final Dio _dio; + + const {{classname}}Raw(this._dio); + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required String {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}Object{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}String{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{/allParams}} + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final _options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + {{#headerParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}',{{#scheme}} + 'scheme': '{{.}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + );{{#hasQueryParams}} + + final _queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/queryParams}} + };{{/hasQueryParams}} + + return await _dio.request( + _path, + data: body, + options: _options,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + {{/operation}} +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache new file mode 100644 index 000000000000..3e65e0bf065b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache @@ -0,0 +1,130 @@ +class {{classname}} { + + final {{classname}}Raw _rawApi; + final SerializationRepositoryBase _repository; + + const {{classname}}(this._rawApi, this._repository); + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioError] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + {{#hasBodyOrFormParams}} + + Object? _bodyData; + {{#hasFormParams}} + {{#isMultipart}} + _bodyData = FormData.fromMap({ + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}_repository.encodeFormParameter({{{paramName}}}, {{>types/recursion_base_type_info}}){{/isFile}}, + {{/formParams}} + }); + {{/isMultipart}} + {{^isMultipart}} + _bodyData = { + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': _repository.encodeFormParameter({{{paramName}}}, {{>types/recursion_base_type_info}}), + {{/formParams}} + }; + {{/isMultipart}} + {{/hasFormParams}} + {{#bodyParam}} + {{#isPrimitiveType}} + _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + _bodyData = {{^required}}{{paramName}} == null ? null : {{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}); + {{/isPrimitiveType}} + {{/bodyParam}} + {{/hasBodyOrFormParams}} + + final _response = await _rawApi.{{nickname}}( + {{#allParams}}{{#isPathParam}} + {{paramName}}: _repository.encodeStringParameter({{paramName}}, {{>types/recursion_base_type_info}}),{{/isPathParam}}{{#isQueryParam}} + {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.encodeQueryParameter({{paramName}}, {{>types/recursion_base_type_info}}{{#collectionFormat}}, context: ListFormat.{{collectionFormat}}{{/collectionFormat}}) ,{{/isQueryParam}}{{#isHeaderParam}} + {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.encodeStringParameter({{paramName}}, {{>types/recursion_base_type_info}}) ,{{/isHeaderParam}}{{/allParams}} + {{#hasConsumes}} + body: _bodyData, + requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + {{#returnType}} + + {{{.}}}? _responseData; + + try { + final rawResponse = _response.data; + {{#isResponseFile}} + _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; + {{/isResponseFile}} + {{^isResponseFile}} + {{#returnProperty}} + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + {{>types/recursion_base_type_info}}, + ); + {{/returnProperty}} + {{/isResponseFile}} + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response<{{{.}}}>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + );{{/returnType}}{{^returnType}} + return _response;{{/returnType}} + } + + {{/operation}} +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache index 1ac711810617..ea92535538bd 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -1,12 +1,5 @@ {{>header}} -export 'package:{{pubName}}/{{sourceFolder}}/api.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; -export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; -{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart'; -{{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}} -{{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; -{{/apis}}{{/apiInfo}} -{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}} \ No newline at end of file +export 'api.dart'; +export 'models.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache new file mode 100644 index 000000000000..3b7a3a8aaed2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache @@ -0,0 +1,3 @@ +export 'package:{{pubName}}/{{sourceFolder}}/api_client.dart'; +{{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache new file mode 100644 index 000000000000..6e16f8cc6693 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache @@ -0,0 +1,7 @@ +{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart'; +{{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/date_serializer.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}} +export 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/repository_impl.dart'; +{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache deleted file mode 100644 index e823414cc755..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache +++ /dev/null @@ -1,3 +0,0 @@ - final Serializers _serializers; - - const {{classname}}(this._dio, this._serializers); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache deleted file mode 100644 index fe49d9d3f06a..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache +++ /dev/null @@ -1,23 +0,0 @@ - final rawResponse = _response.data; - {{#isResponseFile}} - _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; - {{/isResponseFile}} - {{^isResponseFile}} - {{#returnSimpleType}} - {{#returnTypeIsPrimitive}} - _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; - {{/returnTypeIsPrimitive}} - {{^returnTypeIsPrimitive}} - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType({{{returnType}}}), - ) as {{{returnType}}}; - {{/returnTypeIsPrimitive}} - {{/returnSimpleType}} - {{^returnSimpleType}} - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{#isMap}}Map{{/isMap}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{returnBaseType}}})]), - ) as {{{returnType}}}; - {{/returnSimpleType}} - {{/isResponseFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache deleted file mode 100644 index 2f62fbda4267..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache +++ /dev/null @@ -1 +0,0 @@ -import 'package:built_value/serializer.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache deleted file mode 100644 index aa47f4f43940..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isContainer}}{{#isMap}}encodeQueryParameter{{/isMap}}{{^isMap}}encodeCollectionQueryParameter<{{{baseType}}}>{{/isMap}}{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{dataType}}}){{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]), {{#collectionFormat}}format: ListFormat.{{collectionFormat}},{{/collectionFormat}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache deleted file mode 100644 index 6c4d370d86e9..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache +++ /dev/null @@ -1,30 +0,0 @@ - {{#hasFormParams}} - {{#isMultipart}} - _bodyData = FormData.fromMap({ - {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}encodeFormParameter(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{baseType}}}{{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]{{/isContainer}})){{/isFile}}, - {{/formParams}} - }); - {{/isMultipart}} - {{^isMultipart}} - _bodyData = { - {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{>serialization/built_value/api/query_param}}, - {{/formParams}} - }; - {{/isMultipart}} - {{/hasFormParams}} - {{#bodyParam}} - {{#isPrimitiveType}} - _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; - {{/isPrimitiveType}} - {{^isPrimitiveType}} - {{#isContainer}} - const _type = FullType(Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]); - {{/isContainer}} - {{^isContainer}} - const _type = FullType({{{baseType}}}); - {{/isContainer}} - _bodyData = {{^required}}{{paramName}} == null ? null : {{/required}}_serializers.serialize({{paramName}}, specifiedType: _type); - {{/isPrimitiveType}} - {{/bodyParam}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache index dc16805ce628..3391e775c7f7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache @@ -1,7 +1,7 @@ {{>header}} import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart'; +import '{{modelPackage}}/date.dart'; class DateSerializer implements PrimitiveSerializer { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache new file mode 100644 index 000000000000..08ea99a41dc5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache @@ -0,0 +1 @@ +BuiltValueJsonRepository(standardSerializers) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache similarity index 69% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache index 45432b0042dc..1a1de24ad4c6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache @@ -1,10 +1,46 @@ {{>header}} + import 'dart:convert'; import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} + +/* +old api_util.dart for reference /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. @@ -72,3 +108,5 @@ ListParam encodeCollectionQueryParameter( } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } + +*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache index aa49d9aef9e4..bfe56d66153c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache @@ -7,13 +7,10 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; -{{#useDateLibCore}}import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/date_serializer.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}} +{{#useDateLibCore}}import 'package:built_value/iso_8601_date_time_serializer.dart';{{/useDateLibCore}} {{#useDateLibTimeMachine}}import 'package:time_machine/time_machine.dart'; import 'package:{{pubName}}/{{sourceFolder}}/offset_date_serializer.dart';{{/useDateLibTimeMachine}} -{{#models}}{{#model}}import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/model}}{{/models}}{{#builtValueSerializerImports}}import '{{{.}}}'; +import 'package:{{pubName}}/models.dart';{{#builtValueSerializerImports}}import '{{{.}}}'; {{/builtValueSerializerImports}} part 'serializers.g.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache deleted file mode 100644 index a772c3148eaa..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache +++ /dev/null @@ -1 +0,0 @@ - const {{classname}}(this._dio); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache deleted file mode 100644 index f8666920780e..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache +++ /dev/null @@ -1,2 +0,0 @@ -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize<{{{returnType}}}, {{{returnBaseType}}}>(rawData, '{{{returnType}}}', growable: true); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache deleted file mode 100644 index f2b20f7171b5..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache +++ /dev/null @@ -1,3 +0,0 @@ -// ignore: unused_import -import 'dart:convert'; -import 'package:{{pubName}}/src/deserialize.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache deleted file mode 100644 index a83489f9e91c..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache +++ /dev/null @@ -1 +0,0 @@ -{{{paramName}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache deleted file mode 100644 index 93aed695e980..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#bodyParam}}_bodyData=jsonEncode({{{paramName}}});{{/bodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache new file mode 100644 index 000000000000..842e9be7f1f5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache @@ -0,0 +1 @@ +const JsonSerializableRepository() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache new file mode 100644 index 000000000000..fc0984150491 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache @@ -0,0 +1,29 @@ +import 'repository_base.dart'; +class JsonSerializableRepository extends SerializationRepositoryBase { + const JsonSerializableRepository(); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type.mustache new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache new file mode 100644 index 000000000000..536bd8823c5d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache @@ -0,0 +1 @@ +const TypeInfo{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{baseType}}, [{{#isMap}}TypeInfo(String), {{/isMap}}{{#items}}{{>types/recursion_base_type_info}}{{/items}}]{{/isContainer}}{{^isContainer}}{{#baseType}}{{{.}}}{{/baseType}}{{^baseType}}{{{dataType}}}{{/baseType}}{{/isContainer}}) \ No newline at end of file From 7000179c8824fe0393b7bf7f3df14b1388c4f53c Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Fri, 12 May 2023 01:28:48 +0200 Subject: [PATCH 02/31] regenerate samples --- .../dart-dio/oneof/.openapi-generator/FILES | 7 +- .../petstore/dart-dio/oneof/lib/api.dart | 2 + .../petstore/dart-dio/oneof/lib/models.dart | 8 + .../petstore/dart-dio/oneof/lib/openapi.dart | 14 +- .../oneof/lib/src/api/default_api.dart | 103 +- .../lib/src/{api.dart => api_client.dart} | 24 +- .../dart-dio/oneof/lib/src/auth/_exports.dart | 5 + .../oneof/lib/src/date_serializer.dart | 2 +- .../oneof/lib/src/json_repository_base.dart | 52 + .../oneof/lib/src/repository_base.dart | 54 + .../oneof/lib/src/repository_impl.dart | 115 ++ .../dart-dio/oneof/lib/src/serializers.dart | 7 +- .../.openapi-generator/FILES | 7 +- .../lib/api.dart | 3 + .../lib/models.dart | 19 + .../lib/openapi.dart | 26 +- .../lib/src/api/bar_api.dart | 126 +- .../lib/src/api/foo_api.dart | 207 +- .../lib/src/{api.dart => api_client.dart} | 27 +- .../lib/src/auth/_exports.dart | 5 + .../lib/src/date_serializer.dart | 2 +- .../lib/src/json_repository_base.dart | 52 + .../lib/src/repository_base.dart | 54 + .../lib/src/repository_impl.dart | 115 ++ .../lib/src/serializers.dart | 18 +- .../oneof_primitive/.openapi-generator/FILES | 7 +- .../dart-dio/oneof_primitive/lib/api.dart | 2 + .../dart-dio/oneof_primitive/lib/models.dart | 7 + .../dart-dio/oneof_primitive/lib/openapi.dart | 13 +- .../lib/src/api/default_api.dart | 103 +- .../lib/src/{api.dart => api_client.dart} | 24 +- .../lib/src/auth/_exports.dart | 5 + .../lib/src/date_serializer.dart | 2 +- .../lib/src/json_repository_base.dart | 52 + .../lib/src/repository_base.dart | 54 + .../lib/src/repository_impl.dart | 115 ++ .../oneof_primitive/lib/src/serializers.dart | 6 +- .../.openapi-generator/FILES | 7 +- .../lib/api.dart | 8 + .../lib/models.dart | 51 + .../lib/openapi.dart | 64 +- .../lib/src/api/another_fake_api.dart | 124 +- .../lib/src/api/default_api.dart | 103 +- .../lib/src/api/fake_api.dart | 1669 +++++++++++----- .../src/api/fake_classname_tags123_api.dart | 138 +- .../lib/src/api/pet_api.dart | 885 ++++++--- .../lib/src/api/store_api.dart | 380 +++- .../lib/src/api/user_api.dart | 613 ++++-- .../lib/src/{api.dart => api_client.dart} | 39 +- .../lib/src/auth/_exports.dart | 5 + .../lib/src/json_repository_base.dart | 52 + .../src/model/inline_response_default.dart | 54 - .../lib/src/repository_base.dart | 54 + .../lib/src/repository_impl.dart | 29 + .../.openapi-generator/FILES | 7 +- .../petstore_client_lib_fake/lib/api.dart | 8 + .../petstore_client_lib_fake/lib/models.dart | 53 + .../petstore_client_lib_fake/lib/openapi.dart | 65 +- .../lib/src/api/another_fake_api.dart | 126 +- .../lib/src/api/default_api.dart | 103 +- .../lib/src/api/fake_api.dart | 1736 +++++++++++------ .../src/api/fake_classname_tags123_api.dart | 140 +- .../lib/src/api/pet_api.dart | 929 ++++++--- .../lib/src/api/store_api.dart | 382 ++-- .../lib/src/api/user_api.dart | 630 ++++-- .../lib/src/{api.dart => api_client.dart} | 42 +- .../lib/src/auth/_exports.dart | 5 + .../lib/src/date_serializer.dart | 2 +- .../lib/src/json_repository_base.dart | 52 + .../src/model/inline_response_default.dart | 91 - .../lib/src/repository_base.dart | 54 + .../lib/src/repository_impl.dart | 115 ++ .../lib/src/serializers.dart | 52 +- 73 files changed, 7182 insertions(+), 3129 deletions(-) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/oneof/lib/src/{api.dart => api_client.dart} (78%) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/{api.dart => api_client.dart} (77%) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/{api.dart => api_client.dart} (78%) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/{api.dart => api_client.dart} (77%) create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/{api.dart => api_client.dart} (74%) create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES index f1ab7b5540a3..2c6234ac808d 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES @@ -5,10 +5,13 @@ doc/Apple.md doc/Banana.md doc/DefaultApi.md doc/Fruit.md +lib/api.dart +lib/models.dart lib/openapi.dart -lib/src/api.dart lib/src/api/default_api.dart +lib/src/api_client.dart lib/src/api_util.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart @@ -19,5 +22,7 @@ lib/src/model/apple.dart lib/src/model/banana.dart lib/src/model/date.dart lib/src/model/fruit.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart new file mode 100644 index 000000000000..61386591c491 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart @@ -0,0 +1,2 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart new file mode 100644 index 000000000000..9ecf2b9ff39b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart @@ -0,0 +1,8 @@ +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/date_serializer.dart'; +export 'package:openapi/src/model/date.dart'; +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/fruit.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart index d85a16fc6ad9..9ae4491269b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart @@ -2,15 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/default_api.dart'; - -export 'package:openapi/src/model/apple.dart'; -export 'package:openapi/src/model/banana.dart'; -export 'package:openapi/src/model/fruit.dart'; +export 'api.dart'; +export 'models.dart'; +export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart index 8833fb64ddc0..db921d6aa2f1 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/fruit.dart'; class DefaultApi { - final Dio _dio; + final DefaultApiRaw _rawApi; + final SerializationRepositoryBase _repository; - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); + const DefaultApi(this._rawApi, this._repository); /// rootGet /// @@ -37,37 +35,27 @@ class DefaultApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.rootGet( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Fruit? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(Fruit), - ) as Fruit; - + const TypeInfo(Fruit), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -91,3 +79,62 @@ class DefaultApi { } } + +class DefaultApiRaw { + + final Dio _dio; + + const DefaultApiRaw(this._dio); + + /// rootGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioError] if API call or serialization fails + Future> rootGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart similarity index 78% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart rename to samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart index dfd8e847bdd9..18137ee952fd 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart @@ -3,32 +3,30 @@ // import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/default_api.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:openapi/api.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/auth/_exports.dart'; class Openapi { static const String basePath = r'http://localhost'; final Dio dio; - final Serializers serializers; + final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, - Serializers? serializers, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -68,6 +66,6 @@ class Openapi { /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { - return DefaultApi(dio, serializers); + return DefaultApi(DefaultApiRaw(dio), serializationRepository); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart index db3c5c437db1..06e023d91be5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart @@ -4,7 +4,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; +import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart new file mode 100644 index 000000000000..6b618e77ca4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart @@ -0,0 +1,52 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart new file mode 100644 index 000000000000..1f5aa928cbf2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} + +/* +old api_util.dart for reference + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart index ddb1d66a1f5e..d771d346fed0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart @@ -11,13 +11,8 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/apple.dart'; -import 'package:openapi/src/model/banana.dart'; -import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/models.dart'; part 'serializers.g.dart'; @SerializersFor([ diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES index 52a900a19623..cee6d6740395 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES @@ -17,11 +17,14 @@ doc/FooRefOrValue.md doc/Pasta.md doc/Pizza.md doc/PizzaSpeziale.md +lib/api.dart +lib/models.dart lib/openapi.dart -lib/src/api.dart lib/src/api/bar_api.dart lib/src/api/foo_api.dart +lib/src/api_client.dart lib/src/api_util.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart @@ -43,5 +46,7 @@ lib/src/model/foo_ref_or_value.dart lib/src/model/pasta.dart lib/src/model/pizza.dart lib/src/model/pizza_speziale.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart new file mode 100644 index 000000000000..f615498164ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart @@ -0,0 +1,3 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart new file mode 100644 index 000000000000..3843a3c6aa4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart @@ -0,0 +1,19 @@ +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/date_serializer.dart'; +export 'package:openapi/src/model/date.dart'; +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart index ea87a7cb4761..9ae4491269b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -2,27 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; - -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -export 'package:openapi/src/model/foo_ref_or_value.dart'; -export 'package:openapi/src/model/pasta.dart'; -export 'package:openapi/src/model/pizza.dart'; -export 'package:openapi/src/model/pizza_speziale.dart'; +export 'api.dart'; +export 'models.dart'; +export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart index a931df9f19a9..024a0430400b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart @@ -3,20 +3,18 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/bar.dart'; import 'package:openapi/src/model/bar_create.dart'; class BarApi { - final Dio _dio; - - final Serializers _serializers; + final BarApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const BarApi(this._dio, this._serializers); + const BarApi(this._rawApi, this._repository); /// Create a Bar /// @@ -40,57 +38,31 @@ class BarApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/bar'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; + }) async { - try { - const _type = FullType(BarCreate); - _bodyData = _serializers.serialize(barCreate, specifiedType: _type); + Object? _bodyData; + _bodyData = _repository.serialize(barCreate, const TypeInfo(BarCreate)); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.createBar( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Bar? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(Bar), - ) as Bar; - + const TypeInfo(Bar), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -114,3 +86,63 @@ class BarApi { } } + +class BarApiRaw { + + final Dio _dio; + + const BarApiRaw(this._dio); + + /// Create a Bar + /// + /// + /// Parameters: + /// * [barCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Bar] as data + /// Throws [DioError] if API call or serialization fails + Future> createBar({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/bar'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart index d23de07674c9..b5b72b00b36f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart @@ -3,21 +3,19 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/foo.dart'; import 'package:openapi/src/model/foo_ref_or_value.dart'; class FooApi { - final Dio _dio; + final FooApiRaw _rawApi; + final SerializationRepositoryBase _repository; - final Serializers _serializers; - - const FooApi(this._dio, this._serializers); + const FooApi(this._rawApi, this._repository); /// Create a Foo /// @@ -41,57 +39,31 @@ class FooApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json;charset=utf-8', - validateStatus: validateStatus, - ); - - dynamic _bodyData; + }) async { - try { - const _type = FullType(Foo); - _bodyData = foo == null ? null : _serializers.serialize(foo, specifiedType: _type); + Object? _bodyData; + _bodyData = foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.createFoo( + + body: _bodyData, + requestContentType: 'application/json;charset=utf-8', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooRefOrValue? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(FooRefOrValue), - ) as FooRefOrValue; - + const TypeInfo(FooRefOrValue), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -134,37 +106,27 @@ class FooApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.getAllFoos( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltList? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(BuiltList, [FullType(FooRefOrValue)]), - ) as BuiltList; - + const TypeInfo(BuiltList, [const TypeInfo(FooRefOrValue)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -188,3 +150,112 @@ class FooApi { } } + +class FooApiRaw { + + final Dio _dio; + + const FooApiRaw(this._dio); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data + /// Throws [DioError] if API call or serialization fails + Future> createFoo({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// GET all Foos + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltList] as data + /// Throws [DioError] if API call or serialization fails + Future> getAllFoos({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart rename to samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart index 3e6abb37ddb9..c784655932da 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart @@ -3,33 +3,30 @@ // import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/bar_api.dart'; -import 'package:openapi/src/api/foo_api.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:openapi/api.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/auth/_exports.dart'; class Openapi { static const String basePath = r'http://localhost:8080'; final Dio dio; - final Serializers serializers; + final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, - Serializers? serializers, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -69,12 +66,12 @@ class Openapi { /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed BarApi getBarApi() { - return BarApi(dio, serializers); + return BarApi(BarApiRaw(dio), serializationRepository); } /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FooApi getFooApi() { - return FooApi(dio, serializers); + return FooApi(FooApiRaw(dio), serializationRepository); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart index db3c5c437db1..06e023d91be5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart @@ -4,7 +4,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; +import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart new file mode 100644 index 000000000000..6b618e77ca4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart @@ -0,0 +1,52 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart new file mode 100644 index 000000000000..1f5aa928cbf2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} + +/* +old api_util.dart for reference + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart index 55083251e5e8..b9393c569811 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart @@ -11,24 +11,8 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/addressable.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:openapi/src/model/bar_create.dart'; -import 'package:openapi/src/model/bar_ref.dart'; -import 'package:openapi/src/model/bar_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:openapi/src/model/extensible.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref.dart'; -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/pasta.dart'; -import 'package:openapi/src/model/pizza.dart'; -import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/models.dart'; part 'serializers.g.dart'; @SerializersFor([ diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES index 7f2ac59bf645..6241a915a2a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES @@ -4,10 +4,13 @@ analysis_options.yaml doc/Child.md doc/DefaultApi.md doc/Example.md +lib/api.dart +lib/models.dart lib/openapi.dart -lib/src/api.dart lib/src/api/default_api.dart +lib/src/api_client.dart lib/src/api_util.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart @@ -17,5 +20,7 @@ lib/src/date_serializer.dart lib/src/model/child.dart lib/src/model/date.dart lib/src/model/example.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart new file mode 100644 index 000000000000..61386591c491 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart @@ -0,0 +1,2 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart new file mode 100644 index 000000000000..3065efede3e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart @@ -0,0 +1,7 @@ +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/date_serializer.dart'; +export 'package:openapi/src/model/date.dart'; +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/child.dart'; +export 'package:openapi/src/model/example.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart index 220621d6961b..9ae4491269b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart @@ -2,14 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/default_api.dart'; - -export 'package:openapi/src/model/child.dart'; -export 'package:openapi/src/model/example.dart'; +export 'api.dart'; +export 'models.dart'; +export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart index 1f2cd8ad0755..4ba2efc25328 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/example.dart'; class DefaultApi { - final Dio _dio; + final DefaultApiRaw _rawApi; + final SerializationRepositoryBase _repository; - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); + const DefaultApi(this._rawApi, this._repository); /// list /// @@ -37,37 +35,27 @@ class DefaultApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/example'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.list( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Example? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(Example), - ) as Example; - + const TypeInfo(Example), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -91,3 +79,62 @@ class DefaultApi { } } + +class DefaultApiRaw { + + final Dio _dio; + + const DefaultApiRaw(this._dio); + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Example] as data + /// Throws [DioError] if API call or serialization fails + Future> list({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/example'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart similarity index 78% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart rename to samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart index 7eb05e3ea4e6..d9eda84d492e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart @@ -3,32 +3,30 @@ // import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/default_api.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:openapi/api.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/auth/_exports.dart'; class Openapi { static const String basePath = r'http://api.example.xyz/v1'; final Dio dio; - final Serializers serializers; + final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, - Serializers? serializers, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -68,6 +66,6 @@ class Openapi { /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { - return DefaultApi(dio, serializers); + return DefaultApi(DefaultApiRaw(dio), serializationRepository); } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart index db3c5c437db1..06e023d91be5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart @@ -4,7 +4,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; +import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart new file mode 100644 index 000000000000..6b618e77ca4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart @@ -0,0 +1,52 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart new file mode 100644 index 000000000000..1f5aa928cbf2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} + +/* +old api_util.dart for reference + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart index cbd8870dc676..da3ec43a5abf 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart @@ -11,12 +11,8 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/child.dart'; -import 'package:openapi/src/model/example.dart'; +import 'package:openapi/models.dart'; part 'serializers.g.dart'; @SerializersFor([ diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index b34094eb0a2f..dc477684d942 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -57,8 +57,9 @@ doc/StoreApi.md doc/Tag.md doc/User.md doc/UserApi.md +lib/api.dart +lib/models.dart lib/openapi.dart -lib/src/api.dart lib/src/api/another_fake_api.dart lib/src/api/default_api.dart lib/src/api/fake_api.dart @@ -66,6 +67,8 @@ lib/src/api/fake_classname_tags123_api.dart lib/src/api/pet_api.dart lib/src/api/store_api.dart lib/src/api/user_api.dart +lib/src/api_client.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart @@ -120,4 +123,6 @@ lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart new file mode 100644 index 000000000000..21c64ae9bd39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart @@ -0,0 +1,8 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart new file mode 100644 index 000000000000..72645bacac4c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart @@ -0,0 +1,51 @@ + +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_get_default_response.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 3beabf11dfcd..9ae4491269b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -2,65 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; - -export 'package:openapi/src/api/another_fake_api.dart'; -export 'package:openapi/src/api/default_api.dart'; -export 'package:openapi/src/api/fake_api.dart'; -export 'package:openapi/src/api/fake_classname_tags123_api.dart'; -export 'package:openapi/src/api/pet_api.dart'; -export 'package:openapi/src/api/store_api.dart'; -export 'package:openapi/src/api/user_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; +export 'api.dart'; +export 'models.dart'; +export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart index 399eef48513b..47ff15f3cfcc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class AnotherFakeApi { - final Dio _dio; + final AnotherFakeApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const AnotherFakeApi(this._dio); + const AnotherFakeApi(this._rawApi, this._repository); /// To test special tags /// To test special tags and operation ID starting with number @@ -39,51 +37,31 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); + }) async { - dynamic _bodyData; + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.call123testSpecialTags( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -107,3 +85,63 @@ _responseData = rawData == null ? null : deserialize(r } } + +class AnotherFakeApiRaw { + + final Dio _dio; + + const AnotherFakeApiRaw(this._dio); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> call123testSpecialTags({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart index c479591e3669..7e3981b9a72f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/foo_get_default_response.dart'; class DefaultApi { - final Dio _dio; + final DefaultApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const DefaultApi(this._dio); + const DefaultApi(this._rawApi, this._repository); /// fooGet /// @@ -37,33 +35,27 @@ class DefaultApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.fooGet( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooGetDefaultResponse? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FooGetDefaultResponse', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(FooGetDefaultResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -87,3 +79,62 @@ _responseData = rawData == null ? null : deserialize> fooGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart index 8cbb2eee00e1..b9d02a4ca3e7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -3,12 +3,9 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/file_schema_test_class.dart'; import 'package:openapi/src/model/health_check_result.dart'; import 'package:openapi/src/model/model_client.dart'; @@ -20,9 +17,10 @@ import 'package:openapi/src/model/user.dart'; class FakeApi { - final Dio _dio; + final FakeApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const FakeApi(this._dio); + const FakeApi(this._rawApi, this._repository); /// Health check endpoint /// @@ -44,33 +42,27 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/health'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.fakeHealthGet( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'HealthCheckResult', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(HealthCheckResult), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -119,58 +111,24 @@ _responseData = rawData == null ? null : deserialize{ - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': query1, - }; - - dynamic _bodyData; + }) async { - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, + final _response = await _rawApi.fakeHttpSignatureTest( + + query1: query1 == null ? null : _repository.encodeQueryParameter(query1, const TypeInfo(String)) , + header1: header1 == null ? null : _repository.encodeStringParameter(header1, const TypeInfo(String)) , + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -197,51 +155,31 @@ _bodyData=jsonEncode(pet); ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; + }) async { - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } + Object? _bodyData; + _bodyData = body; - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.fakeOuterBooleanSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'bool', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(bool), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -286,51 +224,31 @@ _responseData = rawData == null ? null : deserialize(rawData, 'bool' ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); + }) async { - dynamic _bodyData; + Object? _bodyData; + _bodyData = outerComposite == null ? null : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); - try { -_bodyData=jsonEncode(outerComposite); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.fakeOuterCompositeSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'OuterComposite', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(OuterComposite), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -375,51 +293,169 @@ _responseData = rawData == null ? null : deserialize{ - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', + }) async { + + Object? _bodyData; + _bodyData = body; + + final _response = await _rawApi.fakeOuterNumberSerialize( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, validateStatus: validateStatus, - ); + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); - dynamic _bodyData; + num? _responseData; try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(num), + ); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), + requestOptions: _response.requestOptions, + response: _response, type: DioErrorType.unknown, error: error, stackTrace: stackTrace, ); } - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = body; + + final _response = await _rawApi.fakeOuterStringSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, ); + } - num? _responseData; + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioError] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(outerObjectWithEnumProperty, const TypeInfo(OuterObjectWithEnumProperty)); + + final _response = await _rawApi.fakePropertyEnumIntegerSerialize( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'num', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(OuterObjectWithEnumProperty), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -430,15 +466,837 @@ _responseData = rawData == null ? null : deserialize(rawData, 'num', g ); } - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = body?.finalize(); + + final _response = await _rawApi.testBodyWithBinary( + + body: _bodyData, + requestContentType: 'image/png', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + + final _response = await _rawApi.testBodyWithFileSchema( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.testBodyWithQueryParams( + + query: _repository.encodeQueryParameter(query, const TypeInfo(String)) , + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + + final _response = await _rawApi.testClientModel( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + MultipartFile? binary, + DateTime? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (integer != null) r'integer': _repository.encodeFormParameter(integer, const TypeInfo(int)), + if (int32 != null) r'int32': _repository.encodeFormParameter(int32, const TypeInfo(int)), + if (int64 != null) r'int64': _repository.encodeFormParameter(int64, const TypeInfo(int)), + r'number': _repository.encodeFormParameter(number, const TypeInfo(num)), + if (float != null) r'float': _repository.encodeFormParameter(float, const TypeInfo(double)), + r'double': _repository.encodeFormParameter(double_, const TypeInfo(double)), + if (string != null) r'string': _repository.encodeFormParameter(string, const TypeInfo(String)), + r'pattern_without_delimiter': _repository.encodeFormParameter(patternWithoutDelimiter, const TypeInfo(String)), + r'byte': _repository.encodeFormParameter(byte, const TypeInfo(String)), + if (binary != null) r'binary': _repository.encodeFormParameter(binary, const TypeInfo(MultipartFile)), + if (date != null) r'date': _repository.encodeFormParameter(date, const TypeInfo(DateTime)), + if (dateTime != null) r'dateTime': _repository.encodeFormParameter(dateTime, const TypeInfo(DateTime)), + if (password != null) r'password': _repository.encodeFormParameter(password, const TypeInfo(String)), + if (callback != null) r'callback': _repository.encodeFormParameter(callback, const TypeInfo(String)), + }; + + final _response = await _rawApi.testEndpointParameters( + + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEnumParameters({ + List? enumHeaderStringArray, + String? enumHeaderString = '-efg', + List? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + List? enumQueryModelArray, + List? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (enumFormStringArray != null) r'enum_form_string_array': _repository.encodeFormParameter(enumFormStringArray, const TypeInfo(String, [const TypeInfo(String)])), + if (enumFormString != null) r'enum_form_string': _repository.encodeFormParameter(enumFormString, const TypeInfo(String)), + }; + + final _response = await _rawApi.testEnumParameters( + + enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository.encodeStringParameter(enumHeaderStringArray, const TypeInfo(String, [const TypeInfo(String)])) , + enumHeaderString: enumHeaderString == null ? null : _repository.encodeStringParameter(enumHeaderString, const TypeInfo(String)) , + enumQueryStringArray: enumQueryStringArray == null ? null : _repository.encodeQueryParameter(enumQueryStringArray, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , + enumQueryString: enumQueryString == null ? null : _repository.encodeQueryParameter(enumQueryString, const TypeInfo(String)) , + enumQueryInteger: enumQueryInteger == null ? null : _repository.encodeQueryParameter(enumQueryInteger, const TypeInfo(int)) , + enumQueryDouble: enumQueryDouble == null ? null : _repository.encodeQueryParameter(enumQueryDouble, const TypeInfo(double)) , + enumQueryModelArray: enumQueryModelArray == null ? null : _repository.encodeQueryParameter(enumQueryModelArray, const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), context: ListFormat.multi) , + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.testGroupParameters( + + requiredStringGroup: _repository.encodeQueryParameter(requiredStringGroup, const TypeInfo(int)) , + requiredBooleanGroup: _repository.encodeStringParameter(requiredBooleanGroup, const TypeInfo(bool)) , + requiredInt64Group: _repository.encodeQueryParameter(requiredInt64Group, const TypeInfo(int)) , + stringGroup: stringGroup == null ? null : _repository.encodeQueryParameter(stringGroup, const TypeInfo(int)) , + booleanGroup: booleanGroup == null ? null : _repository.encodeStringParameter(booleanGroup, const TypeInfo(bool)) , + int64Group: int64Group == null ? null : _repository.encodeQueryParameter(int64Group, const TypeInfo(int)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(requestBody, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + + final _response = await _rawApi.testInlineAdditionalProperties( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + r'param': _repository.encodeFormParameter(param, const TypeInfo(String)), + r'param2': _repository.encodeFormParameter(param2, const TypeInfo(String)), + }; + + final _response = await _rawApi.testJsonFormData( + + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required List pipe, + required List ioutil, + required List http, + required List url, + required List context, + required String allowEmpty, + Map? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.testQueryParameterCollectionFormat( + + pipe: _repository.encodeQueryParameter(pipe, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.pipes) , + ioutil: _repository.encodeQueryParameter(ioutil, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + http: _repository.encodeQueryParameter(http, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.ssv) , + url: _repository.encodeQueryParameter(url, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + context: _repository.encodeQueryParameter(context, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , + allowEmpty: _repository.encodeQueryParameter(allowEmpty, const TypeInfo(String)) , + language: language == null ? null : _repository.encodeQueryParameter(language, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} + +class FakeApiRaw { + + final Dio _dio; + + const FakeApiRaw(this._dio); + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeHealthGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> fakeHttpSignatureTest({ + Object? query1, + String? header1, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + return await _dio.request( + _path, + data: body, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } @@ -456,8 +1314,10 @@ _responseData = rawData == null ? null : deserialize(rawData, 'num', g /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, + Future> fakeOuterStringSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -469,66 +1329,25 @@ _responseData = rawData == null ? null : deserialize(rawData, 'num', g final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// fakePropertyEnumIntegerSerialize @@ -545,8 +1364,10 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + Future> fakePropertyEnumIntegerSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -558,66 +1379,25 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(outerObjectWithEnumProperty); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - OuterObjectWithEnumProperty? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'OuterObjectWithEnumProperty', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// testBodyWithBinary @@ -635,7 +1415,9 @@ _responseData = rawData == null ? null : deserialize> testBodyWithBinary({ - MultipartFile? body, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -647,42 +1429,25 @@ _responseData = rawData == null ? null : deserialize{ + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'image/png', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testBodyWithFileSchema @@ -700,7 +1465,9 @@ _bodyData=jsonEncode(body); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -712,42 +1479,25 @@ _bodyData=jsonEncode(body); final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(fileSchemaTestClass); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testBodyWithQueryParams @@ -766,8 +1516,10 @@ _bodyData=jsonEncode(fileSchemaTestClass); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testBodyWithQueryParams({ - required String query, - required User user, + required Object query, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -779,13 +1531,14 @@ _bodyData=jsonEncode(fileSchemaTestClass); final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); @@ -793,34 +1546,15 @@ _bodyData=jsonEncode(fileSchemaTestClass); r'query': query, }; - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// To test \"client\" model @@ -837,8 +1571,10 @@ _bodyData=jsonEncode(user); /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, + Future> testClientModel({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -850,66 +1586,25 @@ _bodyData=jsonEncode(user); final _options = Options( method: r'PATCH', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ModelClient? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -940,20 +1635,9 @@ _responseData = rawData == null ? null : deserialize(r /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - MultipartFile? binary, - DateTime? date, - DateTime? dateTime, - String? password, - String? callback, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -965,6 +1649,7 @@ _responseData = rawData == null ? null : deserialize(r final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -977,36 +1662,18 @@ _responseData = rawData == null ? null : deserialize(r ], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// To test enum parameters @@ -1032,15 +1699,16 @@ _responseData = rawData == null ? null : deserialize(r /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testEnumParameters({ - List? enumHeaderStringArray, - String? enumHeaderString = '-efg', - List? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - List? enumQueryModelArray, - List? enumFormStringArray, - String? enumFormString, + String? enumHeaderStringArray, + String? enumHeaderString, + Object? enumQueryStringArray, + Object? enumQueryString, + Object? enumQueryInteger, + Object? enumQueryDouble, + Object? enumQueryModelArray, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1054,13 +1722,14 @@ _responseData = rawData == null ? null : deserialize(r headers: { if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); @@ -1072,34 +1741,15 @@ _responseData = rawData == null ? null : deserialize(r if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, }; - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Fake endpoint to test group parameters (optional) @@ -1122,12 +1772,15 @@ _responseData = rawData == null ? null : deserialize(r /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, + required Object requiredStringGroup, + required String requiredBooleanGroup, + required Object requiredInt64Group, + Object? stringGroup, + String? booleanGroup, + Object? int64Group, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1141,6 +1794,7 @@ _responseData = rawData == null ? null : deserialize(r headers: { r'required_boolean_group': requiredBooleanGroup, if (booleanGroup != null) r'boolean_group': booleanGroup, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -1153,6 +1807,7 @@ _responseData = rawData == null ? null : deserialize(r ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); @@ -1163,16 +1818,15 @@ _responseData = rawData == null ? null : deserialize(r if (int64Group != null) r'int64_group': int64Group, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// test inline additionalProperties @@ -1190,7 +1844,9 @@ _responseData = rawData == null ? null : deserialize(r /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testInlineAdditionalProperties({ - required Map requestBody, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1202,42 +1858,25 @@ _responseData = rawData == null ? null : deserialize(r final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(requestBody); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// test json serialization of form data @@ -1256,8 +1895,9 @@ _bodyData=jsonEncode(requestBody); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testJsonFormData({ - required String param, - required String param2, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1269,42 +1909,25 @@ _bodyData=jsonEncode(requestBody); final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testQueryParameterCollectionFormat @@ -1328,13 +1951,16 @@ _bodyData=jsonEncode(requestBody); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testQueryParameterCollectionFormat({ - required List pipe, - required List ioutil, - required List http, - required List url, - required List context, - required String allowEmpty, - Map? language, + required Object pipe, + required Object ioutil, + required Object http, + required Object url, + required Object context, + required Object allowEmpty, + Object? language, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1346,12 +1972,14 @@ _bodyData=jsonEncode(requestBody); final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); @@ -1365,16 +1993,17 @@ _bodyData=jsonEncode(requestBody); r'allowEmpty': allowEmpty, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart index 01bbff6dc8b1..df883fef655f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class FakeClassnameTags123Api { - final Dio _dio; + final FakeClassnameTags123ApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const FakeClassnameTags123Api(this._dio); + const FakeClassnameTags123Api(this._rawApi, this._repository); /// To test class name in snake case /// To test class name in snake case @@ -39,58 +37,31 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); + }) async { - dynamic _bodyData; + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.testClassname( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -114,3 +85,70 @@ _responseData = rawData == null ? null : deserialize(r } } + +class FakeClassnameTags123ApiRaw { + + final Dio _dio; + + const FakeClassnameTags123ApiRaw(this._dio); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClassname({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart index dfc66e720d93..3467f68be294 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart @@ -3,20 +3,555 @@ // import 'dart:async'; +import 'package:dio/dio.dart'; +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final PetApiRaw _rawApi; + final SerializationRepositoryBase _repository; + + const PetApi(this._rawApi, this._repository); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + + final _response = await _rawApi.addPet( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.deletePet( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + apiKey: apiKey == null ? null : _repository.encodeStringParameter(apiKey, const TypeInfo(String)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioError] if API call or serialization fails + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required List status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.findPetsByStatus( + + status: _repository.encodeQueryParameter(status, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(List, [const TypeInfo(Pet)]), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Set] as data + /// Throws [DioError] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required Set tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.findPetsByTags( + + tags: _repository.encodeQueryParameter(tags, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Set? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Set, [const TypeInfo(Pet)]), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.getPetById( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Pet), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + + final _response = await _rawApi.updatePet( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (name != null) r'name': _repository.encodeFormParameter(name, const TypeInfo(String)), + if (status != null) r'status': _repository.encodeFormParameter(status, const TypeInfo(String)), + }; + + final _response = await _rawApi.updatePetWithForm( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (file != null) r'file': file, + }); + + final _response = await _rawApi.uploadFile( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'multipart/form-data', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; + Object? _bodyData; + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + r'requiredFile': requiredFile, + }); -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/pet.dart'; + final _response = await _rawApi.uploadFileWithRequiredFile( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'multipart/form-data', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); -class PetApi { + ApiResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} + +class PetApiRaw { final Dio _dio; - const PetApi(this._dio); + const PetApiRaw(this._dio); /// Add a new pet to the store /// @@ -33,7 +568,9 @@ class PetApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> addPet({ - required Pet pet, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -45,6 +582,7 @@ class PetApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -56,36 +594,18 @@ class PetApi { ], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Deletes a pet @@ -104,8 +624,11 @@ _bodyData=jsonEncode(pet); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> deletePet({ - required int petId, + required String petId, String? apiKey, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -118,6 +641,7 @@ _bodyData=jsonEncode(pet); method: r'DELETE', headers: { if (apiKey != null) r'api_key': apiKey, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -129,18 +653,18 @@ _bodyData=jsonEncode(pet); ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Finds Pets by status @@ -157,8 +681,11 @@ _bodyData=jsonEncode(pet); /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required List status, + Future> findPetsByStatus({ + @Deprecated('status is deprecated') required Object status, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -170,6 +697,7 @@ _bodyData=jsonEncode(pet); final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -181,6 +709,7 @@ _bodyData=jsonEncode(pet); ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); @@ -188,40 +717,15 @@ _bodyData=jsonEncode(pet); r'status': status, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - List? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'List', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Finds Pets by tags @@ -239,8 +743,11 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'L /// Returns a [Future] containing a [Response] with a [Set] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required Set tags, + Future> findPetsByTags({ + required Object tags, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -252,6 +759,7 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'L final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -263,6 +771,7 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'L ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); @@ -270,40 +779,15 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'L r'tags': tags, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - Set? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Set', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Find pet by ID @@ -320,8 +804,11 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Se /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ - required int petId, + Future> getPetById({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -333,6 +820,7 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Se final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -346,42 +834,18 @@ _responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Se ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - Pet? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Pet', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Update an existing pet @@ -399,7 +863,9 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Pet', g /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> updatePet({ - required Pet pet, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -411,6 +877,7 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Pet', g final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -422,36 +889,18 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Pet', g ], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Updates a pet in the store with form data @@ -471,9 +920,10 @@ _bodyData=jsonEncode(pet); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> updatePetWithForm({ - required int petId, - String? name, - String? status, + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -485,6 +935,7 @@ _bodyData=jsonEncode(pet); final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -496,36 +947,18 @@ _bodyData=jsonEncode(pet); ], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// uploads an image @@ -544,10 +977,11 @@ _bodyData=jsonEncode(pet); /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, + Future> uploadFile({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -559,6 +993,7 @@ _bodyData=jsonEncode(pet); final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -570,60 +1005,18 @@ _bodyData=jsonEncode(pet); ], ...?extra, }, - contentType: 'multipart/form-data', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// uploads an image (required) @@ -642,10 +1035,11 @@ _responseData = rawData == null ? null : deserialize(r /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, + Future> uploadFileWithRequiredFile({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -657,6 +1051,7 @@ _responseData = rawData == null ? null : deserialize(r final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -668,60 +1063,20 @@ _responseData = rawData == null ? null : deserialize(r ], ...?extra, }, - contentType: 'multipart/form-data', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart index db46a7db82e5..95822c260137 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/order.dart'; class StoreApi { - final Dio _dio; + final StoreApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const StoreApi(this._dio); + const StoreApi(this._rawApi, this._repository); /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -39,27 +37,19 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.deleteOrder( + + orderId: _repository.encodeStringParameter(orderId, const TypeInfo(String)), - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -84,40 +74,27 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/inventory'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.getInventory( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Map? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, int>(rawData, 'Map', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Map, [TypeInfo(String), const TypeInfo(int)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -162,33 +139,28 @@ _responseData = rawData == null ? null : deserialize, int>(rawD ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.getOrderById( + + orderId: _repository.encodeStringParameter(orderId, const TypeInfo(int)), - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -233,51 +205,31 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Ord ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); + }) async { - dynamic _bodyData; + Object? _bodyData; + _bodyData = _repository.serialize(order, const TypeInfo(Order)); - try { -_bodyData=jsonEncode(order); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.placeOrder( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -301,3 +253,221 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Ord } } + +class StoreApiRaw { + + final Dio _dio; + + const StoreApiRaw(this._dio); + + /// Delete purchase order by ID + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Map] as data + /// Throws [DioError] if API call or serialization fails + Future> getInventory({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> getOrderById({ + required String orderId, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> placeOrder({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart index b0a587acd899..aed55577c146 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/user.dart'; class UserApi { - final Dio _dio; + final UserApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const UserApi(this._dio); + const UserApi(this._rawApi, this._repository); /// Create user /// This can only be done by the logged in user. @@ -39,47 +37,421 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.createUser( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithArrayInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + + final _response = await _rawApi.createUsersWithArrayInput( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithListInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + + final _response = await _rawApi.createUsersWithListInput( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.deleteUser( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioError] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.getUserByName( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(User), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.loginUser( + + username: _repository.encodeQueryParameter(username, const TypeInfo(String)) , + password: _repository.encodeQueryParameter(password, const TypeInfo(String)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.logoutUser( + + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.updateUser( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} + +class UserApiRaw { + + final Dio _dio; + + const UserApiRaw(this._dio); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUser({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, }) async { final _path = r'/user'; final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Creates list of users with given input array @@ -97,7 +469,9 @@ _bodyData=jsonEncode(user); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> createUsersWithArrayInput({ - required List user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -109,42 +483,25 @@ _bodyData=jsonEncode(user); final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Creates list of users with given input array @@ -162,7 +519,9 @@ _bodyData=jsonEncode(user); /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> createUsersWithListInput({ - required List user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -174,42 +533,25 @@ _bodyData=jsonEncode(user); final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Delete user @@ -228,6 +570,9 @@ _bodyData=jsonEncode(user); /// Throws [DioError] if API call or serialization fails Future> deleteUser({ required String username, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -239,24 +584,25 @@ _bodyData=jsonEncode(user); final _options = Options( method: r'DELETE', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Get user by user name @@ -273,8 +619,11 @@ _bodyData=jsonEncode(user); /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -286,48 +635,25 @@ _bodyData=jsonEncode(user); final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - User? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'User', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Logs user into the system @@ -345,9 +671,12 @@ _responseData = rawData == null ? null : deserialize(rawData, 'User' /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, + Future> loginUser({ + required Object username, + required Object password, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -359,12 +688,14 @@ _responseData = rawData == null ? null : deserialize(rawData, 'User' final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); @@ -373,40 +704,15 @@ _responseData = rawData == null ? null : deserialize(rawData, 'User' r'password': password, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Logs out current logged in user session @@ -423,6 +729,9 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> logoutUser({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -434,24 +743,25 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Updated user @@ -471,7 +781,9 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// Throws [DioError] if API call or serialization fails Future> updateUser({ required String username, - required User user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -483,42 +795,27 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart rename to samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart index 835b76584b2d..a972f3ddbadd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart @@ -3,33 +3,30 @@ // import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/another_fake_api.dart'; -import 'package:openapi/src/api/default_api.dart'; -import 'package:openapi/src/api/fake_api.dart'; -import 'package:openapi/src/api/fake_classname_tags123_api.dart'; -import 'package:openapi/src/api/pet_api.dart'; -import 'package:openapi/src/api/store_api.dart'; -import 'package:openapi/src/api/user_api.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:openapi/api.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/auth/_exports.dart'; class Openapi { static const String basePath = r'http://petstore.swagger.io:80/v2'; final Dio dio; + final SerializationRepositoryBase serializationRepository; + + Openapi({ Dio? dio, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? const JsonSerializableRepository() { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -69,42 +66,42 @@ class Openapi { /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed AnotherFakeApi getAnotherFakeApi() { - return AnotherFakeApi(dio); + return AnotherFakeApi(AnotherFakeApiRaw(dio), serializationRepository); } /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { - return DefaultApi(dio); + return DefaultApi(DefaultApiRaw(dio), serializationRepository); } /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeApi getFakeApi() { - return FakeApi(dio); + return FakeApi(FakeApiRaw(dio), serializationRepository); } /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(dio); + return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); } /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed PetApi getPetApi() { - return PetApi(dio); + return PetApi(PetApiRaw(dio), serializationRepository); } /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed StoreApi getStoreApi() { - return StoreApi(dio); + return StoreApi(StoreApiRaw(dio), serializationRepository); } /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed UserApi getUserApi() { - return UserApi(dio); + return UserApi(UserApiRaw(dio), serializationRepository); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart new file mode 100644 index 000000000000..6b618e77ca4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart @@ -0,0 +1,52 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart deleted file mode 100644 index 9f1eefd4c1a3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'inline_response_default.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class InlineResponseDefault { - /// Returns a new [InlineResponseDefault] instance. - InlineResponseDefault({ - - this.string, - }); - - @JsonKey( - - name: r'string', - required: false, - includeIfNull: false - ) - - - final Foo? string; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is InlineResponseDefault && - other.string == string; - - @override - int get hashCode => - string.hashCode; - - factory InlineResponseDefault.fromJson(Map json) => _$InlineResponseDefaultFromJson(json); - - Map toJson() => _$InlineResponseDefaultToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart new file mode 100644 index 000000000000..fc0984150491 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart @@ -0,0 +1,29 @@ +import 'repository_base.dart'; +class JsonSerializableRepository extends SerializationRepositoryBase { + const JsonSerializableRepository(); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index 1a69ee77d623..355872f55e01 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -56,8 +56,9 @@ doc/StoreApi.md doc/Tag.md doc/User.md doc/UserApi.md +lib/api.dart +lib/models.dart lib/openapi.dart -lib/src/api.dart lib/src/api/another_fake_api.dart lib/src/api/default_api.dart lib/src/api/fake_api.dart @@ -65,7 +66,9 @@ lib/src/api/fake_classname_tags123_api.dart lib/src/api/pet_api.dart lib/src/api/store_api.dart lib/src/api/user_api.dart +lib/src/api_client.dart lib/src/api_util.dart +lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart lib/src/auth/basic_auth.dart @@ -121,5 +124,7 @@ lib/src/model/single_ref_type.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml 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 new file mode 100644 index 000000000000..21c64ae9bd39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart @@ -0,0 +1,8 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart new file mode 100644 index 000000000000..513b9edd08c8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart @@ -0,0 +1,53 @@ +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/date_serializer.dart'; +export 'package:openapi/src/model/date.dart'; +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_get_default_response.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 17f56a53fae1..9ae4491269b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -2,66 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/api/another_fake_api.dart'; -export 'package:openapi/src/api/default_api.dart'; -export 'package:openapi/src/api/fake_api.dart'; -export 'package:openapi/src/api/fake_classname_tags123_api.dart'; -export 'package:openapi/src/api/pet_api.dart'; -export 'package:openapi/src/api/store_api.dart'; -export 'package:openapi/src/api/user_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; +export 'api.dart'; +export 'models.dart'; +export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart index 12452dc9943c..47ff15f3cfcc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class AnotherFakeApi { - final Dio _dio; - - final Serializers _serializers; + final AnotherFakeApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const AnotherFakeApi(this._dio, this._serializers); + const AnotherFakeApi(this._rawApi, this._repository); /// To test special tags /// To test special tags and operation ID starting with number @@ -39,57 +37,31 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; + }) async { - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.call123testSpecialTags( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(ModelClient), - ) as ModelClient; - + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -113,3 +85,63 @@ class AnotherFakeApi { } } + +class AnotherFakeApiRaw { + + final Dio _dio; + + const AnotherFakeApiRaw(this._dio); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> call123testSpecialTags({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart index 3a81b986ac9d..7e3981b9a72f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/foo_get_default_response.dart'; class DefaultApi { - final Dio _dio; + final DefaultApiRaw _rawApi; + final SerializationRepositoryBase _repository; - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); + const DefaultApi(this._rawApi, this._repository); /// fooGet /// @@ -37,37 +35,27 @@ class DefaultApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.fooGet( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooGetDefaultResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(FooGetDefaultResponse), - ) as FooGetDefaultResponse; - + const TypeInfo(FooGetDefaultResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -91,3 +79,62 @@ class DefaultApi { } } + +class DefaultApiRaw { + + final Dio _dio; + + const DefaultApiRaw(this._dio); + + /// fooGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> fooGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index fd7946aa22e5..df58fb1a06d8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -3,10 +3,9 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/api_util.dart'; @@ -22,11 +21,10 @@ import 'package:openapi/src/model/user.dart'; class FakeApi { - final Dio _dio; - - final Serializers _serializers; + final FakeApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const FakeApi(this._dio, this._serializers); + const FakeApi(this._rawApi, this._repository); /// Health check endpoint /// @@ -48,37 +46,27 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/health'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.fakeHealthGet( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(HealthCheckResult), - ) as HealthCheckResult; - + const TypeInfo(HealthCheckResult), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -127,60 +115,24 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); + }) async { - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, + final _response = await _rawApi.fakeHttpSignatureTest( + + query1: query1 == null ? null : _repository.encodeQueryParameter(query1, const TypeInfo(String)) , + header1: header1 == null ? null : _repository.encodeStringParameter(header1, const TypeInfo(String)) , + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -207,53 +159,31 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; + }) async { - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } + Object? _bodyData; + _bodyData = body; - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.fakeOuterBooleanSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : rawResponse as bool; - + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(bool), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -298,57 +228,31 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(OuterComposite); - _bodyData = outerComposite == null ? null : _serializers.serialize(outerComposite, specifiedType: _type); + }) async { - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } + Object? _bodyData; + _bodyData = outerComposite == null ? null : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.fakeOuterCompositeSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(OuterComposite), - ) as OuterComposite; - + const TypeInfo(OuterComposite), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -393,53 +297,169 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/number'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', + }) async { + + Object? _bodyData; + _bodyData = body; + + final _response = await _rawApi.fakeOuterNumberSerialize( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, validateStatus: validateStatus, - ); + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); - dynamic _bodyData; + num? _responseData; try { - _bodyData = body; - - } catch(error, stackTrace) { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(num), + ); + } catch (error, stackTrace) { throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), + requestOptions: _response.requestOptions, + response: _response, type: DioErrorType.unknown, error: error, stackTrace: stackTrace, ); } - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = body; + + final _response = await _rawApi.fakeOuterStringSerialize( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); - num? _responseData; + String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : rawResponse as num; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioError] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(outerObjectWithEnumProperty, const TypeInfo(OuterObjectWithEnumProperty)); + + final _response = await _rawApi.fakePropertyEnumIntegerSerialize( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + OuterObjectWithEnumProperty? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(OuterObjectWithEnumProperty), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -450,7 +470,7 @@ class FakeApi { ); } - return Response( + return Response( data: _responseData, headers: _response.headers, isRedirect: _response.isRedirect, @@ -462,6 +482,828 @@ class FakeApi { ); } + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = body?.finalize(); + + final _response = await _rawApi.testBodyWithBinary( + + body: _bodyData, + requestContentType: 'image/png', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + + final _response = await _rawApi.testBodyWithFileSchema( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.testBodyWithQueryParams( + + query: _repository.encodeQueryParameter(query, const TypeInfo(String)) , + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + + final _response = await _rawApi.testClientModel( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + Uint8List? binary, + Date? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (integer != null) r'integer': _repository.encodeFormParameter(integer, const TypeInfo(int)), + if (int32 != null) r'int32': _repository.encodeFormParameter(int32, const TypeInfo(int)), + if (int64 != null) r'int64': _repository.encodeFormParameter(int64, const TypeInfo(int)), + r'number': _repository.encodeFormParameter(number, const TypeInfo(num)), + if (float != null) r'float': _repository.encodeFormParameter(float, const TypeInfo(double)), + r'double': _repository.encodeFormParameter(double_, const TypeInfo(double)), + if (string != null) r'string': _repository.encodeFormParameter(string, const TypeInfo(String)), + r'pattern_without_delimiter': _repository.encodeFormParameter(patternWithoutDelimiter, const TypeInfo(String)), + r'byte': _repository.encodeFormParameter(byte, const TypeInfo(String)), + if (binary != null) r'binary': _repository.encodeFormParameter(binary, const TypeInfo(Uint8List)), + if (date != null) r'date': _repository.encodeFormParameter(date, const TypeInfo(Date)), + if (dateTime != null) r'dateTime': _repository.encodeFormParameter(dateTime, const TypeInfo(DateTime)), + if (password != null) r'password': _repository.encodeFormParameter(password, const TypeInfo(String)), + if (callback != null) r'callback': _repository.encodeFormParameter(callback, const TypeInfo(String)), + }; + + final _response = await _rawApi.testEndpointParameters( + + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testEnumParameters({ + BuiltList? enumHeaderStringArray, + String? enumHeaderString = '-efg', + BuiltList? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + BuiltList? enumQueryModelArray, + BuiltList? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (enumFormStringArray != null) r'enum_form_string_array': _repository.encodeFormParameter(enumFormStringArray, const TypeInfo(String, [const TypeInfo(String)])), + if (enumFormString != null) r'enum_form_string': _repository.encodeFormParameter(enumFormString, const TypeInfo(String)), + }; + + final _response = await _rawApi.testEnumParameters( + + enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository.encodeStringParameter(enumHeaderStringArray, const TypeInfo(String, [const TypeInfo(String)])) , + enumHeaderString: enumHeaderString == null ? null : _repository.encodeStringParameter(enumHeaderString, const TypeInfo(String)) , + enumQueryStringArray: enumQueryStringArray == null ? null : _repository.encodeQueryParameter(enumQueryStringArray, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , + enumQueryString: enumQueryString == null ? null : _repository.encodeQueryParameter(enumQueryString, const TypeInfo(String)) , + enumQueryInteger: enumQueryInteger == null ? null : _repository.encodeQueryParameter(enumQueryInteger, const TypeInfo(int)) , + enumQueryDouble: enumQueryDouble == null ? null : _repository.encodeQueryParameter(enumQueryDouble, const TypeInfo(double)) , + enumQueryModelArray: enumQueryModelArray == null ? null : _repository.encodeQueryParameter(enumQueryModelArray, const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), context: ListFormat.multi) , + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.testGroupParameters( + + requiredStringGroup: _repository.encodeQueryParameter(requiredStringGroup, const TypeInfo(int)) , + requiredBooleanGroup: _repository.encodeStringParameter(requiredBooleanGroup, const TypeInfo(bool)) , + requiredInt64Group: _repository.encodeQueryParameter(requiredInt64Group, const TypeInfo(int)) , + stringGroup: stringGroup == null ? null : _repository.encodeQueryParameter(stringGroup, const TypeInfo(int)) , + booleanGroup: booleanGroup == null ? null : _repository.encodeStringParameter(booleanGroup, const TypeInfo(bool)) , + int64Group: int64Group == null ? null : _repository.encodeQueryParameter(int64Group, const TypeInfo(int)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required BuiltMap requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(requestBody, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + + final _response = await _rawApi.testInlineAdditionalProperties( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + r'param': _repository.encodeFormParameter(param, const TypeInfo(String)), + r'param2': _repository.encodeFormParameter(param2, const TypeInfo(String)), + }; + + final _response = await _rawApi.testJsonFormData( + + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required BuiltList pipe, + required BuiltList ioutil, + required BuiltList http, + required BuiltList url, + required BuiltList context, + required String allowEmpty, + BuiltMap? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.testQueryParameterCollectionFormat( + + pipe: _repository.encodeQueryParameter(pipe, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.pipes) , + ioutil: _repository.encodeQueryParameter(ioutil, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + http: _repository.encodeQueryParameter(http, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.ssv) , + url: _repository.encodeQueryParameter(url, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + context: _repository.encodeQueryParameter(context, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , + allowEmpty: _repository.encodeQueryParameter(allowEmpty, const TypeInfo(String)) , + language: language == null ? null : _repository.encodeQueryParameter(language, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} + +class FakeApiRaw { + + final Dio _dio; + + const FakeApiRaw(this._dio); + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeHealthGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> fakeHttpSignatureTest({ + Object? query1, + String? header1, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + return await _dio.request( + _path, + data: body, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioError] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + /// fakeOuterStringSerialize /// Test serialization of outer string types /// @@ -476,8 +1318,10 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, + Future> fakeOuterStringSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -489,68 +1333,25 @@ class FakeApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - String? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : rawResponse as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// fakePropertyEnumIntegerSerialize @@ -567,8 +1368,10 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + Future> fakePropertyEnumIntegerSerialize({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -580,72 +1383,25 @@ class FakeApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(OuterObjectWithEnumProperty); - _bodyData = _serializers.serialize(outerObjectWithEnumProperty, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - OuterObjectWithEnumProperty? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(OuterObjectWithEnumProperty), - ) as OuterObjectWithEnumProperty; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// testBodyWithBinary @@ -663,7 +1419,9 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testBodyWithBinary({ - MultipartFile? body, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -675,43 +1433,25 @@ class FakeApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'image/png', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = body?.finalize(); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testBodyWithFileSchema @@ -729,7 +1469,9 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -741,44 +1483,25 @@ class FakeApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(FileSchemaTestClass); - _bodyData = _serializers.serialize(fileSchemaTestClass, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testBodyWithQueryParams @@ -797,8 +1520,10 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testBodyWithQueryParams({ - required String query, - required User user, + required Object query, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -810,50 +1535,30 @@ class FakeApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'query': encodeQueryParameter(_serializers, query, const FullType(String)), + r'query': query, }; - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// To test \"client\" model @@ -870,8 +1575,10 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, + Future> testClientModel({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -883,72 +1590,25 @@ class FakeApi { final _options = Options( method: r'PATCH', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ModelClient? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ModelClient), - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -979,20 +1639,9 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - Uint8List? binary, - Date? date, - DateTime? dateTime, - String? password, - String? callback, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1004,6 +1653,7 @@ class FakeApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -1016,52 +1666,18 @@ class FakeApi { ], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = { - if (integer != null) r'integer': encodeQueryParameter(_serializers, integer, const FullType(int)), - if (int32 != null) r'int32': encodeQueryParameter(_serializers, int32, const FullType(int)), - if (int64 != null) r'int64': encodeQueryParameter(_serializers, int64, const FullType(int)), - r'number': encodeQueryParameter(_serializers, number, const FullType(num)), - if (float != null) r'float': encodeQueryParameter(_serializers, float, const FullType(double)), - r'double': encodeQueryParameter(_serializers, double_, const FullType(double)), - if (string != null) r'string': encodeQueryParameter(_serializers, string, const FullType(String)), - r'pattern_without_delimiter': encodeQueryParameter(_serializers, patternWithoutDelimiter, const FullType(String)), - r'byte': encodeQueryParameter(_serializers, byte, const FullType(String)), - if (binary != null) r'binary': encodeQueryParameter(_serializers, binary, const FullType(Uint8List)), - if (date != null) r'date': encodeQueryParameter(_serializers, date, const FullType(Date)), - if (dateTime != null) r'dateTime': encodeQueryParameter(_serializers, dateTime, const FullType(DateTime)), - if (password != null) r'password': encodeQueryParameter(_serializers, password, const FullType(String)), - if (callback != null) r'callback': encodeQueryParameter(_serializers, callback, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// To test enum parameters @@ -1087,15 +1703,16 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testEnumParameters({ - BuiltList? enumHeaderStringArray, - String? enumHeaderString = '-efg', - BuiltList? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - BuiltList? enumQueryModelArray, - BuiltList? enumFormStringArray, - String? enumFormString, + String? enumHeaderStringArray, + String? enumHeaderString, + Object? enumQueryStringArray, + Object? enumQueryString, + Object? enumQueryInteger, + Object? enumQueryDouble, + Object? enumQueryModelArray, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1109,56 +1726,34 @@ class FakeApi { headers: { if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': encodeCollectionQueryParameter(_serializers, enumQueryStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (enumQueryString != null) r'enum_query_string': encodeQueryParameter(_serializers, enumQueryString, const FullType(String)), - if (enumQueryInteger != null) r'enum_query_integer': encodeQueryParameter(_serializers, enumQueryInteger, const FullType(int)), - if (enumQueryDouble != null) r'enum_query_double': encodeQueryParameter(_serializers, enumQueryDouble, const FullType(double)), - if (enumQueryModelArray != null) r'enum_query_model_array': encodeCollectionQueryParameter(_serializers, enumQueryModelArray, const FullType(BuiltList, [FullType(ModelEnumClass)]), format: ListFormat.multi,), + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryString != null) r'enum_query_string': enumQueryString, + if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, + if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, }; - dynamic _bodyData; - - try { - _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': encodeCollectionQueryParameter(_serializers, enumFormStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - if (enumFormString != null) r'enum_form_string': encodeQueryParameter(_serializers, enumFormString, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Fake endpoint to test group parameters (optional) @@ -1181,12 +1776,15 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, + required Object requiredStringGroup, + required String requiredBooleanGroup, + required Object requiredInt64Group, + Object? stringGroup, + String? booleanGroup, + Object? int64Group, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1200,6 +1798,7 @@ class FakeApi { headers: { r'required_boolean_group': requiredBooleanGroup, if (booleanGroup != null) r'boolean_group': booleanGroup, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -1212,26 +1811,26 @@ class FakeApi { ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'required_string_group': encodeQueryParameter(_serializers, requiredStringGroup, const FullType(int)), - r'required_int64_group': encodeQueryParameter(_serializers, requiredInt64Group, const FullType(int)), - if (stringGroup != null) r'string_group': encodeQueryParameter(_serializers, stringGroup, const FullType(int)), - if (int64Group != null) r'int64_group': encodeQueryParameter(_serializers, int64Group, const FullType(int)), + r'required_string_group': requiredStringGroup, + r'required_int64_group': requiredInt64Group, + if (stringGroup != null) r'string_group': stringGroup, + if (int64Group != null) r'int64_group': int64Group, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// test inline additionalProperties @@ -1249,7 +1848,9 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testInlineAdditionalProperties({ - required BuiltMap requestBody, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1261,44 +1862,25 @@ class FakeApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(BuiltMap, [FullType(String), FullType(String)]); - _bodyData = _serializers.serialize(requestBody, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// test json serialization of form data @@ -1317,8 +1899,9 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testJsonFormData({ - required String param, - required String param2, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1330,46 +1913,25 @@ class FakeApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = { - r'param': encodeQueryParameter(_serializers, param, const FullType(String)), - r'param2': encodeQueryParameter(_serializers, param2, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// testQueryParameterCollectionFormat @@ -1393,13 +1955,16 @@ class FakeApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> testQueryParameterCollectionFormat({ - required BuiltList pipe, - required BuiltList ioutil, - required BuiltList http, - required BuiltList url, - required BuiltList context, - required String allowEmpty, - BuiltMap? language, + required Object pipe, + required Object ioutil, + required Object http, + required Object url, + required Object context, + required Object allowEmpty, + Object? language, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1411,35 +1976,38 @@ class FakeApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'pipe': encodeCollectionQueryParameter(_serializers, pipe, const FullType(BuiltList, [FullType(String)]), format: ListFormat.pipes,), - r'ioutil': encodeCollectionQueryParameter(_serializers, ioutil, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'http': encodeCollectionQueryParameter(_serializers, http, const FullType(BuiltList, [FullType(String)]), format: ListFormat.ssv,), - r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), - r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), + r'pipe': pipe, + r'ioutil': ioutil, + r'http': http, + r'url': url, + r'context': context, + if (language != null) r'language': language, + r'allowEmpty': allowEmpty, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart index 8eab108825a1..df883fef655f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart @@ -3,19 +3,17 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class FakeClassnameTags123Api { - final Dio _dio; - - final Serializers _serializers; + final FakeClassnameTags123ApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const FakeClassnameTags123Api(this._dio, this._serializers); + const FakeClassnameTags123Api(this._rawApi, this._repository); /// To test class name in snake case /// To test class name in snake case @@ -39,64 +37,31 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); + }) async { - dynamic _bodyData; + Object? _bodyData; + _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.testClassname( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(ModelClient), - ) as ModelClient; - + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -120,3 +85,70 @@ class FakeClassnameTags123Api { } } + +class FakeClassnameTags123ApiRaw { + + final Dio _dio; + + const FakeClassnameTags123ApiRaw(this._dio); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioError] if API call or serialization fails + Future> testClassname({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart index 69f824c761df..d60391b2b60c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart @@ -3,22 +3,557 @@ // import 'dart:async'; +import 'package:dio/dio.dart'; +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final PetApiRaw _rawApi; + final SerializationRepositoryBase _repository; + + const PetApi(this._rawApi, this._repository); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + + final _response = await _rawApi.addPet( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.deletePet( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + apiKey: apiKey == null ? null : _repository.encodeStringParameter(apiKey, const TypeInfo(String)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltList] as data + /// Throws [DioError] if API call or serialization fails + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required BuiltList status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.findPetsByStatus( + + status: _repository.encodeQueryParameter(status, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltList? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltList, [const TypeInfo(Pet)]), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltSet] as data + /// Throws [DioError] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required BuiltSet tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.findPetsByTags( + + tags: _repository.encodeQueryParameter(tags, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltSet? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltSet, [const TypeInfo(Pet)]), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioError] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.getPetById( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(Pet), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + + final _response = await _rawApi.updatePet( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = { + if (name != null) r'name': _repository.encodeFormParameter(name, const TypeInfo(String)), + if (status != null) r'status': _repository.encodeFormParameter(status, const TypeInfo(String)), + }; + + final _response = await _rawApi.updatePetWithForm( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'application/x-www-form-urlencoded', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (file != null) r'file': file, + }); + + final _response = await _rawApi.uploadFile( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'multipart/form-data', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + r'requiredFile': requiredFile, + }); + + final _response = await _rawApi.uploadFileWithRequiredFile( + + petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + body: _bodyData, + requestContentType: 'multipart/form-data', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; + ApiResponse? _responseData; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/pet.dart'; + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } -class PetApi { + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } - final Dio _dio; +} + +class PetApiRaw { - final Serializers _serializers; + final Dio _dio; - const PetApi(this._dio, this._serializers); + const PetApiRaw(this._dio); /// Add a new pet to the store /// @@ -35,7 +570,9 @@ class PetApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> addPet({ - required Pet pet, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -47,6 +584,7 @@ class PetApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -58,38 +596,18 @@ class PetApi { ], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Deletes a pet @@ -108,8 +626,11 @@ class PetApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> deletePet({ - required int petId, + required String petId, String? apiKey, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -122,6 +643,7 @@ class PetApi { method: r'DELETE', headers: { if (apiKey != null) r'api_key': apiKey, + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -133,18 +655,18 @@ class PetApi { ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Finds Pets by status @@ -161,8 +683,11 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required BuiltList status, + Future> findPetsByStatus({ + @Deprecated('status is deprecated') required Object status, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -174,6 +699,7 @@ class PetApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -185,51 +711,23 @@ class PetApi { ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'status': encodeCollectionQueryParameter(_serializers, status, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), + r'status': status, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - BuiltList? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(BuiltList, [FullType(Pet)]), - ) as BuiltList; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Finds Pets by tags @@ -247,8 +745,11 @@ class PetApi { /// Returns a [Future] containing a [Response] with a [BuiltSet] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required BuiltSet tags, + Future> findPetsByTags({ + required Object tags, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -260,6 +761,7 @@ class PetApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -271,51 +773,23 @@ class PetApi { ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'tags': encodeCollectionQueryParameter(_serializers, tags, const FullType(BuiltSet, [FullType(String)]), format: ListFormat.csv,), + r'tags': tags, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - BuiltSet? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(BuiltSet, [FullType(Pet)]), - ) as BuiltSet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Find pet by ID @@ -332,8 +806,11 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ - required int petId, + Future> getPetById({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -345,6 +822,7 @@ class PetApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -358,46 +836,18 @@ class PetApi { ], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - Pet? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Pet), - ) as Pet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Update an existing pet @@ -415,7 +865,9 @@ class PetApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> updatePet({ - required Pet pet, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -427,6 +879,7 @@ class PetApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -438,38 +891,18 @@ class PetApi { ], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Updates a pet in the store with form data @@ -489,9 +922,10 @@ class PetApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> updatePetWithForm({ - required int petId, - String? name, - String? status, + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -503,6 +937,7 @@ class PetApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -514,40 +949,18 @@ class PetApi { ], ...?extra, }, - contentType: 'application/x-www-form-urlencoded', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = { - if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)), - if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// uploads an image @@ -566,10 +979,11 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, + Future> uploadFile({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -581,6 +995,7 @@ class PetApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -592,68 +1007,18 @@ class PetApi { ], ...?extra, }, - contentType: 'multipart/form-data', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - if (file != null) r'file': file, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ApiResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ApiResponse), - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// uploads an image (required) @@ -672,10 +1037,11 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, + Future> uploadFileWithRequiredFile({ + required String petId, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -687,6 +1053,7 @@ class PetApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { @@ -698,68 +1065,20 @@ class PetApi { ], ...?extra, }, - contentType: 'multipart/form-data', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - r'requiredFile': requiredFile, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - ApiResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ApiResponse), - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart index 02d567ba40fb..4392c5a9dc6d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart @@ -3,20 +3,18 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/order.dart'; class StoreApi { - final Dio _dio; + final StoreApiRaw _rawApi; + final SerializationRepositoryBase _repository; - final Serializers _serializers; - - const StoreApi(this._dio, this._serializers); + const StoreApi(this._rawApi, this._repository); /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -40,27 +38,19 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.deleteOrder( + + orderId: _repository.encodeStringParameter(orderId, const TypeInfo(String)), - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -85,44 +75,27 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/inventory'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.getInventory( + - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltMap? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(int)]), - ) as BuiltMap; - + const TypeInfo(BuiltMap, [TypeInfo(String), const TypeInfo(int)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -167,37 +140,28 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); + }) async { + + final _response = await _rawApi.getOrderById( + + orderId: _repository.encodeStringParameter(orderId, const TypeInfo(int)), - final _response = await _dio.request( - _path, - options: _options, cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(Order), - ) as Order; - + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -242,57 +206,31 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; + }) async { - try { - const _type = FullType(Order); - _bodyData = _serializers.serialize(order, specifiedType: _type); + Object? _bodyData; + _bodyData = _repository.serialize(order, const TypeInfo(Order)); - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, + final _response = await _rawApi.placeOrder( + + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( + _responseData = rawResponse == null ? null : _repository.deserialize( rawResponse, - specifiedType: const FullType(Order), - ) as Order; - + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -316,3 +254,221 @@ class StoreApi { } } + +class StoreApiRaw { + + final Dio _dio; + + const StoreApiRaw(this._dio); + + /// Delete purchase order by ID + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltMap] as data + /// Throws [DioError] if API call or serialization fails + Future> getInventory({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> getOrderById({ + required String orderId, + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioError] if API call or serialization fails + Future> placeOrder({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart index 9c8f7c15a564..2d143a58b09b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart @@ -3,21 +3,19 @@ // import 'dart:async'; - -import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; - +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/src/model/user.dart'; class UserApi { - final Dio _dio; - - final Serializers _serializers; + final UserApiRaw _rawApi; + final SerializationRepositoryBase _repository; - const UserApi(this._dio, this._serializers); + const UserApi(this._rawApi, this._repository); /// Create user /// This can only be done by the logged in user. @@ -41,49 +39,421 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.createUser( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithArrayInput({ + required BuiltList user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + + final _response = await _rawApi.createUsersWithArrayInput( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUsersWithListInput({ + required BuiltList user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + + final _response = await _rawApi.createUsersWithListInput( + + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.deleteUser( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioError] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.getUserByName( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(User), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioError] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.loginUser( + + username: _repository.encodeQueryParameter(username, const TypeInfo(String)) , + password: _repository.encodeQueryParameter(password, const TypeInfo(String)) , + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + final _response = await _rawApi.logoutUser( + + + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + + Object? _bodyData; + _bodyData = _repository.serialize(user, const TypeInfo(User)); + + final _response = await _rawApi.updateUser( + + username: _repository.encodeStringParameter(username, const TypeInfo(String)), + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} + +class UserApiRaw { + + final Dio _dio; + + const UserApiRaw(this._dio); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> createUser({ + Object? body, + String? requestContentType, + String? acceptContentType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, }) async { final _path = r'/user'; final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Creates list of users with given input array @@ -101,7 +471,9 @@ class UserApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> createUsersWithArrayInput({ - required BuiltList user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -113,44 +485,25 @@ class UserApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Creates list of users with given input array @@ -168,7 +521,9 @@ class UserApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> createUsersWithListInput({ - required BuiltList user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -180,44 +535,25 @@ class UserApi { final _options = Options( method: r'POST', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Delete user @@ -236,6 +572,9 @@ class UserApi { /// Throws [DioError] if API call or serialization fails Future> deleteUser({ required String username, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -247,24 +586,25 @@ class UserApi { final _options = Options( method: r'DELETE', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Get user by user name @@ -281,8 +621,11 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -294,52 +637,25 @@ class UserApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - User? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(User), - ) as User; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Logs user into the system @@ -357,9 +673,12 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, + Future> loginUser({ + required Object username, + required Object password, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -371,55 +690,31 @@ class UserApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); final _queryParameters = { - r'username': encodeQueryParameter(_serializers, username, const FullType(String)), - r'password': encodeQueryParameter(_serializers, password, const FullType(String)), + r'username': username, + r'password': password, }; - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, queryParameters: _queryParameters, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - String? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : rawResponse as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); } /// Logs out current logged in user session @@ -436,6 +731,9 @@ class UserApi { /// Returns a [Future] /// Throws [DioError] if API call or serialization fails Future> logoutUser({ + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -447,24 +745,25 @@ class UserApi { final _options = Options( method: r'GET', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, + contentType: requestContentType, validateStatus: validateStatus, ); - final _response = await _dio.request( + return await _dio.request( _path, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } /// Updated user @@ -484,7 +783,9 @@ class UserApi { /// Throws [DioError] if API call or serialization fails Future> updateUser({ required String username, - required User user, + Object? body, + String? requestContentType, + String? acceptContentType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -496,44 +797,27 @@ class UserApi { final _options = Options( method: r'PUT', headers: { + if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, }, extra: { 'secure': >[], ...?extra, }, - contentType: 'application/json', + contentType: requestContentType, validateStatus: validateStatus, ); - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( + return await _dio.request( _path, - data: _bodyData, + data: body, options: _options, cancelToken: cancelToken, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); - - return _response; } } + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart similarity index 74% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart rename to samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart index 53d0c5a524bb..1c1bbff39188 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart @@ -3,38 +3,30 @@ // import 'package:dio/dio.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/another_fake_api.dart'; -import 'package:openapi/src/api/default_api.dart'; -import 'package:openapi/src/api/fake_api.dart'; -import 'package:openapi/src/api/fake_classname_tags123_api.dart'; -import 'package:openapi/src/api/pet_api.dart'; -import 'package:openapi/src/api/store_api.dart'; -import 'package:openapi/src/api/user_api.dart'; +import 'repository_base.dart'; +import 'repository_impl.dart'; +import 'package:openapi/api.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/auth/_exports.dart'; class Openapi { static const String basePath = r'http://petstore.swagger.io:80/v2'; final Dio dio; - final Serializers serializers; + final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, - Serializers? serializers, + SerializationRepositoryBase? serializationRepositoryOverride, String? basePathOverride, List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? + }) : this.dio = dio ?? Dio(BaseOptions( baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )) { + )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -74,42 +66,42 @@ class Openapi { /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed AnotherFakeApi getAnotherFakeApi() { - return AnotherFakeApi(dio, serializers); + return AnotherFakeApi(AnotherFakeApiRaw(dio), serializationRepository); } /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { - return DefaultApi(dio, serializers); + return DefaultApi(DefaultApiRaw(dio), serializationRepository); } /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeApi getFakeApi() { - return FakeApi(dio, serializers); + return FakeApi(FakeApiRaw(dio), serializationRepository); } /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(dio, serializers); + return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); } /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed PetApi getPetApi() { - return PetApi(dio, serializers); + return PetApi(PetApiRaw(dio), serializationRepository); } /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed StoreApi getStoreApi() { - return StoreApi(dio, serializers); + return StoreApi(StoreApiRaw(dio), serializationRepository); } /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed UserApi getUserApi() { - return UserApi(dio, serializers); + return UserApi(UserApiRaw(dio), serializationRepository); } } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart new file mode 100644 index 000000000000..f038e92358ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart @@ -0,0 +1,5 @@ +export 'api_key_auth.dart'; +export 'basic_auth.dart'; +export 'oauth.dart'; +export 'bearer_auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart index db3c5c437db1..06e023d91be5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart @@ -4,7 +4,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; +import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart new file mode 100644 index 000000000000..6b618e77ca4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart @@ -0,0 +1,52 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart deleted file mode 100644 index 74d5ed70f1e8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,91 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; -import 'package:one_of/any_of.dart'; -// ignore_for_file: unused_element, unused_import - -part 'inline_response_default.g.dart'; - -/// InlineResponseDefault -/// -/// Properties: -/// * [string] -@BuiltValue() -abstract class InlineResponseDefault implements Built { - @BuiltValueField(wireName: r'string') - Foo? get string; - - - InlineResponseDefault._(); - - factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(InlineResponseDefaultBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$InlineResponseDefaultSerializer(); - - -} - -class _$InlineResponseDefaultSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [InlineResponseDefault, _$InlineResponseDefault]; - - @override - final String wireName = r'InlineResponseDefault'; - - Iterable _serializeProperties(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) sync* { - if (object.string != null) { - yield r'string'; - yield serializers.serialize(object.string, - specifiedType: const FullType(Foo)); - } - } - - @override - Object serialize(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified, required List serializedList,required InlineResponseDefaultBuilder result, required List unhandled}) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Foo)) as Foo; - result.string.replace(valueDes); - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - InlineResponseDefault deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = InlineResponseDefaultBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties(serializers, serialized, specifiedType: specifiedType, serializedList: serializedList, unhandled: unhandled, result: result); - return result.build(); - } -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart new file mode 100644 index 000000000000..2a1cc1a0a4c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart @@ -0,0 +1,54 @@ +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} + +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); + + String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart new file mode 100644 index 000000000000..1f5aa928cbf2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + + } + + @override + Object encodeQueryParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}) { + } + + @override + Object serialize(T src, TypeInfo parsedType, {Object? context}) { + + } +} + +/* +old api_util.dart for reference + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart index 60f50e5a77f7..6293a3c59699 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -11,58 +11,8 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/additional_properties_class.dart'; -import 'package:openapi/src/model/all_of_with_single_ref.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/array_of_array_of_number_only.dart'; -import 'package:openapi/src/model/array_of_number_only.dart'; -import 'package:openapi/src/model/array_test.dart'; -import 'package:openapi/src/model/capitalization.dart'; -import 'package:openapi/src/model/cat.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/class_model.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:openapi/src/model/dog.dart'; -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/enum_arrays.dart'; -import 'package:openapi/src/model/enum_test.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_get_default_response.dart'; -import 'package:openapi/src/model/format_test.dart'; -import 'package:openapi/src/model/has_only_read_only.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/map_test.dart'; -import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -import 'package:openapi/src/model/model200_response.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:openapi/src/model/model_list.dart'; -import 'package:openapi/src/model/model_return.dart'; -import 'package:openapi/src/model/name.dart'; -import 'package:openapi/src/model/nullable_class.dart'; -import 'package:openapi/src/model/number_only.dart'; -import 'package:openapi/src/model/object_with_deprecated_fields.dart'; -import 'package:openapi/src/model/order.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/single_ref_type.dart'; -import 'package:openapi/src/model/special_model_name.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:openapi/src/model/user.dart'; +import 'package:openapi/models.dart'; part 'serializers.g.dart'; @SerializersFor([ From 13b1186eff5906c7acef69b97a66e69014f29d63 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 13 May 2023 14:26:41 +0200 Subject: [PATCH 03/31] completely decouple the networking and serialization mustache files into separate directories WIP serialization repo implmentation --- .../languages/DartDioClientCodegen.java | 156 +++++++-- .../dart/{libraries/dio => }/README.mustache | 0 .../dio => }/analysis_options.mustache | 0 .../src/main/resources/dart/api.mustache | 1 + .../src/main/resources/dart/api_doc.mustache | 1 + .../src/main/resources/dart/api_test.mustache | 1 + .../src/main/resources/dart/class.mustache | 1 + .../src/main/resources/dart/enum.mustache | 1 + .../{libraries/dio => }/gitignore.mustache | 0 .../dart/{libraries/dio => }/header.mustache | 0 .../dart/{libraries/dio => }/lib.mustache | 2 +- .../resources/dart/lib_api_exports.mustache | 3 + .../dio => }/lib_model_exports.mustache | 0 .../resources/dart/libraries/dio/api.mustache | 4 +- .../dart/libraries/dio/api_client.mustache | 4 +- .../dart/libraries/dio/api_doc.mustache | 4 +- .../dart/libraries/dio/class.mustache | 1 - .../dart/libraries/dio/enum.mustache | 1 - .../libraries/dio/lib_api_exports.mustache | 3 - .../json_serializable/deserialize.mustache | 64 ---- .../repository_construction.mustache | 1 - .../repository_impl.mustache | 29 -- .../dart/libraries/http/README.mustache | 145 +++++++++ .../analysis_options.mustache} | 0 .../dart/libraries/http/api.mustache | 194 +++++++++++ .../dart/libraries/http/api_client.mustache | 251 +++++++++++++++ .../dart/libraries/http/api_doc.mustache | 96 ++++++ .../libraries/http/api_exception.mustache | 23 ++ .../dart/libraries/http/api_helper.mustache | 100 ++++++ .../dart/libraries/http/api_test.mustache | 29 ++ .../dart/libraries/http/apilib.mustache | 33 ++ .../libraries/http/auth/api_key_auth.mustache | 30 ++ .../http/auth/authentication.mustache | 7 + .../dart/libraries/http/auth/header.mustache | 9 + .../http/auth/http_basic_auth.mustache | 16 + .../http/auth/http_bearer_auth.mustache | 39 +++ .../dart/libraries/http/auth/oauth.mustache | 14 + .../dart/libraries/http/auth/part_of.mustache | 1 + .../libraries/http/dart_constructor.mustache | 10 + .../dart/libraries/http/git_push.sh.mustache | 57 ++++ .../dart/libraries/http/gitignore.mustache | 17 + .../dart/libraries/http/header.mustache | 9 + .../dart/libraries/http/model.mustache | 16 + .../dart/libraries/http/model_test.mustache | 29 ++ .../dart/libraries/http/object_doc.mustache | 16 + .../dart/libraries/http/part_of.mustache | 1 + .../dart/libraries/http/pubspec.mustache | 25 ++ .../native/native_class.mustache | 301 ++++++++++++++++++ .../serialization/native/native_enum.mustache | 81 +++++ .../native/native_enum_inline.mustache | 81 +++++ .../dart/libraries/http/travis.mustache | 14 + .../dart/{libraries/dio => }/model.mustache | 0 .../{libraries/dio => }/model_test.mustache | 2 +- .../{libraries/dio => }/object_doc.mustache | 2 +- .../dart/{libraries/dio => }/pubspec.mustache | 2 +- .../serialization/built_value/class.mustache | 0 .../built_value/class_concrete.mustache | 0 .../built_value/class_discriminator.mustache | 0 .../built_value/class_header.mustache | 0 .../built_value/class_inline_enums.mustache | 0 .../built_value/class_members.mustache | 0 .../built_value/class_serializer.mustache | 0 .../serialization/built_value/date.mustache | 0 .../built_value/date_serializer.mustache | 0 .../deserialize_properties.mustache | 0 .../serialization/built_value/enum.mustache | 0 .../built_value/enum_inline.mustache | 0 .../offset_date_serializer.mustache | 0 .../repository_construction.mustache | 0 .../built_value/repository_impl.mustache | 41 ++- .../built_value/serializers.mustache | 0 .../built_value/test_instance.mustache | 0 .../variable_serializer_type.mustache | 0 .../built_value/variable_type.mustache | 0 .../json_serializable/build.yaml.mustache | 0 .../json_serializable/class.mustache | 0 .../dart_constructor.mustache | 0 .../json_serializable/enum.mustache | 0 .../json_serializable/enum_inline.mustache | 0 .../repository_construction.mustache | 1 + .../repository_impl.mustache | 94 ++++++ .../json_serializable/test_instance.mustache | 0 .../serialization/repository_base.mustache | 29 +- .../dart/types/recursion_base_type.mustache | 0 .../types/recursion_base_type_info.mustache | 0 85 files changed, 1927 insertions(+), 165 deletions(-) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/README.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/analysis_options.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/enum.mustache rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/header.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/lib.mustache (83%) create mode 100644 modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/lib_model_exports.mustache (100%) delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache rename modules/openapi-generator/src/main/resources/dart/libraries/{dio/types/recursion_base_type.mustache => http/analysis_options.mustache} (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache create mode 100755 modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/model.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/model_test.mustache (87%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/object_doc.mustache (93%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/pubspec.mustache (96%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_concrete.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_discriminator.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_header.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_inline_enums.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_members.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/class_serializer.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/date.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/date_serializer.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/deserialize_properties.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/enum.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/enum_inline.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/offset_date_serializer.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/repository_construction.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/repository_impl.mustache (68%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/serializers.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/test_instance.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/variable_serializer_type.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/built_value/variable_type.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/build.yaml.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/class.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/dart_constructor.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/enum.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/enum_inline.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/json_serializable/test_instance.mustache (100%) rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/serialization/repository_base.mustache (63%) create mode 100644 modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache rename modules/openapi-generator/src/main/resources/dart/{libraries/dio => }/types/recursion_base_type_info.mustache (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index a7b705b03385..c946c37573a7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -64,6 +64,10 @@ public class DartDioClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; + public static final String NETWORKING_LIBRARY_DIO = "dio"; + public static final String NETWORKING_LIBRARY_HTTP = "http"; + public static final String NETWORKING_LIBRARY_DEFAULT = NETWORKING_LIBRARY_DIO; + private static final String DIO_IMPORT = "package:dio/dio.dart"; public static final String FINAL_PROPERTIES = "finalProperties"; public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; @@ -71,11 +75,17 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private static final String CLIENT_NAME = "clientName"; private String dateLibrary; + + private String serializationLibrary; private String clientName; private TemplateManager templateManager; + private Map supportedSerializationLibraries = new LinkedHashMap<>(); + + + public DartDioClientCodegen() { super(); @@ -97,15 +107,22 @@ public DartDioClientCodegen() { .build(); outputFolder = "generated-code/dart-dio"; - embeddedTemplateDir = "dart/libraries/dio"; + embeddedTemplateDir = "dart"; this.setTemplateDir(embeddedTemplateDir); - supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); - supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); - final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); - serializationLibrary.setEnum(supportedLibraries); - serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); - cliOptions.add(serializationLibrary); + supportedLibraries.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] dio"); + supportedLibraries.put(NETWORKING_LIBRARY_HTTP, "[BETA] http"); + final CliOption networkingLibraryOptions = CliOption.newString(CodegenConstants.LIBRARY, "Specify networking library"); + networkingLibraryOptions.setEnum(supportedLibraries); + networkingLibraryOptions.setDefault(NETWORKING_LIBRARY_DEFAULT); + cliOptions.add(networkingLibraryOptions); + + supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); + supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + final CliOption serializationLibraryOptions = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); + serializationLibraryOptions.setEnum(supportedLibraries); + serializationLibraryOptions.setDefault(SERIALIZATION_LIBRARY_DEFAULT); + cliOptions.add(serializationLibraryOptions); // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); @@ -130,6 +147,30 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } + public String getSerializationLibrary() { + return serializationLibrary; + } + + /** + * Set serialization library template. + * + * @param serializationLibrary Serialization Library template + */ + public void setSerializationLibrary(String serializationLibrary) { + if (serializationLibrary != null && !supportedSerializationLibraries.containsKey(serializationLibrary)) { + StringBuilder sb = new StringBuilder("Unknown serialization library: " + serializationLibrary + "\nAvailable serialization libraries:"); + if (supportedSerializationLibraries.size() == 0) { + sb.append("\n ").append("NONE"); + } else { + for (String lib : supportedSerializationLibraries.keySet()) { + sb.append("\n ").append(lib); + } + } + throw new RuntimeException(sb.toString()); + } + this.serializationLibrary = serializationLibrary; + } + public String getClientName() { return clientName; } @@ -157,12 +198,18 @@ public void processOpts() { LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } + if (!additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + additionalProperties.put(CodegenConstants.LIBRARY, NETWORKING_LIBRARY_DEFAULT); + LOGGER.debug("Networking library not set, using default {}", NETWORKING_LIBRARY_DEFAULT); + } + setLibrary(additionalProperties.get(CodegenConstants.LIBRARY).toString()); + if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DEFAULT); LOGGER.debug("Serialization library not set, using default {}", SERIALIZATION_LIBRARY_DEFAULT); } - setLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { this.setLegacyDiscriminatorBehavior(false); } @@ -192,28 +239,72 @@ public void processOpts() { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "api.dart")); + supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "apis.dart")); supportingFiles.add(new SupportingFile("lib_model_exports.mustache", libPath, "models.dart")); supportingFiles.add(new SupportingFile("lib.mustache", libPath, pubName + ".dart")); final String srcFolder = libPath + sourceFolder; - supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api_client.dart")); supportingFiles.add(new SupportingFile("serialization/repository_base.mustache", srcFolder, "repository_base.dart")); + + configureNetworkingLibrary(srcFolder); + configureSerializationLibrary(srcFolder); + configureDateLibrary(srcFolder); + } + + private void configureNetworkingLibrary(String sourceFolder) { + switch (library) { + case NETWORKING_LIBRARY_DIO: + additionalProperties.put("useDio", "true"); + configureNetworkingLibraryDio(sourceFolder); + break; + default: + case NETWORKING_LIBRARY_HTTP: + additionalProperties.put("useHttp", "true"); + configureNetworkingLibraryHttp(sourceFolder); + break; + } + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + templateManager = new TemplateManager( + templateManagerOptions, + getTemplatingEngine(), + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + // A lambda which allows for easy includes of serialization library specific + // templates without having to change the main template files. + additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { + MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); + String templateFile = "libraries/" + library + "/" + fragment.execute() + ".mustache"; + Template tmpl = engine.getCompiler() + .withLoader(name -> engine.findTemplate(templateManager, name)) + .defaultValue("") + .compile(templateManager.getFullTemplateContents(templateFile)); + + fragment.executeTemplate(tmpl, writer); + }); + } + private void configureNetworkingLibraryDio(String srcFolder) { + imports.put("MultipartFile", DIO_IMPORT); + final String dioMustacheFolder = "libraries/dio/"; + final String authMustacheFolder = dioMustacheFolder + "auth/"; + supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api_client.dart")); final String authFolder = srcFolder + File.separator + "auth"; - supportingFiles.add(new SupportingFile("auth/auth_exports.mustache", authFolder, "_exports.dart")); - supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); - supportingFiles.add(new SupportingFile("auth/basic_auth.mustache", authFolder, "basic_auth.dart")); - supportingFiles.add(new SupportingFile("auth/bearer_auth.mustache", authFolder, "bearer_auth.dart")); - supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); - supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "auth_exports.mustache", authFolder, "_exports.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "basic_auth.mustache", authFolder, "basic_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "bearer_auth.mustache", authFolder, "bearer_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "oauth.mustache", authFolder, "oauth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "auth.mustache", authFolder, "auth.dart")); + } + private void configureNetworkingLibraryHttp(String srcFolder) { - configureSerializationLibrary(srcFolder); - configureDateLibrary(srcFolder); } private void configureSerializationLibrary(String srcFolder) { - switch (library) { + switch (serializationLibrary) { case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: additionalProperties.put("useJsonSerializable", "true"); configureSerializationLibraryJsonSerializable(srcFolder); @@ -234,11 +325,12 @@ private void configureSerializationLibrary(String srcFolder) { new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} ); + // A lambda which allows for easy includes of serialization library specific // templates without having to change the main template files. - additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { + additionalProperties.put("includeSerializationTemplate", (Mustache.Lambda) (fragment, writer) -> { MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); - String templateFile = "serialization/" + library + "/" + fragment.execute() + ".mustache"; + String templateFile = "serialization/" + serializationLibrary + "/" + fragment.execute() + ".mustache"; Template tmpl = engine.getCompiler() .withLoader(name -> engine.findTemplate(templateManager, name)) .defaultValue("") @@ -267,20 +359,16 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { imports.put("BuiltMap", "package:built_collection/built_collection.dart"); imports.put("JsonObject", "package:built_value/json_object.dart"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", DIO_IMPORT); } private void configureSerializationLibraryJsonSerializable(String srcFolder) { supportingFiles.add(new SupportingFile("serialization/json_serializable/repository_impl.mustache", srcFolder, "repository_impl.dart")); - supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", "" /* main project dir */, "build.yaml")); - supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, - "deserialize.dart")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", "" /* main project dir */, "build.yaml")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { @@ -293,14 +381,14 @@ private void configureDateLibrary(String srcFolder) { typeMapping.put("datetime", "OffsetDateTime"); imports.put("OffsetDate", "package:time_machine/time_machine.dart"); imports.put("OffsetDateTime", "package:time_machine/time_machine.dart"); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart")); } break; default: case DATE_LIBRARY_CORE: additionalProperties.put("useDateLibCore", "true"); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { typeMapping.put("date", "Date"); typeMapping.put("Date", "Date"); importMapping.put("Date", "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); @@ -314,7 +402,7 @@ private void configureDateLibrary(String srcFolder) { @Override public String toDefaultValue(Schema schema) { if (schema.getDefault() != null) { - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { if (ModelUtils.isArraySchema(schema)) { if (ModelUtils.isSet(schema)) { return "SetBuilder()"; @@ -578,7 +666,7 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch @Override public Map postProcessAllModels(Map objs) { objs = super.postProcessAllModels(objs); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { adaptToDartInheritance(objs); syncRootTypesWithInnerVars(objs); } @@ -598,7 +686,7 @@ public Map postProcessAllModels(Map objs) @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { if (property.isEnum && property.getComposedSchemas() == null) { // enums are generated with built_value and make use of BuiltSet model.imports.add("BuiltSet"); @@ -636,7 +724,7 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, Listheader}} -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache b/modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache new file mode 100644 index 000000000000..81c0ad99e277 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache @@ -0,0 +1,3 @@ +{{#useDio}}export 'package:{{pubName}}/{{sourceFolder}}/api_client.dart';{{/useDio}}{{#apiInfo}} +{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache b/modules/openapi-generator/src/main/resources/dart/lib_model_exports.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_model_exports.mustache rename to modules/openapi-generator/src/main/resources/dart/lib_model_exports.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index b070cfb0b5bc..3337b1a58c0c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -7,7 +7,7 @@ import 'package:{{pubName}}/models.dart'; {{#imports}}import '{{.}}'; {{/imports}} -{{>api_typed}} -{{>api_raw}} +{{>libraries/dio/api_typed}} +{{>libraries/dio/api_raw}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache index a2ef2125b197..b4a5db7bdc57 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -2,7 +2,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:{{pubName}}/api.dart'; +import 'package:{{pubName}}/apis.dart'; import 'package:{{pubName}}/models.dart'; import 'package:{{pubName}}/{{sourceFolder}}/auth/_exports.dart'; @@ -23,7 +23,7 @@ class {{clientName}} { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? {{#includeLibraryTemplate}}repository_construction{{/includeLibraryTemplate}} { + )), this.serializationRepository = serializationRepositoryOverride ?? {{#includeSerializationTemplate}}repository_construction{{/includeSerializationTemplate}} { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache index 39e9163d75d8..ea52805920d0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache @@ -3,7 +3,7 @@ ## Load the API package ```dart -import 'package:{{pubName}}/api.dart'; +import 'package:{{pubName}}/{{pubName}}.dart'; ``` All URIs are relative to *{{basePath}}* @@ -24,7 +24,7 @@ Method | HTTP request | Description ### Example ```dart -import 'package:{{pubName}}/api.dart'; +import 'package:{{pubName}}/{{pubName}}.dart'; {{#hasAuthMethods}} {{#authMethods}} {{#isBasic}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache deleted file mode 100644 index 228fcf5826d1..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache deleted file mode 100644 index a47e780c2b57..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#includeLibraryTemplate}}enum{{/includeLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache deleted file mode 100644 index 3b7a3a8aaed2..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib_api_exports.mustache +++ /dev/null @@ -1,3 +0,0 @@ -export 'package:{{pubName}}/{{sourceFolder}}/api_client.dart'; -{{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; -{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache deleted file mode 100644 index edb8887328cd..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache +++ /dev/null @@ -1,64 +0,0 @@ -{{#models}} - {{#model}} - {{^isEnum}} -import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; -{{/isEnum}} -{{/model}} -{{/models}} - -final _regList = RegExp(r'^List<(.*)>$'); -final _regSet = RegExp(r'^Set<(.*)>$'); -final _regMap = RegExp(r'^Map$'); - - ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { - switch (targetType) { - case 'String': - return '$value' as ReturnType; - case 'int': - return (value is int ? value : int.parse('$value')) as ReturnType; - case 'bool': - if (value is bool) { - return value as ReturnType; - } - final valueString = '$value'.toLowerCase(); - return (valueString == 'true' || valueString == '1') as ReturnType; - case 'double': - return (value is double ? value : double.parse('$value')) as ReturnType; - {{#models}} - {{#model}} - case '{{{classname}}}': - {{#isEnum}} - {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} - {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} - {{/isEnum}} - {{^isEnum}} - return {{{classname}}}.fromJson(value as Map) as ReturnType; - {{/isEnum}} - {{/model}} - {{/models}} - default: - RegExpMatch? match; - - if (value is List && (match = _regList.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetType, growable: growable)) - .toList(growable: growable) as ReturnType; - } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetType, growable: growable)) - .toSet() as ReturnType; - } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - value.keys, - value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), - ) as ReturnType; - } - break; - } - throw Exception('Cannot deserialize'); - } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache deleted file mode 100644 index 842e9be7f1f5..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_construction.mustache +++ /dev/null @@ -1 +0,0 @@ -const JsonSerializableRepository() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache deleted file mode 100644 index fc0984150491..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/repository_impl.mustache +++ /dev/null @@ -1,29 +0,0 @@ -import 'repository_base.dart'; -class JsonSerializableRepository extends SerializationRepositoryBase { - const JsonSerializableRepository(); - - @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - - } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { - } - - @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { - } - - @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache new file mode 100644 index 000000000000..cab1887c577e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache @@ -0,0 +1,145 @@ +# {{{pubName}}} +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{{appVersion}}} +{{#artifactVersion}} +- Package version: {{{.}}} +{{/artifactVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{{generatedDate}}} +{{/hideGenerationTimestamp}} +- Build package: {{{generatorClass}}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements + +Dart 2.12 or later + +## Installation & Usage + +### Github +If this Dart package is published to Github, add the following dependency to your pubspec.yaml +``` +dependencies: + {{{pubName}}}: + git: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` + +### Local +To use the package in your local drive, add the following dependency to your pubspec.yaml +``` +dependencies: + {{{pubName}}}: + path: /path/to/{{{pubName}}} +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:{{{pubName}}}/api.dart'; +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +// TODO Configure HTTP basic authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; +{{/isBasicBasic}} +{{#isBasicBearer}} +// TODO Configure HTTP Bearer authorization: {{{name}}} +// Case 1. Use String Token +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); +// Case 2. Use Function which generate token. +// String yourTokenGeneratorFunction() { ... } +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +// TODO Configure API key authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; +{{/isApiKey}} +{{#isOAuth}} +// TODO Configure OAuth2 access token for authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; +{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +final api_instance = {{{classname}}}(); +{{#allParams}} +final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(result); + {{/returnType}} +} catch (e) { + print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{{modelDocPath}}}/{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} +### {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} +- **Type**: HTTP Basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: HTTP Bearer authentication +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/analysis_options.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type.mustache rename to modules/openapi-generator/src/main/resources/dart/libraries/http/analysis_options.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache new file mode 100644 index 000000000000..c6289c2b7662 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache @@ -0,0 +1,194 @@ +{{>header}} +{{>part_of}} +{{#operations}} + +class {{{classname}}} { + {{{classname}}}([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + {{#operation}} + + {{#summary}} + /// {{{.}}} + {{/summary}} + {{#notes}} + {{#summary}} + /// + {{/summary}} + /// {{{notes}}} + /// + /// Note: This method returns the HTTP [Response]. + {{/notes}} + {{^notes}} + {{#summary}} + /// + /// Note: This method returns the HTTP [Response]. + {{/summary}} + {{^summary}} + /// Performs an HTTP '{{{httpMethod}}} {{{path}}}' operation and returns the [Response]. + {{/summary}} + {{/notes}} + {{#hasParams}} + {{#summary}} + /// + {{/summary}} + {{^summary}} + {{#notes}} + /// + {{/notes}} + {{/summary}} + /// Parameters: + /// + {{/hasParams}} + {{#allParams}} + /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: + {{#description}} + /// {{{.}}} + {{/description}} + {{^-last}} + /// + {{/-last}} + {{/allParams}} + Future {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}}? {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + // ignore: prefer_const_declarations + final path = r'{{{path}}}'{{#pathParams}} + .replaceAll({{=<% %>=}}'{<% baseName %>}'<%={{ }}=%>, {{{paramName}}}{{^isString}}.toString(){{/isString}}){{/pathParams}}; + + // ignore: prefer_final_locals + Object? postBody{{#bodyParam}} = {{{paramName}}}{{/bodyParam}}; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + {{#hasQueryParams}} + + {{#queryParams}} + {{^required}} + if ({{{paramName}}} != null) { + {{/required}} + queryParams.addAll(_queryParams('{{{collectionFormat}}}', '{{{baseName}}}', {{{paramName}}})); + {{^required}} + } + {{/required}} + {{/queryParams}} + {{/hasQueryParams}} + {{#hasHeaderParams}} + + {{#headerParams}} + {{#required}} + headerParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); + {{/required}} + {{^required}} + if ({{{paramName}}} != null) { + headerParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); + } + {{/required}} + {{/headerParams}} + {{/hasHeaderParams}} + + const contentTypes = [{{#prioritizedContentTypes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/prioritizedContentTypes}}]; + + {{#isMultipart}} + bool hasFields = false; + final mp = MultipartRequest('{{{httpMethod}}}', Uri.parse(path)); + {{#formParams}} + {{^isFile}} + if ({{{paramName}}} != null) { + hasFields = true; + mp.fields[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); + } + {{/isFile}} + {{#isFile}} + if ({{{paramName}}} != null) { + hasFields = true; + mp.fields[r'{{{baseName}}}'] = {{{paramName}}}.field; + mp.files.add({{{paramName}}}); + } + {{/isFile}} + {{/formParams}} + if (hasFields) { + postBody = mp; + } + {{/isMultipart}} + {{^isMultipart}} + {{#formParams}} + {{^isFile}} + if ({{{paramName}}} != null) { + formParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); + } + {{/isFile}} + {{/formParams}} + {{/isMultipart}} + + return apiClient.invokeAPI( + path, + '{{{httpMethod}}}', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + {{#summary}} + /// {{{.}}} + {{/summary}} + {{#notes}} + {{#summary}} + /// + {{/summary}} + /// {{{notes}}} + {{/notes}} + {{#hasParams}} + {{#summary}} + /// + {{/summary}} + {{^summary}} + {{#notes}} + /// + {{/notes}} + {{/summary}} + /// Parameters: + /// + {{/hasParams}} + {{#allParams}} + /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: + {{#description}} + /// {{{.}}} + {{/description}} + {{^-last}} + /// + {{/-last}} + {{/allParams}} + Future<{{#returnType}}{{{.}}}?{{/returnType}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}}? {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + final response = await {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{{paramName}}}: {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + {{#returnType}} + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + {{#native_serialization}} + {{#isArray}} + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, '{{{returnType}}}') as List) + .cast<{{{returnBaseType}}}>() + .{{#uniqueItems}}toSet(){{/uniqueItems}}{{^uniqueItems}}toList(growable: false){{/uniqueItems}}; + {{/isArray}} + {{^isArray}} + {{#isMap}} + return {{{returnType}}}.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}'),); + {{/isMap}} + {{^isMap}} + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}',) as {{{returnType}}}; + {{/isMap}}{{/isArray}}{{/native_serialization}} + } + return null; + {{/returnType}} + } + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache new file mode 100644 index 000000000000..b340a9745757 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache @@ -0,0 +1,251 @@ +{{>header}} +{{>part_of}} +class ApiClient { + ApiClient({this.basePath = '{{{basePath}}}', this.authentication,}); + + final String basePath; + final Authentication? authentication; + + var _client = Client(); + final _defaultHeaderMap = {}; + + /// Returns the current HTTP [Client] instance to use in this class. + /// + /// The return value is guaranteed to never be null. + Client get client => _client; + + /// Requests to use a new HTTP [Client] in this class. + set client(Client newClient) { + _client = newClient; + } + + Map get defaultHeaderMap => _defaultHeaderMap; + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + // We don't use a Map for queryParams. + // If collectionFormat is 'multi', a key might appear multiple times. + Future invokeAPI( + String path, + String method, + List queryParams, + Object? body, + Map headerParams, + Map formParams, + String? contentType, + ) async { + await authentication?.applyToParams(queryParams, headerParams); + + headerParams.addAll(_defaultHeaderMap); + if (contentType != null) { + headerParams['Content-Type'] = contentType; + } + + final urlEncodedQueryParams = queryParams.map((param) => '$param'); + final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : ''; + final uri = Uri.parse('$basePath$path$queryString'); + + try { + // Special case for uploading a single file which isn't a 'multipart/form-data'. + if ( + body is MultipartFile && (contentType == null || + !contentType.toLowerCase().startsWith('multipart/form-data')) + ) { + final request = StreamedRequest(method, uri); + request.headers.addAll(headerParams); + request.contentLength = body.length; + body.finalize().listen( + request.sink.add, + onDone: request.sink.close, + // ignore: avoid_types_on_closure_parameters + onError: (Object error, StackTrace trace) => request.sink.close(), + cancelOnError: true, + ); + final response = await _client.send(request); + return Response.fromStream(response); + } + + if (body is MultipartRequest) { + final request = MultipartRequest(method, uri); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + final response = await _client.send(request); + return Response.fromStream(response); + } + + final msgBody = contentType == 'application/x-www-form-urlencoded' + ? formParams + : await serializeAsync(body); + final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; + + switch(method) { + case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,); + case 'GET': return await _client.get(uri, headers: nullableHeaderParams,); + } + } on SocketException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Socket operation failed: $method $path', + error, + trace, + ); + } on TlsException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'TLS/SSL communication failed: $method $path', + error, + trace, + ); + } on IOException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'I/O operation failed: $method $path', + error, + trace, + ); + } on ClientException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'HTTP connection failed: $method $path', + error, + trace, + ); + } on Exception catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Exception occurred: $method $path', + error, + trace, + ); + } + + throw ApiException( + HttpStatus.badRequest, + 'Invalid HTTP operation: $method $path', + ); + } +{{#native_serialization}} + + Future deserializeAsync(String json, String targetType, {bool growable = false,}) async => + // ignore: deprecated_member_use_from_same_package + deserialize(json, targetType, growable: growable); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') + dynamic deserialize(String json, String targetType, {bool growable = false,}) { + // Remove all spaces. Necessary for regular expressions as well. + targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? json + : _deserialize(jsonDecode(json), targetType, growable: growable); + } +{{/native_serialization}} + + // ignore: deprecated_member_use_from_same_package + Future serializeAsync(Object? value) async => serialize(value); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') + String serialize(Object? value) => value == null ? '' : json.encode(value); + +{{#native_serialization}} + static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { + try { + switch (targetType) { + case 'String': + return value is String ? value : value.toString(); + case 'int': + return value is int ? value : int.parse('$value'); + case 'double': + return value is double ? value : double.parse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + case 'DateTime': + return value is DateTime ? value : DateTime.tryParse(value); + {{#models}} + {{#model}} + case '{{{classname}}}': + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value); + {{/isEnum}} + {{/model}} + {{/models}} + default: + dynamic match; + if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => _deserialize(v, match, growable: growable,)) + .toList(growable: growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => _deserialize(v, match, growable: growable,)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) { + return Map.fromIterables( + value.keys.cast(), + value.values.map((dynamic v) => _deserialize(v, match, growable: growable,)), + ); + } + } + } on Exception catch (error, trace) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } +{{/native_serialization}} +} +{{#native_serialization}} + +/// Primarily intended for use in an isolate. +class DeserializationMessage { + const DeserializationMessage({ + required this.json, + required this.targetType, + this.growable = false, + }); + + /// The JSON value to deserialize. + final String json; + + /// Target type to deserialize to. + final String targetType; + + /// Whether to make deserialized lists or maps growable. + final bool growable; +} + +/// Primarily intended for use in an isolate. +Future deserializeAsync(DeserializationMessage message) async { + // Remove all spaces. Necessary for regular expressions as well. + final targetType = message.targetType.replaceAll(' ', ''); + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? message.json + : ApiClient._deserialize( + jsonDecode(message.json), + targetType, + growable: message.growable, + ); +} +{{/native_serialization}} + +/// Primarily intended for use in an isolate. +Future serializeAsync(Object? value) async => value == null ? '' : json.encode(value); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache new file mode 100644 index 000000000000..3332ff1f205d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache @@ -0,0 +1,96 @@ +# {{{pubName}}}.api.{{{classname}}}{{#description}} +{{{.}}}{{/description}} + +## Load the API package +```dart +import 'package:{{{pubName}}}/api.dart'; +``` + +All URIs are relative to *{{{basePath}}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +# **{{{operationId}}}** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Example +```dart +import 'package:{{{pubName}}}/api.dart'; +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +// TODO Configure HTTP basic authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; +{{/isBasicBasic}} +{{#isBasicBearer}} +// TODO Configure HTTP Bearer authorization: {{{name}}} +// Case 1. Use String Token +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); +// Case 2. Use Function which generate token. +// String yourTokenGeneratorFunction() { ... } +//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +// TODO Configure API key authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; +{{/isApiKey}} +{{#isOAuth}} +// TODO Configure OAuth2 access token for authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; +{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +final api_instance = {{{classname}}}(); +{{#allParams}} +final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(result); + {{/returnType}} +} catch (e) { + print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{{returnBaseType}}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache new file mode 100644 index 000000000000..aeb7aa9ce226 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache @@ -0,0 +1,23 @@ +{{>header}} +{{>part_of}} +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String? message; + Exception? innerException; + StackTrace? stackTrace; + + @override + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache new file mode 100644 index 000000000000..ec98b7d1d741 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache @@ -0,0 +1,100 @@ +{{>header}} +{{>part_of}} +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + + final params = []; + + if (value is List) { + if (collectionFormat == 'multi') { + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); + } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + {{#models}} + {{#model}} + {{#isEnum}} + if (value is {{{classname}}}) { +{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}} + } + {{/isEnum}} + {{/model}} + {{/models}} + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +Future _decodeBodyBytes(Response response) async { + final contentType = response.headers['content-type']; + return contentType != null && contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes) + : response.body; +} + +/// Returns a valid [T] value found at the specified Map [key], null otherwise. +T? mapValueOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + return value is T ? value : null; +} + +/// Returns a valid Map found at the specified Map [key], null otherwise. +Map? mapCastOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + return value is Map ? value.cast() : null; +} + +/// Returns a valid [DateTime] found at the specified Map [key], null otherwise. +DateTime? mapDateTime(dynamic map, String key, [String? pattern]) { + final dynamic value = map is Map ? map[key] : null; + if (value != null) { + int? millis; + if (value is int) { + millis = value; + } else if (value is String) { + if (pattern == _dateEpochMarker) { + millis = int.tryParse(value); + } else { + return DateTime.tryParse(value); + } + } + if (millis != null) { + return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true); + } + } + return null; +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache new file mode 100644 index 000000000000..6873ba0f9d4d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache @@ -0,0 +1,29 @@ +{{>header}} +import 'package:{{{pubName}}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{{classname}}} +void main() { + // final instance = {{{classname}}}(); + + group('tests for {{{classname}}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{{operationId}}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache new file mode 100644 index 000000000000..2fcebda4ea46 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache @@ -0,0 +1,33 @@ +{{>header}} +{{#pubLibrary}}library {{{.}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:intl/intl.dart'; +import 'package:meta/meta.dart'; + +part 'api_client.dart'; +part 'api_helper.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; +part 'auth/http_bearer_auth.dart'; + +{{#apiInfo}}{{#apis}}part 'api/{{{classFilename}}}.dart'; +{{/apis}}{{/apiInfo}} +{{#models}}{{#model}}part 'model/{{{classFilename}}}.dart'; +{{/model}}{{/models}} + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ApiClient defaultApiClient = ApiClient(); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache new file mode 100644 index 000000000000..4b8f707eeb5f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache @@ -0,0 +1,30 @@ +{{>header}} +{{>part_of}} +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix = ''; + String apiKey = ''; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; + + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache new file mode 100644 index 000000000000..6eff61ede0ec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache @@ -0,0 +1,7 @@ +{{>header}} +{{>part_of}} +// ignore: one_member_abstracts +abstract class Authentication { + /// Apply authentication settings to header and query params. + Future applyToParams(List queryParams, Map headerParams); +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache new file mode 100644 index 000000000000..3799d9d04658 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache new file mode 100644 index 000000000000..c83d037c7991 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache @@ -0,0 +1,16 @@ +{{>header}} +{{>part_of}} +class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + + String username; + String password; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache new file mode 100644 index 000000000000..6c1d3c0e843d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache @@ -0,0 +1,39 @@ +{{>header}} +{{>part_of}} +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('accessToken value must be either a String or a String Function().'); + } + _accessToken = accessToken; + } + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (_accessToken == null) { + return; + } + + String accessToken; + + if (_accessToken is String) { + accessToken = _accessToken; + } else if (_accessToken is HttpBearerAuthProvider) { + accessToken = _accessToken!(); + } else { + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache new file mode 100644 index 000000000000..0e65baa4c637 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache @@ -0,0 +1,14 @@ +{{>header}} +{{>part_of}} +class OAuth implements Authentication { + OAuth({this.accessToken = ''}); + + String accessToken; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache new file mode 100644 index 000000000000..d31ade250360 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache @@ -0,0 +1 @@ +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache new file mode 100644 index 000000000000..dc5dfec5f2a7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache @@ -0,0 +1,10 @@ + /// Returns a new [{{{classname}}}] instance. + {{{classname}}}({ + {{#vars}} + {{! + A field is required in Dart when it is + required && !defaultValue in OAS + }} + {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, + {{/vars}} + }); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache new file mode 100755 index 000000000000..0e3776ae6dd4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache new file mode 100644 index 000000000000..1be28ced0940 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache @@ -0,0 +1,17 @@ +# See https://dart.dev/guides/libraries/private-files + +.dart_tool/ +.packages +build/ +pubspec.lock # Except for application packages + +doc/api/ + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache new file mode 100644 index 000000000000..3799d9d04658 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache @@ -0,0 +1,9 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache new file mode 100644 index 000000000000..306c54e417e6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache @@ -0,0 +1,16 @@ +{{>header}} +{{>part_of}} +{{#models}} +{{#model}} +{{#isEnum}} +{{#native_serialization}} +{{>serialization/native/native_enum}} +{{/native_serialization}} +{{/isEnum}} +{{^isEnum}} +{{#native_serialization}} +{{>serialization/native/native_class}} +{{/native_serialization}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache new file mode 100644 index 000000000000..1a074d47b71d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache @@ -0,0 +1,29 @@ +{{>header}} +{{#models}} +{{#model}} +import 'package:{{{pubName}}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{{classname}}} +void main() { + {{^isEnum}} + // final instance = {{{classname}}}(); + {{/isEnum}} + + group('test {{{classname}}}', () { + {{#vars}} + {{#description}} + // {{{.}}} + {{/description}} + // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{{name}}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache new file mode 100644 index 000000000000..441b2c7bd1bb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache @@ -0,0 +1,16 @@ +{{#models}}{{#model}}# {{{pubName}}}.model.{{{classname}}} + +## Load the model package +```dart +import 'package:{{{pubName}}}/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache new file mode 100644 index 000000000000..d31ade250360 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache @@ -0,0 +1 @@ +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache new file mode 100644 index 000000000000..0b054d73d5c2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache @@ -0,0 +1,25 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: '{{{pubName}}}' +version: '{{{pubVersion}}}' +description: '{{{pubDescription}}}' +homepage: '{{{pubHomepage}}}' +{{#pubRepository}} +repository: {{.}} +{{/pubRepository}} +{{#pubPublishTo}} +publish_to: {{.}} +{{/pubPublishTo}} +environment: + sdk: '>=2.12.0 <3.0.0' +dependencies: + http: '>=0.13.0 <0.14.0' + intl: '^0.17.0' + meta: '^1.1.8' +dev_dependencies: + test: '>=1.16.0 <1.18.0' +{{#json_serializable}} + build_runner: '^1.10.9' + json_serializable: '^3.5.1'{{/json_serializable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache new file mode 100644 index 000000000000..a8a6273cf280 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache @@ -0,0 +1,301 @@ +class {{{classname}}} { +{{>dart_constructor}} +{{#vars}} + {{#description}} + /// {{{.}}} + {{/description}} + {{^isEnum}} + {{#minimum}} + {{#description}} + /// + {{/description}} + /// Minimum value: {{{.}}} + {{/minimum}} + {{#maximum}} + {{#description}} + {{^minimum}} + /// + {{/minimum}} + {{/description}} + /// Maximum value: {{{.}}} + {{/maximum}} + {{^isNullable}} + {{^required}} + {{^defaultValue}} + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + {{/defaultValue}} + {{/required}} + {{/isNullable}} + {{/isEnum}} + {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; + +{{/vars}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + {{#vars}} + ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + @override + String toString() => '{{{classname}}}[{{#vars}}{{{name}}}=${{{name}}}{{^-last}}, {{/-last}}{{/vars}}]'; + + Map toJson() { + final json = {}; + {{#vars}} + {{#isNullable}} + if (this.{{{name}}} != null) { + {{/isNullable}} + {{^isNullable}} + {{^required}} + {{^defaultValue}} + if (this.{{{name}}} != null) { + {{/defaultValue}} + {{/required}} + {{/isNullable}} + {{#isDateTime}} + {{#pattern}} + json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' + ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch + : this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); + {{/pattern}} + {{^pattern}} + json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); + {{/pattern}} + {{/isDateTime}} + {{#isDate}} + {{#pattern}} + json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' + ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch + : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); + {{/pattern}} + {{^pattern}} + json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); + {{/pattern}} + {{/isDate}} + {{^isDateTime}} + {{^isDate}} + json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!{{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; + {{/isDate}} + {{/isDateTime}} + {{#isNullable}} + } else { + json[r'{{{baseName}}}'] = null; + } + {{/isNullable}} + {{^isNullable}} + {{^required}} + {{^defaultValue}} + } else { + json[r'{{{baseName}}}'] = null; + } + {{/defaultValue}} + {{/required}} + {{/isNullable}} + {{/vars}} + return json; + } + + /// Returns a new [{{{classname}}}] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static {{{classname}}}? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "{{{classname}}}[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "{{{classname}}}[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return {{{classname}}}( + {{#vars}} + {{#isDateTime}} + {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isDateTime}} + {{#isDate}} + {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isDate}} + {{^isDateTime}} + {{^isDate}} + {{#complexType}} + {{#isArray}} + {{#items.isArray}} + {{{name}}}: json[r'{{{baseName}}}'] is List + ? (json[r'{{{baseName}}}'] as List).map((e) => + {{#items.complexType}} + {{items.complexType}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}} + {{/items.complexType}} + {{^items.complexType}} + e == null ? {{#items.isNullable}}null{{/items.isNullable}}{{^items.isNullable}}const <{{items.items.dataType}}>[]{{/items.isNullable}} : (e as List).cast<{{items.items.dataType}}>() + {{/items.complexType}} + ).toList() + : {{#isNullable}}null{{/isNullable}}{{^isNullable}}const []{{/isNullable}}, + {{/items.isArray}} + {{^items.isArray}} + {{{name}}}: {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}}, + {{/items.isArray}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isArray}} + {{{name}}}: json[r'{{{baseName}}}'] == null + ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} + {{#items.complexType}} + : {{items.complexType}}.mapListFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + : mapCastOfType(json, r'{{{baseName}}}'), + {{/items.complexType}} + {{/items.isArray}} + {{^items.isArray}} + {{#items.isMap}} + {{#items.complexType}} + {{{name}}}: {{items.complexType}}.mapFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/items.complexType}} + {{/items.isMap}} + {{^items.isMap}} + {{#items.complexType}} + {{{name}}}: {{{items.complexType}}}.mapFromJson(json[r'{{{baseName}}}']), + {{/items.complexType}} + {{^items.complexType}} + {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/items.complexType}} + {{/items.isMap}} + {{/items.isArray}} + {{/isMap}} + {{^isMap}} + {{#isBinary}} + {{{name}}}: null, // No support for decoding binary content from JSON + {{/isBinary}} + {{^isBinary}} + {{{name}}}: {{{complexType}}}.fromJson(json[r'{{{baseName}}}']){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isBinary}} + {{/isMap}} + {{/isArray}} + {{/complexType}} + {{^complexType}} + {{#isArray}} + {{#isEnum}} + {{{name}}}: {{{items.datatypeWithEnum}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}}, + {{/isEnum}} + {{^isEnum}} + {{{name}}}: json[r'{{{baseName}}}'] is Iterable + ? (json[r'{{{baseName}}}'] as Iterable).cast<{{{items.datatype}}}>().{{#uniqueItems}}toSet(){{/uniqueItems}}{{^uniqueItems}}toList(growable: false){{/uniqueItems}} + : {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}, + {{/isEnum}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isMap}} + {{^isMap}} + {{#isNumber}} + {{{name}}}: json[r'{{{baseName}}}'] == null + ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} + : {{{datatypeWithEnum}}}.parse(json[r'{{{baseName}}}'].toString()), + {{/isNumber}} + {{^isNumber}} + {{^isEnum}} + {{{name}}}: mapValueOfType<{{{datatypeWithEnum}}}>(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isEnum}} + {{#isEnum}} + {{{name}}}: {{{enumName}}}.fromJson(json[r'{{{baseName}}}']){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{/isEnum}} + {{/isNumber}} + {{/isMap}} + {{/isArray}} + {{/complexType}} + {{/isDate}} + {{/isDateTime}} + {{/vars}} + ); + } + return null; + } + + static List<{{{classname}}}> listFromJson(dynamic json, {bool growable = false,}) { + final result = <{{{classname}}}>[]; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = {{{classname}}}.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = {{{classname}}}.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of {{{classname}}}-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = {{{classname}}}.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { +{{#vars}} + {{#required}} + '{{{baseName}}}', + {{/required}} +{{/vars}} + }; +} +{{#vars}} + {{^isModel}} + {{#isEnum}} + {{^isContainer}} + +{{>serialization/native/native_enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/native/native_enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{/isModel}} +{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache new file mode 100644 index 000000000000..84217b702b9e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache @@ -0,0 +1,81 @@ +{{#description}}/// {{{.}}}{{/description}} +class {{{classname}}} { + /// Instantiate a new enum with the provided [value]. + const {{{classname}}}._(this.value); + + /// The underlying value of this enum member. + final {{{dataType}}} value; + + @override + String toString() => {{#isString}}value{{/isString}}{{^isString}}value.toString(){{/isString}}; + + {{{dataType}}} toJson() => value; + + {{#allowableValues}} + {{#enumVars}} + static const {{{name}}} = {{{classname}}}._({{#isString}}r{{/isString}}{{{value}}}); + {{/enumVars}} + {{/allowableValues}} + + /// List of all possible values in this [enum][{{{classname}}}]. + static const values = <{{{classname}}}>[ + {{#allowableValues}} + {{#enumVars}} + {{{name}}}, + {{/enumVars}} + {{/allowableValues}} + ]; + + static {{{classname}}}? fromJson(dynamic value) => {{{classname}}}TypeTransformer().decode(value); + + static List<{{{classname}}}> listFromJson(dynamic json, {bool growable = false,}) { + final result = <{{{classname}}}>[]; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = {{{classname}}}.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [{{{classname}}}] to {{{dataType}}}, +/// and [decode] dynamic data back to [{{{classname}}}]. +class {{{classname}}}TypeTransformer { + factory {{{classname}}}TypeTransformer() => _instance ??= const {{{classname}}}TypeTransformer._(); + + const {{{classname}}}TypeTransformer._(); + + {{{dataType}}} encode({{{classname}}} data) => data.value; + + /// Decodes a [dynamic value][data] to a {{{classname}}}. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + {{{classname}}}? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{#isString}}r{{/isString}}{{{value}}}: return {{{classname}}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [{{{classname}}}TypeTransformer] instance. + static {{{classname}}}TypeTransformer? _instance; +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache new file mode 100644 index 000000000000..1fe4428dcb31 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache @@ -0,0 +1,81 @@ +{{#description}}/// {{{.}}}{{/description}} +class {{{enumName}}} { + /// Instantiate a new enum with the provided [value]. + const {{{enumName}}}._(this.value); + + /// The underlying value of this enum member. + final {{{dataType}}} value; + + @override + String toString() => {{#isString}}value{{/isString}}{{^isString}}value.toString(){{/isString}}; + + {{{dataType}}} toJson() => value; + + {{#allowableValues}} + {{#enumVars}} + static const {{{name}}} = {{{enumName}}}._({{#isString}}r{{/isString}}{{{value}}}); + {{/enumVars}} + {{/allowableValues}} + + /// List of all possible values in this [enum][{{{enumName}}}]. + static const values = <{{{enumName}}}>[ + {{#allowableValues}} + {{#enumVars}} + {{{name}}}, + {{/enumVars}} + {{/allowableValues}} + ]; + + static {{{enumName}}}? fromJson(dynamic value) => {{{enumName}}}TypeTransformer().decode(value); + + static List<{{{enumName}}}> listFromJson(dynamic json, {bool growable = false,}) { + final result = <{{{enumName}}}>[]; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = {{{enumName}}}.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [{{{enumName}}}] to {{{dataType}}}, +/// and [decode] dynamic data back to [{{{enumName}}}]. +class {{{enumName}}}TypeTransformer { + factory {{{enumName}}}TypeTransformer() => _instance ??= const {{{enumName}}}TypeTransformer._(); + + const {{{enumName}}}TypeTransformer._(); + + {{{dataType}}} encode({{{enumName}}} data) => data.value; + + /// Decodes a [dynamic value][data] to a {{{enumName}}}. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + {{{enumName}}}? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{#isString}}r{{/isString}}{{{value}}}: return {{{enumName}}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [{{{enumName}}}TypeTransformer] instance. + static {{{enumName}}}TypeTransformer? _instance; +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache new file mode 100644 index 000000000000..2774ccbba0e9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache @@ -0,0 +1,14 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.12" +install: +- pub get + +script: +- pub run test diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache rename to modules/openapi-generator/src/main/resources/dart/model.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/model_test.mustache similarity index 87% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache rename to modules/openapi-generator/src/main/resources/dart/model_test.mustache index 26f614c657f2..2c188ea7dc50 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/model_test.mustache @@ -7,7 +7,7 @@ import 'package:{{pubName}}/{{pubName}}.dart'; void main() { {{^isEnum}} {{! Due to required vars without default value we can not create a full instance here }} -{{#includeLibraryTemplate}}test_instance{{/includeLibraryTemplate}} +{{#includeSerializationTemplate}}test_instance{{/includeSerializationTemplate}} {{/isEnum}} group({{{classname}}}, () { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/object_doc.mustache similarity index 93% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache rename to modules/openapi-generator/src/main/resources/dart/object_doc.mustache index 9abc25d51235..6dae3f1d7779 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/object_doc.mustache @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:{{pubName}}/api.dart'; +import 'package:{{pubName}}/{{pubName}}.dart'; ``` ## Properties diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache similarity index 96% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache rename to modules/openapi-generator/src/main/resources/dart/pubspec.mustache index 90608229c68b..81bafb341a83 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache @@ -21,7 +21,7 @@ dependencies: built_collection: '>=5.1.1 <6.0.0' {{/useBuiltValue}} {{#useJsonSerializable}} - json_annotation: '^4.4.0' + json_annotation: ^4.8.1 {{/useJsonSerializable}} {{#useDateLibTimeMachine}} time_machine: ^0.9.16 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_concrete.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_concrete.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_discriminator.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_discriminator.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_header.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_members.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_members.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/date.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/date.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/date_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/date_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/deserialize_properties.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/deserialize_properties.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum_inline.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum_inline.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/offset_date_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/offset_date_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_construction.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_construction.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_construction.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache similarity index 68% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache index 1a1de24ad4c6..75a8d82b735a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache @@ -9,34 +9,53 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'serializers.dart'; +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } else { + return FullType( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } +} + class BuiltValueJsonRepository extends SerializationRepositoryBase { final Serializers serializers; const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { + } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } + + } /* diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/serializers.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/serializers.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/build.yaml.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/build.yaml.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/class.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/class.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/dart_constructor.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/dart_constructor.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum_inline.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum_inline.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache new file mode 100644 index 000000000000..f4c0803bc604 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache @@ -0,0 +1 @@ +JsonSerializableRepository() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache new file mode 100644 index 000000000000..a243ac68c048 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache @@ -0,0 +1,94 @@ +import 'dart:convert'; +import 'dart:typed_data'; +import 'repository_base.dart'; +import 'package:{{pubName}}/models.dart'; + +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return jsonEncode(src); + } + + /* ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { }*/ + @override + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + //Dio automatically calls jsonDecode if the value is a string + if (value is String) { + value = jsonDecode(value); + } + switch (targetTypeInfo.root) { + case String: + return valueString as T; + case int: + return (value is num ? value.toInt() : int.parse(value.toString())) as T; + case bool: + if (value is bool) { + return value as T; + } + final valueString = value.toString().toLowerCase(); + return (valueString == 'true' || valueString == '1') as T; + case double: + return (value is num ? value.toDouble() : double.parse(value.toString())) as T; + //TODO: add support for DateTime? + {{#models}} + {{#model}} + case {{{classname}}}: + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value as Map) as T; + {{/isEnum}} + {{/model}} + {{/models}} + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) + .toList(growable: growable) as T; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) + .toSet() as T; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), + ) as T; + } + break; + } + throw Exception('Cannot deserialize'); + } + + @override + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context}) { + return src; + } + + @override + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, { + Object? context, + }) { + return src; + } + + @override + String encodeStringParameter(T src, TypeInfo inputTypeInfo, { + Object? context, + }) { + return src.toString(); + } + + +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache similarity index 63% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache rename to modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/repository_base.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/types/recursion_base_type_info.mustache rename to modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache From 041ec5a49c9a8f477f41ab59dea519157f7eeb03 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 13 May 2023 14:31:25 +0200 Subject: [PATCH 04/31] fix typo --- .../openapitools/codegen/languages/DartDioClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index c946c37573a7..2d107bbf7d46 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -120,7 +120,7 @@ public DartDioClientCodegen() { supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); final CliOption serializationLibraryOptions = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); - serializationLibraryOptions.setEnum(supportedLibraries); + serializationLibraryOptions.setEnum(supportedSerializationLibraries); serializationLibraryOptions.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibraryOptions); From 9ca6a7e989fcf7ed3f5ec35dd52654427f72461d Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 13 May 2023 14:41:14 +0200 Subject: [PATCH 05/31] gen samples --- .../dart-dio/oneof/.openapi-generator/FILES | 3 +- .../petstore/dart-dio/oneof/doc/Apple.md | 2 +- .../petstore/dart-dio/oneof/doc/Banana.md | 2 +- .../petstore/dart-dio/oneof/doc/DefaultApi.md | 4 +- .../petstore/dart-dio/oneof/doc/Fruit.md | 2 +- .../petstore/dart-dio/oneof/lib/apis.dart | 2 + .../petstore/dart-dio/oneof/lib/openapi.dart | 2 +- .../dart-dio/oneof/lib/src/api_client.dart | 2 +- .../oneof/lib/src/repository_base.dart | 29 +- .../oneof/lib/src/repository_impl.dart | 41 ++- .../.openapi-generator/FILES | 3 +- .../doc/Addressable.md | 2 +- .../doc/Bar.md | 2 +- .../doc/BarApi.md | 4 +- .../doc/BarCreate.md | 2 +- .../doc/BarRef.md | 2 +- .../doc/BarRefOrValue.md | 2 +- .../doc/Entity.md | 2 +- .../doc/EntityRef.md | 2 +- .../doc/Extensible.md | 2 +- .../doc/Foo.md | 2 +- .../doc/FooApi.md | 6 +- .../doc/FooRef.md | 2 +- .../doc/FooRefOrValue.md | 2 +- .../doc/Pasta.md | 2 +- .../doc/Pizza.md | 2 +- .../doc/PizzaSpeziale.md | 2 +- .../lib/apis.dart | 3 + .../lib/openapi.dart | 2 +- .../lib/src/api_client.dart | 2 +- .../lib/src/repository_base.dart | 29 +- .../lib/src/repository_impl.dart | 41 ++- .../oneof_primitive/.openapi-generator/FILES | 3 +- .../dart-dio/oneof_primitive/doc/Child.md | 2 +- .../oneof_primitive/doc/DefaultApi.md | 4 +- .../dart-dio/oneof_primitive/doc/Example.md | 2 +- .../dart-dio/oneof_primitive/lib/apis.dart | 2 + .../dart-dio/oneof_primitive/lib/openapi.dart | 2 +- .../oneof_primitive/lib/src/api_client.dart | 2 +- .../lib/src/repository_base.dart | 29 +- .../lib/src/repository_impl.dart | 41 ++- .../.openapi-generator/FILES | 3 +- .../doc/AdditionalPropertiesClass.md | 2 +- .../doc/AllOfWithSingleRef.md | 2 +- .../doc/Animal.md | 2 +- .../doc/AnotherFakeApi.md | 4 +- .../doc/ApiResponse.md | 2 +- .../doc/ArrayOfArrayOfNumberOnly.md | 2 +- .../doc/ArrayOfNumberOnly.md | 2 +- .../doc/ArrayTest.md | 2 +- .../doc/Capitalization.md | 2 +- .../doc/Cat.md | 2 +- .../doc/CatAllOf.md | 2 +- .../doc/Category.md | 2 +- .../doc/ClassModel.md | 2 +- .../doc/DefaultApi.md | 4 +- .../doc/DeprecatedObject.md | 2 +- .../doc/Dog.md | 2 +- .../doc/DogAllOf.md | 2 +- .../doc/EnumArrays.md | 2 +- .../doc/EnumTest.md | 2 +- .../doc/FakeApi.md | 36 +-- .../doc/FakeClassnameTags123Api.md | 4 +- .../doc/FileSchemaTestClass.md | 2 +- .../doc/Foo.md | 2 +- .../doc/FooGetDefaultResponse.md | 2 +- .../doc/FormatTest.md | 2 +- .../doc/HasOnlyReadOnly.md | 2 +- .../doc/HealthCheckResult.md | 2 +- .../doc/MapTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../doc/Model200Response.md | 2 +- .../doc/ModelClient.md | 2 +- .../doc/ModelEnumClass.md | 2 +- .../doc/ModelFile.md | 2 +- .../doc/ModelList.md | 2 +- .../doc/ModelReturn.md | 2 +- .../doc/Name.md | 2 +- .../doc/NullableClass.md | 2 +- .../doc/NumberOnly.md | 2 +- .../doc/ObjectWithDeprecatedFields.md | 2 +- .../doc/Order.md | 2 +- .../doc/OuterComposite.md | 2 +- .../doc/OuterEnum.md | 2 +- .../doc/OuterEnumDefaultValue.md | 2 +- .../doc/OuterEnumInteger.md | 2 +- .../doc/OuterEnumIntegerDefaultValue.md | 2 +- .../doc/OuterObjectWithEnumProperty.md | 2 +- .../doc/Pet.md | 2 +- .../doc/PetApi.md | 20 +- .../doc/ReadOnlyFirst.md | 2 +- .../doc/SingleRefType.md | 2 +- .../doc/SpecialModelName.md | 2 +- .../doc/StoreApi.md | 10 +- .../doc/Tag.md | 2 +- .../doc/User.md | 2 +- .../doc/UserApi.md | 18 +- .../lib/{api.dart => apis.dart} | 0 .../lib/openapi.dart | 2 +- .../lib/src/api_client.dart | 4 +- .../lib/src/deserialize.dart | 295 +++++++++--------- .../lib/src/json_repository_base.dart | 95 +++--- .../lib/src/repository_base.dart | 29 +- .../lib/src/repository_impl.dart | 179 ++++++++++- .../pubspec.yaml | 2 +- .../additional_properties_class_test.dart | 4 +- .../test/all_of_with_single_ref_test.dart | 1 - .../test/animal_test.dart | 1 - .../test/another_fake_api_test.dart | 2 - .../test/api_response_test.dart | 1 - .../array_of_array_of_number_only_test.dart | 4 +- .../test/array_of_number_only_test.dart | 1 - .../test/array_test_test.dart | 1 - .../test/capitalization_test.dart | 3 +- .../test/cat_all_of_test.dart | 1 - .../test/cat_test.dart | 1 - .../test/category_test.dart | 1 - .../test/class_model_test.dart | 1 - .../test/default_api_test.dart | 2 - .../test/deprecated_object_test.dart | 1 - .../test/dog_all_of_test.dart | 1 - .../test/dog_test.dart | 1 - .../test/enum_arrays_test.dart | 1 - .../test/enum_test_test.dart | 1 - .../test/fake_api_test.dart | 10 +- .../test/fake_classname_tags123_api_test.dart | 2 - .../test/file_schema_test_class_test.dart | 1 - .../test/foo_get_default_response_test.dart | 1 - .../test/foo_test.dart | 1 - .../test/format_test_test.dart | 1 - .../test/has_only_read_only_test.dart | 1 - .../test/health_check_result_test.dart | 1 - .../test/map_test_test.dart | 1 - ..._and_additional_properties_class_test.dart | 4 +- .../test/model200_response_test.dart | 1 - .../test/model_client_test.dart | 1 - .../test/model_enum_class_test.dart | 4 +- .../test/model_file_test.dart | 1 - .../test/model_list_test.dart | 1 - .../test/model_return_test.dart | 1 - .../test/name_test.dart | 1 - .../test/nullable_class_test.dart | 1 - .../test/number_only_test.dart | 1 - .../object_with_deprecated_fields_test.dart | 4 +- .../test/order_test.dart | 1 - .../test/outer_composite_test.dart | 1 - .../test/outer_enum_default_value_test.dart | 4 +- ...outer_enum_integer_default_value_test.dart | 4 +- .../test/outer_enum_integer_test.dart | 4 +- .../test/outer_enum_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 4 +- .../test/pet_api_test.dart | 14 +- .../test/pet_test.dart | 1 - .../test/read_only_first_test.dart | 1 - .../test/single_ref_type_test.dart | 4 +- .../test/special_model_name_test.dart | 5 +- .../test/store_api_test.dart | 4 +- .../test/tag_test.dart | 1 - .../test/user_api_test.dart | 12 +- .../test/user_test.dart | 1 - .../.openapi-generator/FILES | 3 +- .../doc/AdditionalPropertiesClass.md | 2 +- .../doc/AllOfWithSingleRef.md | 2 +- .../petstore_client_lib_fake/doc/Animal.md | 2 +- .../doc/AnotherFakeApi.md | 4 +- .../doc/ApiResponse.md | 2 +- .../doc/ArrayOfArrayOfNumberOnly.md | 2 +- .../doc/ArrayOfNumberOnly.md | 2 +- .../petstore_client_lib_fake/doc/ArrayTest.md | 2 +- .../doc/Capitalization.md | 2 +- .../petstore_client_lib_fake/doc/Cat.md | 2 +- .../petstore_client_lib_fake/doc/CatAllOf.md | 2 +- .../petstore_client_lib_fake/doc/Category.md | 2 +- .../doc/ClassModel.md | 2 +- .../doc/DefaultApi.md | 4 +- .../doc/DeprecatedObject.md | 2 +- .../petstore_client_lib_fake/doc/Dog.md | 2 +- .../petstore_client_lib_fake/doc/DogAllOf.md | 2 +- .../doc/EnumArrays.md | 2 +- .../petstore_client_lib_fake/doc/EnumTest.md | 2 +- .../petstore_client_lib_fake/doc/FakeApi.md | 36 +-- .../doc/FakeClassnameTags123Api.md | 4 +- .../doc/FileSchemaTestClass.md | 2 +- .../petstore_client_lib_fake/doc/Foo.md | 2 +- .../doc/FooGetDefaultResponse.md | 2 +- .../doc/FormatTest.md | 2 +- .../doc/HasOnlyReadOnly.md | 2 +- .../doc/HealthCheckResult.md | 2 +- .../petstore_client_lib_fake/doc/MapTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../doc/Model200Response.md | 2 +- .../doc/ModelClient.md | 2 +- .../doc/ModelEnumClass.md | 2 +- .../petstore_client_lib_fake/doc/ModelFile.md | 2 +- .../petstore_client_lib_fake/doc/ModelList.md | 2 +- .../doc/ModelReturn.md | 2 +- .../petstore_client_lib_fake/doc/Name.md | 2 +- .../doc/NullableClass.md | 2 +- .../doc/NumberOnly.md | 2 +- .../doc/ObjectWithDeprecatedFields.md | 2 +- .../petstore_client_lib_fake/doc/Order.md | 2 +- .../doc/OuterComposite.md | 2 +- .../petstore_client_lib_fake/doc/OuterEnum.md | 2 +- .../doc/OuterEnumDefaultValue.md | 2 +- .../doc/OuterEnumInteger.md | 2 +- .../doc/OuterEnumIntegerDefaultValue.md | 2 +- .../doc/OuterObjectWithEnumProperty.md | 2 +- .../petstore_client_lib_fake/doc/Pet.md | 2 +- .../petstore_client_lib_fake/doc/PetApi.md | 20 +- .../doc/ReadOnlyFirst.md | 2 +- .../doc/SingleRefType.md | 2 +- .../doc/SpecialModelName.md | 2 +- .../petstore_client_lib_fake/doc/StoreApi.md | 10 +- .../petstore_client_lib_fake/doc/Tag.md | 2 +- .../petstore_client_lib_fake/doc/User.md | 2 +- .../petstore_client_lib_fake/doc/UserApi.md | 18 +- .../lib/{api.dart => apis.dart} | 0 .../petstore_client_lib_fake/lib/openapi.dart | 2 +- .../lib/src/api/fake_api.dart | 1 - .../lib/src/api/pet_api.dart | 1 - .../lib/src/api/user_api.dart | 1 - .../lib/src/api_client.dart | 2 +- .../lib/src/api_util.dart | 3 +- .../lib/src/json_repository_base.dart | 95 +++--- .../lib/src/repository_base.dart | 29 +- .../lib/src/repository_impl.dart | 41 ++- .../additional_properties_class_test.dart | 1 - .../test/all_of_with_single_ref_test.dart | 1 - .../test/animal_test.dart | 1 - .../test/another_fake_api_test.dart | 2 - .../test/api_response_test.dart | 1 - .../array_of_array_of_number_only_test.dart | 1 - .../test/array_of_number_only_test.dart | 1 - .../test/array_test_test.dart | 1 - .../test/capitalization_test.dart | 3 +- .../test/cat_all_of_test.dart | 1 - .../test/cat_test.dart | 1 - .../test/category_test.dart | 1 - .../test/class_model_test.dart | 1 - .../test/default_api_test.dart | 2 - .../test/deprecated_object_test.dart | 1 - .../test/dog_all_of_test.dart | 1 - .../test/dog_test.dart | 1 - .../test/enum_arrays_test.dart | 1 - .../test/enum_test_test.dart | 1 - .../test/fake_api_test.dart | 10 +- .../test/fake_classname_tags123_api_test.dart | 2 - .../test/file_schema_test_class_test.dart | 1 - .../test/foo_get_default_response_test.dart | 1 - .../test/foo_test.dart | 1 - .../test/format_test_test.dart | 1 - .../test/has_only_read_only_test.dart | 1 - .../test/health_check_result_test.dart | 1 - .../test/map_test_test.dart | 1 - ..._and_additional_properties_class_test.dart | 1 - .../test/model200_response_test.dart | 1 - .../test/model_client_test.dart | 1 - .../test/model_enum_class_test.dart | 4 +- .../test/model_file_test.dart | 1 - .../test/model_list_test.dart | 1 - .../test/model_return_test.dart | 1 - .../test/name_test.dart | 1 - .../test/nullable_class_test.dart | 1 - .../test/number_only_test.dart | 1 - .../object_with_deprecated_fields_test.dart | 1 - .../test/order_test.dart | 1 - .../test/outer_composite_test.dart | 1 - .../test/outer_enum_default_value_test.dart | 4 +- ...outer_enum_integer_default_value_test.dart | 4 +- .../test/outer_enum_integer_test.dart | 4 +- .../test/outer_enum_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 1 - .../test/pet_api_test.dart | 14 +- .../test/pet_test.dart | 1 - .../test/read_only_first_test.dart | 1 - .../test/single_ref_type_test.dart | 4 +- .../test/special_model_name_test.dart | 5 +- .../test/store_api_test.dart | 4 +- .../test/tag_test.dart | 1 - .../test/user_api_test.dart | 12 +- .../test/user_test.dart | 1 - 281 files changed, 937 insertions(+), 779 deletions(-) create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart rename samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/{api.dart => apis.dart} (100%) rename samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/{api.dart => apis.dart} (100%) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES index 2c6234ac808d..ac3648acb3f6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES @@ -5,12 +5,11 @@ doc/Apple.md doc/Banana.md doc/DefaultApi.md doc/Fruit.md -lib/api.dart +lib/apis.dart lib/models.dart lib/openapi.dart lib/src/api/default_api.dart lib/src/api_client.dart -lib/src/api_util.dart lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md index c7f711b87cef..14d4a3415182 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md index bef8a58a4276..cdae69466a61 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md index 41c9b6f94116..217c29a3f567 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://localhost* @@ -19,7 +19,7 @@ Method | HTTP request | Description ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getDefaultApi(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md index 5d48cc6e6d38..fd6be273d730 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart new file mode 100644 index 000000000000..61386591c491 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart @@ -0,0 +1,2 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart index 9ae4491269b0..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart @@ -3,6 +3,6 @@ // -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart index 18137ee952fd..0c261cedc362 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart @@ -5,7 +5,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:openapi/api.dart'; +import 'package:openapi/apis.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart index 1f5aa928cbf2..4ad5bcf06143 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart @@ -12,34 +12,53 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'serializers.dart'; +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } else { + return FullType( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } +} + class BuiltValueJsonRepository extends SerializationRepositoryBase { final Serializers serializers; const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { + } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } + + } /* diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES index cee6d6740395..bae526994583 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES @@ -17,13 +17,12 @@ doc/FooRefOrValue.md doc/Pasta.md doc/Pizza.md doc/PizzaSpeziale.md -lib/api.dart +lib/apis.dart lib/models.dart lib/openapi.dart lib/src/api/bar_api.dart lib/src/api/foo_api.dart lib/src/api_client.dart -lib/src/api_util.dart lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md index 0fcd81b80382..d8b9beee9f52 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md index 4cccc863a489..e0668151935d 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md index 3ef168ecf34b..03dffa412100 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://localhost:8080* @@ -19,7 +19,7 @@ Create a Bar ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getBarApi(); final BarCreate barCreate = ; // BarCreate | diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md index c0b4ba6edc9a..bb0dbfd55790 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md index 949695f4d36f..b9eab1af1a9b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md index 9dafa2d6b220..fea6617a3c12 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md index 5ba2144b44fe..ccf43340ed10 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md index 80eae55f4145..6fad4884910f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md index 7a781e578ea4..76e8c3340955 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md index 2627691fefe5..c03233a1b1df 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md index 9e8990ebb8b3..9d9f869e7ee0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://localhost:8080* @@ -20,7 +20,7 @@ Create a Foo ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFooApi(); final Foo foo = ; // Foo | The Foo to be created @@ -61,7 +61,7 @@ GET all Foos ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFooApi(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md index 68104b227292..d49ad9b8a84f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md index 35e9fd114e1d..e79adafd24e7 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md index 034ff420d323..027d4e96abe0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md index e4b040a6a79c..a9a0163a18e3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md index e1d8434c077d..483cc83e301b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart new file mode 100644 index 000000000000..f615498164ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart @@ -0,0 +1,3 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart index 9ae4491269b0..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -3,6 +3,6 @@ // -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart index c784655932da..6257a3ba3709 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart @@ -5,7 +5,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:openapi/api.dart'; +import 'package:openapi/apis.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart index 1f5aa928cbf2..4ad5bcf06143 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart @@ -12,34 +12,53 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'serializers.dart'; +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } else { + return FullType( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } +} + class BuiltValueJsonRepository extends SerializationRepositoryBase { final Serializers serializers; const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { + } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } + + } /* diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES index 6241a915a2a4..992ec85d9873 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES @@ -4,12 +4,11 @@ analysis_options.yaml doc/Child.md doc/DefaultApi.md doc/Example.md -lib/api.dart +lib/apis.dart lib/models.dart lib/openapi.dart lib/src/api/default_api.dart lib/src/api_client.dart -lib/src/api_util.dart lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md index bed0f2feec12..f35453bca5b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md index abbf5f07f499..eeceb6e0b5c7 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://api.example.xyz/v1* @@ -19,7 +19,7 @@ Method | HTTP request | Description ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getDefaultApi(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md index bf49bb137a60..3a81137a5a9b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart new file mode 100644 index 000000000000..61386591c491 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart @@ -0,0 +1,2 @@ +export 'package:openapi/src/api_client.dart'; +export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart index 9ae4491269b0..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart @@ -3,6 +3,6 @@ // -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart index d9eda84d492e..566dd6d9e1a6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart @@ -5,7 +5,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:openapi/api.dart'; +import 'package:openapi/apis.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart index 1f5aa928cbf2..4ad5bcf06143 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart @@ -12,34 +12,53 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'serializers.dart'; +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } else { + return FullType( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } +} + class BuiltValueJsonRepository extends SerializationRepositoryBase { final Serializers serializers; const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { + } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } + + } /* diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index dc477684d942..a022a4174113 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -57,7 +57,7 @@ doc/StoreApi.md doc/Tag.md doc/User.md doc/UserApi.md -lib/api.dart +lib/apis.dart lib/models.dart lib/openapi.dart lib/src/api/another_fake_api.dart @@ -74,7 +74,6 @@ lib/src/auth/auth.dart lib/src/auth/basic_auth.dart lib/src/auth/bearer_auth.dart lib/src/auth/oauth.dart -lib/src/deserialize.dart lib/src/model/additional_properties_class.dart lib/src/model/all_of_with_single_ref.dart lib/src/model/animal.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md index 863b8503db83..c6a28464b698 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md index 4c6f3ab2fe11..b8c8c51c80af 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md index 415b56e9bc2e..df78e9937613 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md index df89b0eb12a8..1f581af03fa4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -21,7 +21,7 @@ To test special tags and operation ID starting with number ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getAnotherFakeApi(); final ModelClient modelClient = ; // ModelClient | client model diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md index 7ad5da0f89e4..2928d50be81a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md index e5b9d669a436..6c6a76f32432 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md index fe8e071eb45c..26125cfaf8e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md index 8ae11de10022..a4e7ff2bc79f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md index 4a07b4eb820d..7e933ba524a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md index 6552eea4b435..b7998f19f95f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md index 36b2ae0e8ab3..777e4189e4c0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md index ae6bc52e89d8..5e51f5aa35bc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md index 13ae5d3a4708..3b5171103272 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md index 0bfa6194188f..6234ed44c660 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -19,7 +19,7 @@ Method | HTTP request | Description ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getDefaultApi(); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md index bf2ef67a26fc..76215e98669f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md index d36439b767bb..712ed082eb91 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md index 97a7c8fba492..bfd11951e402 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md index 1d4fd1363b59..a0652e36735a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md index 7c24fe2347b4..8dc105ee3146 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md index 3d408769d11e..e0a685c9088e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -35,7 +35,7 @@ Health check endpoint ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); @@ -72,7 +72,7 @@ test http signature authentication ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: http_signature_test //defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; @@ -121,7 +121,7 @@ Test serialization of outer boolean types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final bool body = true; // bool | Input boolean as post body @@ -164,7 +164,7 @@ Test serialization of object with outer number type ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body @@ -207,7 +207,7 @@ Test serialization of outer number types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final num body = 8.14; // num | Input number as post body @@ -250,7 +250,7 @@ Test serialization of outer string types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String body = body_example; // String | Input string as post body @@ -293,7 +293,7 @@ Test serialization of enum (int) properties with examples ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body @@ -336,7 +336,7 @@ For this test, the body has to be a binary file. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload @@ -378,7 +378,7 @@ For this test, the body for this request must reference a schema named `File`. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | @@ -418,7 +418,7 @@ No authorization required ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String query = query_example; // String | @@ -462,7 +462,7 @@ To test \"client\" model ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final ModelClient modelClient = ; // ModelClient | client model @@ -505,7 +505,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: http_basic_test //defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; @@ -576,7 +576,7 @@ To test enum parameters ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final List enumHeaderStringArray = ; // List | Header parameter enum test (string array) @@ -634,7 +634,7 @@ Fake endpoint to test group parameters (optional) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: bearer_test //defaultApiClient.getAuthentication('bearer_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('bearer_test').password = 'YOUR_PASSWORD'; @@ -689,7 +689,7 @@ test inline additionalProperties ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final Map requestBody = ; // Map | request body @@ -731,7 +731,7 @@ test json serialization of form data ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String param = param_example; // String | field1 @@ -775,7 +775,7 @@ To test the collection format in query parameters ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final List pipe = ; // List | diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md index 35e244fbf21e..b54cf5117a07 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -21,7 +21,7 @@ To test class name in snake case ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key_query //defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md index d14ac319d294..898858934ee7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md index 185b76e3f5b4..97240f9bce11 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md index 10d0133abd95..baf746b7dc5a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md index 83b60545eb61..675b59b8469c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md index 32cae937155d..c0884669d1a6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md index 4d6aeb75d965..30abe9693f7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md index 197fe780a25a..76419a86b17e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md index 66d0d39c42be..595e88faccf6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md index 5aa3fb97c32e..d3a4eed65282 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md index f7b922f4a398..491c2dffa0c3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md index ebaafb44c7f7..6346922b80fa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md index 4be260e93f6e..810d321ec7f0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md index 283aa1f6b711..95bbed7bd916 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md index bc02df7a3692..49e007d35af6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md index 25f49ea946b4..7f8db15a7c71 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md index 70ac1091d417..5e48a20ff988 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md index d8096a3db37a..12d634cfdbbd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md index dda2836d8d54..14d075a0647c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md index bde5ffe51a2c..d18d3d8408ad 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md index 04bab7eff5d1..fab14cb2d17d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md index af62ad87ab2e..77123453e019 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md index c1bf8b0dec44..715afba3433f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md index 8c80a9e5c85f..98e74cfbc21e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md index eb8b55d70249..14b955ed876f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md index eab2ae8f66b4..881373f258bb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md index 3cd230bfb213..12626cbb5983 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md index dbf7f15b3cd3..46f6e5aa8d50 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -29,7 +29,7 @@ Add a new pet to the store ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -73,7 +73,7 @@ Deletes a pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -119,7 +119,7 @@ Multiple status values can be provided with comma separated strings ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -164,7 +164,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -209,7 +209,7 @@ Returns a single pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key //defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -256,7 +256,7 @@ Update an existing pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -300,7 +300,7 @@ Updates a pet in the store with form data ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -348,7 +348,7 @@ uploads an image ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -397,7 +397,7 @@ uploads an image (required) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md index 8f612e8ba19f..e21d61aa3f20 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md index 0dc93840cd7f..cbcf9ead7e6c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md index 5fcfa98e0b36..8c22491d783c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md index 920e5a8d7b1d..ce0d725268d7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final String orderId = orderId_example; // String | ID of the order that needs to be deleted @@ -66,7 +66,7 @@ Returns a map of status codes to quantities ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key //defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final int orderId = 789; // int | ID of pet that needs to be fetched @@ -152,7 +152,7 @@ Place an order for a pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final Order order = ; // Order | order placed for purchasing the pet diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md index c219f987c19c..1c0ee4595a65 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md index fa87e64d8595..c51ef002c6b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md index c7fd450beb04..4e2cef128a84 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -28,7 +28,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final User user = ; // User | Created user object @@ -70,7 +70,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final List user = ; // List | List of user object @@ -112,7 +112,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final List user = ; // List | List of user object @@ -154,7 +154,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The name that needs to be deleted @@ -196,7 +196,7 @@ Get user by user name ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. @@ -239,7 +239,7 @@ Logs user into the system ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The user name for login @@ -284,7 +284,7 @@ Logs out current logged in user session ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); @@ -322,7 +322,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | name that need to be deleted diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/api.dart rename to samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 9ae4491269b0..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -3,6 +3,6 @@ // -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart index a972f3ddbadd..cb089e80ee1f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart @@ -5,7 +5,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:openapi/api.dart'; +import 'package:openapi/apis.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/auth/_exports.dart'; @@ -26,7 +26,7 @@ class Openapi { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? const JsonSerializableRepository() { + )), this.serializationRepository = serializationRepositoryOverride ?? JsonSerializableRepository() { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index 5460a3d223e1..d4a3f2ce1834 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -45,145 +45,158 @@ final _regList = RegExp(r'^List<(.*)>$'); final _regSet = RegExp(r'^Set<(.*)>$'); final _regMap = RegExp(r'^Map$'); - ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { - switch (targetType) { - case 'String': - return '$value' as ReturnType; - case 'int': - return (value is int ? value : int.parse('$value')) as ReturnType; - case 'bool': - if (value is bool) { - return value as ReturnType; - } - final valueString = '$value'.toLowerCase(); - return (valueString == 'true' || valueString == '1') as ReturnType; - case 'double': - return (value is double ? value : double.parse('$value')) as ReturnType; - case 'AdditionalPropertiesClass': - return AdditionalPropertiesClass.fromJson(value as Map) as ReturnType; - case 'AllOfWithSingleRef': - return AllOfWithSingleRef.fromJson(value as Map) as ReturnType; - case 'Animal': - return Animal.fromJson(value as Map) as ReturnType; - case 'ApiResponse': - return ApiResponse.fromJson(value as Map) as ReturnType; - case 'ArrayOfArrayOfNumberOnly': - return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as ReturnType; - case 'ArrayOfNumberOnly': - return ArrayOfNumberOnly.fromJson(value as Map) as ReturnType; - case 'ArrayTest': - return ArrayTest.fromJson(value as Map) as ReturnType; - case 'Capitalization': - return Capitalization.fromJson(value as Map) as ReturnType; - case 'Cat': - return Cat.fromJson(value as Map) as ReturnType; - case 'CatAllOf': - return CatAllOf.fromJson(value as Map) as ReturnType; - case 'Category': - return Category.fromJson(value as Map) as ReturnType; - case 'ClassModel': - return ClassModel.fromJson(value as Map) as ReturnType; - case 'DeprecatedObject': - return DeprecatedObject.fromJson(value as Map) as ReturnType; - case 'Dog': - return Dog.fromJson(value as Map) as ReturnType; - case 'DogAllOf': - return DogAllOf.fromJson(value as Map) as ReturnType; - case 'EnumArrays': - return EnumArrays.fromJson(value as Map) as ReturnType; - case 'EnumTest': - return EnumTest.fromJson(value as Map) as ReturnType; - case 'FileSchemaTestClass': - return FileSchemaTestClass.fromJson(value as Map) as ReturnType; - case 'Foo': - return Foo.fromJson(value as Map) as ReturnType; - case 'FooGetDefaultResponse': - return FooGetDefaultResponse.fromJson(value as Map) as ReturnType; - case 'FormatTest': - return FormatTest.fromJson(value as Map) as ReturnType; - case 'HasOnlyReadOnly': - return HasOnlyReadOnly.fromJson(value as Map) as ReturnType; - case 'HealthCheckResult': - return HealthCheckResult.fromJson(value as Map) as ReturnType; - case 'MapTest': - return MapTest.fromJson(value as Map) as ReturnType; - case 'MixedPropertiesAndAdditionalPropertiesClass': - return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as ReturnType; - case 'Model200Response': - return Model200Response.fromJson(value as Map) as ReturnType; - case 'ModelClient': - return ModelClient.fromJson(value as Map) as ReturnType; - case 'ModelEnumClass': - - - case 'ModelFile': - return ModelFile.fromJson(value as Map) as ReturnType; - case 'ModelList': - return ModelList.fromJson(value as Map) as ReturnType; - case 'ModelReturn': - return ModelReturn.fromJson(value as Map) as ReturnType; - case 'Name': - return Name.fromJson(value as Map) as ReturnType; - case 'NullableClass': - return NullableClass.fromJson(value as Map) as ReturnType; - case 'NumberOnly': - return NumberOnly.fromJson(value as Map) as ReturnType; - case 'ObjectWithDeprecatedFields': - return ObjectWithDeprecatedFields.fromJson(value as Map) as ReturnType; - case 'Order': - return Order.fromJson(value as Map) as ReturnType; - case 'OuterComposite': - return OuterComposite.fromJson(value as Map) as ReturnType; - case 'OuterEnum': - - - case 'OuterEnumDefaultValue': - - - case 'OuterEnumInteger': - - - case 'OuterEnumIntegerDefaultValue': - - - case 'OuterObjectWithEnumProperty': - return OuterObjectWithEnumProperty.fromJson(value as Map) as ReturnType; - case 'Pet': - return Pet.fromJson(value as Map) as ReturnType; - case 'ReadOnlyFirst': - return ReadOnlyFirst.fromJson(value as Map) as ReturnType; - case 'SingleRefType': - - - case 'SpecialModelName': - return SpecialModelName.fromJson(value as Map) as ReturnType; - case 'Tag': - return Tag.fromJson(value as Map) as ReturnType; - case 'User': - return User.fromJson(value as Map) as ReturnType; - default: - RegExpMatch? match; +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) + as ReturnType; + case 'AllOfWithSingleRef': + return AllOfWithSingleRef.fromJson(value as Map) + as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) + as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) + as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'CatAllOf': + return CatAllOf.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) + as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'DogAllOf': + return DogAllOf.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) + as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FooGetDefaultResponse': + return FooGetDefaultResponse.fromJson(value as Map) + as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) + as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) + as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson( + value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) + as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) + as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) + as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) + as ReturnType; + case 'OuterEnum': + case 'OuterEnumDefaultValue': + case 'OuterEnumInteger': + case 'OuterEnumIntegerDefaultValue': + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) + as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) + as ReturnType; + case 'SingleRefType': + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) + as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; - if (value is List && (match = _regList.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetType, growable: growable)) - .toList(growable: growable) as ReturnType; - } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetType, growable: growable)) - .toSet() as ReturnType; - } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - value.keys, - value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), - ) as ReturnType; - } - break; - } - throw Exception('Cannot deserialize'); - } \ No newline at end of file + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart index 6b618e77ca4e..fcfc669d1d66 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart @@ -1,52 +1,55 @@ class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) + : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => + (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } } abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart index fc0984150491..3f92a1523e19 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart @@ -1,29 +1,184 @@ +import 'dart:convert'; +import 'dart:typed_data'; import 'repository_base.dart'; -class JsonSerializableRepository extends SerializationRepositoryBase { - const JsonSerializableRepository(); +import 'package:openapi/models.dart'; +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return jsonEncode(src); } + /* ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { }*/ @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + //Dio automatically calls jsonDecode if the value is a string + if (value is String) { + value = jsonDecode(value); + } + switch (targetTypeInfo.root) { + case String: + return valueString as T; + case int: + return (value is num ? value.toInt() : int.parse(value.toString())) as T; + case bool: + if (value is bool) { + return value as T; + } + final valueString = value.toString().toLowerCase(); + return (valueString == 'true' || valueString == '1') as T; + case double: + return (value is num ? value.toDouble() : double.parse(value.toString())) as T; + //TODO: add support for DateTime? + case AdditionalPropertiesClass: + return AdditionalPropertiesClass.fromJson(value as Map) as T; + case AllOfWithSingleRef: + return AllOfWithSingleRef.fromJson(value as Map) as T; + case Animal: + return Animal.fromJson(value as Map) as T; + case ApiResponse: + return ApiResponse.fromJson(value as Map) as T; + case ArrayOfArrayOfNumberOnly: + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as T; + case ArrayOfNumberOnly: + return ArrayOfNumberOnly.fromJson(value as Map) as T; + case ArrayTest: + return ArrayTest.fromJson(value as Map) as T; + case Capitalization: + return Capitalization.fromJson(value as Map) as T; + case Cat: + return Cat.fromJson(value as Map) as T; + case CatAllOf: + return CatAllOf.fromJson(value as Map) as T; + case Category: + return Category.fromJson(value as Map) as T; + case ClassModel: + return ClassModel.fromJson(value as Map) as T; + case DeprecatedObject: + return DeprecatedObject.fromJson(value as Map) as T; + case Dog: + return Dog.fromJson(value as Map) as T; + case DogAllOf: + return DogAllOf.fromJson(value as Map) as T; + case EnumArrays: + return EnumArrays.fromJson(value as Map) as T; + case EnumTest: + return EnumTest.fromJson(value as Map) as T; + case FileSchemaTestClass: + return FileSchemaTestClass.fromJson(value as Map) as T; + case Foo: + return Foo.fromJson(value as Map) as T; + case FooGetDefaultResponse: + return FooGetDefaultResponse.fromJson(value as Map) as T; + case FormatTest: + return FormatTest.fromJson(value as Map) as T; + case HasOnlyReadOnly: + return HasOnlyReadOnly.fromJson(value as Map) as T; + case HealthCheckResult: + return HealthCheckResult.fromJson(value as Map) as T; + case MapTest: + return MapTest.fromJson(value as Map) as T; + case MixedPropertiesAndAdditionalPropertiesClass: + return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as T; + case Model200Response: + return Model200Response.fromJson(value as Map) as T; + case ModelClient: + return ModelClient.fromJson(value as Map) as T; + case ModelEnumClass: + + + case ModelFile: + return ModelFile.fromJson(value as Map) as T; + case ModelList: + return ModelList.fromJson(value as Map) as T; + case ModelReturn: + return ModelReturn.fromJson(value as Map) as T; + case Name: + return Name.fromJson(value as Map) as T; + case NullableClass: + return NullableClass.fromJson(value as Map) as T; + case NumberOnly: + return NumberOnly.fromJson(value as Map) as T; + case ObjectWithDeprecatedFields: + return ObjectWithDeprecatedFields.fromJson(value as Map) as T; + case Order: + return Order.fromJson(value as Map) as T; + case OuterComposite: + return OuterComposite.fromJson(value as Map) as T; + case OuterEnum: + + + case OuterEnumDefaultValue: + + + case OuterEnumInteger: + + + case OuterEnumIntegerDefaultValue: + + + case OuterObjectWithEnumProperty: + return OuterObjectWithEnumProperty.fromJson(value as Map) as T; + case Pet: + return Pet.fromJson(value as Map) as T; + case ReadOnlyFirst: + return ReadOnlyFirst.fromJson(value as Map) as T; + case SingleRefType: + + + case SpecialModelName: + return SpecialModelName.fromJson(value as Map) as T; + case Tag: + return Tag.fromJson(value as Map) as T; + case User: + return User.fromJson(value as Map) as T; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) + .toList(growable: growable) as T; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) + .toSet() as T; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), + ) as T; + } + break; + } + throw Exception('Cannot deserialize'); } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context}) { + return src; } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, { + Object? context, + }) { + return src; } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, { + Object? context, + }) { + return src.toString(); } + + } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml index b8c8318dedc8..1e7fd2bb7e0c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -8,7 +8,7 @@ environment: dependencies: dio: '^5.0.0' - json_annotation: '^4.4.0' + json_annotation: ^4.8.1 dev_dependencies: build_runner: any diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart index fd8299fb998f..28348e7fc36e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for AdditionalPropertiesClass void main() { - final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + final AdditionalPropertiesClass? + instance = /* AdditionalPropertiesClass(...) */ null; // TODO add properties to the entity group(AdditionalPropertiesClass, () { @@ -16,6 +17,5 @@ void main() { test('to test the property `mapOfMapProperty`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart index ad5da909f6e3..92cbebda26cf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `singleRefType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart index 83c65b22bfc3..d5464a4278b1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `color`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart index ddafef2a831b..b758bba36ae0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for AnotherFakeApi void main() { final instance = Openapi().getAnotherFakeApi(); @@ -15,6 +14,5 @@ void main() { test('test call123testSpecialTags', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart index 9487afd7f58c..3132ef4e8a51 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `message`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart index 79c0d3f3bba8..95eabc3a01aa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfArrayOfNumberOnly void main() { - final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ + null; // TODO add properties to the entity group(ArrayOfArrayOfNumberOnly, () { @@ -11,6 +12,5 @@ void main() { test('to test the property `arrayArrayNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart index d80be97cf147..b547bb1728d8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart index bfe7c84fd122..83b1fee56fb0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `arrayArrayOfModel`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart index 156b0ee4993c..6d1094e22d0d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart @@ -32,11 +32,10 @@ void main() { // TODO }); - // Name of the pet + // Name of the pet // String ATT_NAME test('to test the property `ATT_NAME`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart index c22efb324bea..c9df8b953a81 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart index 0a8811bd37f7..28e5faaeb1cd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart index 0ed6921ae7fc..1d1a07c6ed0a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart index e2dda7bab74e..a30d478c9566 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `class_`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart index f079565f9785..9147e96e4ea8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for DefaultApi void main() { final instance = Openapi().getDefaultApi(); @@ -11,6 +10,5 @@ void main() { test('test fooGet', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart index 1b2214668577..8668a44a0158 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart index f5e191fea696..ca5f74f20fbe 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart index 98097bd4bf25..611f2a3fdc6f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart index 30d12204ba17..5c12838ce848 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `arrayEnum`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart index befb9901ce9d..40083505d1c0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `outerEnumIntegerDefaultValue`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart index 06418dfa53c4..722fa7226b15 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for FakeApi void main() { final instance = Openapi().getFakeApi(); @@ -84,9 +83,9 @@ void main() { // TODO }); - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async test('test testEndpointParameters', () async { @@ -113,7 +112,7 @@ void main() { // test inline additionalProperties // - // + // // //Future testInlineAdditionalProperties(Map requestBody) async test('test testInlineAdditionalProperties', () async { @@ -122,7 +121,7 @@ void main() { // test json serialization of form data // - // + // // //Future testJsonFormData(String param, String param2) async test('test testJsonFormData', () async { @@ -135,6 +134,5 @@ void main() { test('test testQueryParameterCollectionFormat', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart index 3075147f52fd..979c752e1c26 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for FakeClassnameTags123Api void main() { final instance = Openapi().getFakeClassnameTags123Api(); @@ -15,6 +14,5 @@ void main() { test('test testClassname', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart index 2ccd0d450ce7..14d7c2120cd9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `files`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart index 4282326fe61f..b1b1a3028e21 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `string`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart index 28ae9a5b5e13..8e95e7503e41 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `bar`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart index b08838d81a37..93bb4ba3ca97 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart @@ -88,6 +88,5 @@ void main() { test('to test the property `patternWithDigitsAndDelimiter`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart index d72429a31bb5..5b33d9ca7457 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `foo`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart index b2b48337b76c..adc423fde5d8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `nullableMessage`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart index 909415df7540..e6efc4c58af7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `indirectMap`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart index 0115f01ed6be..4f4ed38bff17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for MixedPropertiesAndAdditionalPropertiesClass void main() { - final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + final MixedPropertiesAndAdditionalPropertiesClass? + instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; // TODO add properties to the entity group(MixedPropertiesAndAdditionalPropertiesClass, () { @@ -21,6 +22,5 @@ void main() { test('to test the property `map`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart index de8cf3037b6b..f6c115209ad3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `class_`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart index 44faf62f15b4..5ea0a93ab265 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `client`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart index 03e5855bf004..fa31f816801c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for ModelEnumClass void main() { - - group(ModelEnumClass, () { - }); + group(ModelEnumClass, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart index 8ea65f6ccb41..cfc5be5ba117 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart @@ -12,6 +12,5 @@ void main() { test('to test the property `sourceURI`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart index f748eee993ac..a4ff05980ee6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `n123list`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart index cfc17807c151..2f97f6cf6ed7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `return_`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart index 4f3f7f633728..036c3d07845c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `n123number`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart index 0ab76167983b..b5b320cae68b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart @@ -66,6 +66,5 @@ void main() { test('to test the property `objectItemsNullable`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart index 12b19c59dfb7..6764fbc7a8c5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `justNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart index e197bd0ad807..dabb6bc2701c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for ObjectWithDeprecatedFields void main() { - final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + final ObjectWithDeprecatedFields? + instance = /* ObjectWithDeprecatedFields(...) */ null; // TODO add properties to the entity group(ObjectWithDeprecatedFields, () { @@ -26,6 +27,5 @@ void main() { test('to test the property `bars`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart index 45b02097daed..8d5cbc6a9df5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `complete`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart index a5f0172ba21c..5d675fe37618 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `myBoolean`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart index 502c8326be58..a5c83f615194 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumDefaultValue void main() { - - group(OuterEnumDefaultValue, () { - }); + group(OuterEnumDefaultValue, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart index c535fe8ac354..49ebbfcead7f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumIntegerDefaultValue void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); + group(OuterEnumIntegerDefaultValue, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart index d945bc8c489d..3c6b81305c71 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumInteger void main() { - - group(OuterEnumInteger, () { - }); + group(OuterEnumInteger, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart index 8e11eb02fb8a..4ee10f379d5e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnum void main() { - - group(OuterEnum, () { - }); + group(OuterEnum, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart index 3d72c6188e17..c658fed371ec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart @@ -3,7 +3,8 @@ import 'package:openapi/openapi.dart'; // tests for OuterObjectWithEnumProperty void main() { - final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + final OuterObjectWithEnumProperty? + instance = /* OuterObjectWithEnumProperty(...) */ null; // TODO add properties to the entity group(OuterObjectWithEnumProperty, () { @@ -11,6 +12,5 @@ void main() { test('to test the property `value`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart index 85a28bcfbe53..149849529e17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for PetApi void main() { final instance = Openapi().getPetApi(); @@ -9,7 +8,7 @@ void main() { group(PetApi, () { // Add a new pet to the store // - // + // // //Future addPet(Pet pet) async test('test addPet', () async { @@ -18,7 +17,7 @@ void main() { // Deletes a pet // - // + // // //Future deletePet(int petId, { String apiKey }) async test('test deletePet', () async { @@ -54,7 +53,7 @@ void main() { // Update an existing pet // - // + // // //Future updatePet(Pet pet) async test('test updatePet', () async { @@ -63,7 +62,7 @@ void main() { // Updates a pet in the store with form data // - // + // // //Future updatePetWithForm(int petId, { String name, String status }) async test('test updatePetWithForm', () async { @@ -72,7 +71,7 @@ void main() { // uploads an image // - // + // // //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async test('test uploadFile', () async { @@ -81,12 +80,11 @@ void main() { // uploads an image (required) // - // + // // //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async test('test uploadFileWithRequiredFile', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart index 20b5e3e06735..4ff0a1207949 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `status`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart index bcefd75befb6..4f4d9d207593 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `baz`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart index 5cd85add393e..2c265f0d24ae 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for SingleRefType void main() { - - group(SingleRefType, () { - }); + group(SingleRefType, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart index 23b58324ef99..3a6043c9054b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart @@ -8,9 +8,10 @@ void main() { group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + test( + 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', + () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart index 08f7f738043b..97796b2576c4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for StoreApi void main() { final instance = Openapi().getStoreApi(); @@ -36,12 +35,11 @@ void main() { // Place an order for a pet // - // + // // //Future placeOrder(Order order) async test('test placeOrder', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart index ffe49b3179c3..df95f3461fd9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart index 4bf28b67623b..26839dcd85dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for UserApi void main() { final instance = Openapi().getUserApi(); @@ -18,7 +17,7 @@ void main() { // Creates list of users with given input array // - // + // // //Future createUsersWithArrayInput(List user) async test('test createUsersWithArrayInput', () async { @@ -27,7 +26,7 @@ void main() { // Creates list of users with given input array // - // + // // //Future createUsersWithListInput(List user) async test('test createUsersWithListInput', () async { @@ -45,7 +44,7 @@ void main() { // Get user by user name // - // + // // //Future getUserByName(String username) async test('test getUserByName', () async { @@ -54,7 +53,7 @@ void main() { // Logs user into the system // - // + // // //Future loginUser(String username, String password) async test('test loginUser', () async { @@ -63,7 +62,7 @@ void main() { // Logs out current logged in user session // - // + // // //Future logoutUser() async test('test logoutUser', () async { @@ -78,6 +77,5 @@ void main() { test('test updateUser', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart index 847b14196b93..fc1bb1cea555 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart @@ -47,6 +47,5 @@ void main() { test('to test the property `userStatus`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index 355872f55e01..70622c842298 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -56,7 +56,7 @@ doc/StoreApi.md doc/Tag.md doc/User.md doc/UserApi.md -lib/api.dart +lib/apis.dart lib/models.dart lib/openapi.dart lib/src/api/another_fake_api.dart @@ -67,7 +67,6 @@ lib/src/api/pet_api.dart lib/src/api/store_api.dart lib/src/api/user_api.dart lib/src/api_client.dart -lib/src/api_util.dart lib/src/auth/_exports.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart 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 f9f7857894d0..601ddeb51087 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md index 4c6f3ab2fe11..b8c8c51c80af 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md index 415b56e9bc2e..df78e9937613 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 df89b0eb12a8..1f581af03fa4 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -21,7 +21,7 @@ To test special tags and operation ID starting with number ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getAnotherFakeApi(); final ModelClient modelClient = ; // ModelClient | client model diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md index 7ad5da0f89e4..2928d50be81a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 d1a272ab6023..93a7169d0f72 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 94b60f272fd4..7e739e91fc33 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 0813d4fa93c6..1dd8a3a41ac8 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md index 4a07b4eb820d..7e933ba524a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md index 6552eea4b435..b7998f19f95f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md index 36b2ae0e8ab3..777e4189e4c0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md index ae6bc52e89d8..5e51f5aa35bc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md index 9b80d4f71eea..20a4715e3ca0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 0bfa6194188f..6234ed44c660 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -19,7 +19,7 @@ Method | HTTP request | Description ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getDefaultApi(); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md index bf2ef67a26fc..76215e98669f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md index d36439b767bb..712ed082eb91 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md index 97a7c8fba492..bfd11951e402 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 06170bb8f51d..7d18f70dbf85 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md index 7c24fe2347b4..8dc105ee3146 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 4b1e2a2d5b17..6787b8a9026b 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -35,7 +35,7 @@ Health check endpoint ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); @@ -72,7 +72,7 @@ test http signature authentication ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: http_signature_test //defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; @@ -121,7 +121,7 @@ Test serialization of outer boolean types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final bool body = true; // bool | Input boolean as post body @@ -164,7 +164,7 @@ Test serialization of object with outer number type ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body @@ -207,7 +207,7 @@ Test serialization of outer number types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final num body = 8.14; // num | Input number as post body @@ -250,7 +250,7 @@ Test serialization of outer string types ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String body = body_example; // String | Input string as post body @@ -293,7 +293,7 @@ Test serialization of enum (int) properties with examples ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body @@ -336,7 +336,7 @@ For this test, the body has to be a binary file. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload @@ -378,7 +378,7 @@ For this test, the body for this request must reference a schema named `File`. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | @@ -418,7 +418,7 @@ No authorization required ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String query = query_example; // String | @@ -462,7 +462,7 @@ To test \"client\" model ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final ModelClient modelClient = ; // ModelClient | client model @@ -505,7 +505,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: http_basic_test //defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; @@ -576,7 +576,7 @@ To test enum parameters ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final BuiltList enumHeaderStringArray = ; // BuiltList | Header parameter enum test (string array) @@ -634,7 +634,7 @@ Fake endpoint to test group parameters (optional) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure HTTP basic authorization: bearer_test //defaultApiClient.getAuthentication('bearer_test').username = 'YOUR_USERNAME' //defaultApiClient.getAuthentication('bearer_test').password = 'YOUR_PASSWORD'; @@ -689,7 +689,7 @@ test inline additionalProperties ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final BuiltMap requestBody = ; // BuiltMap | request body @@ -731,7 +731,7 @@ test json serialization of form data ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final String param = param_example; // String | field1 @@ -775,7 +775,7 @@ To test the collection format in query parameters ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final BuiltList pipe = ; // BuiltList | 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 35e244fbf21e..b54cf5117a07 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -21,7 +21,7 @@ To test class name in snake case ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key_query //defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed 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 105fece87f1d..83d57e45bce5 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md index 185b76e3f5b4..97240f9bce11 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md index 10d0133abd95..baf746b7dc5a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 f811264ca2ba..cb4c2f81d133 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md index 32cae937155d..c0884669d1a6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md index 4d6aeb75d965..30abe9693f7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 4ad87df64232..0f6c09f04b84 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 b1a4c4ccc401..30967b4a65c2 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md index e8b088ca1afa..f42d7b1dfe3c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md index f7b922f4a398..491c2dffa0c3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md index ebaafb44c7f7..6346922b80fa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md index 4be260e93f6e..810d321ec7f0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md index 283aa1f6b711..95bbed7bd916 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md index bc02df7a3692..49e007d35af6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md index 25f49ea946b4..7f8db15a7c71 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 4ce8d5e17576..9760a2d6c04d 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md index d8096a3db37a..12d634cfdbbd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md index 3e7848d382c2..45b46abcf65d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md index bde5ffe51a2c..d18d3d8408ad 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md index 04bab7eff5d1..fab14cb2d17d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md index af62ad87ab2e..77123453e019 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md index c1bf8b0dec44..715afba3433f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md index 8c80a9e5c85f..98e74cfbc21e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md index eb8b55d70249..14b955ed876f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md index eab2ae8f66b4..881373f258bb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 08e0aeedd784..0e84c434698b 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 @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 9ecef8bb7e14..4439dd57f352 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -29,7 +29,7 @@ Add a new pet to the store ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -73,7 +73,7 @@ Deletes a pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -119,7 +119,7 @@ Multiple status values can be provided with comma separated strings ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -164,7 +164,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -209,7 +209,7 @@ Returns a single pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key //defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -256,7 +256,7 @@ Update an existing pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -300,7 +300,7 @@ Updates a pet in the store with form data ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -348,7 +348,7 @@ uploads an image ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -397,7 +397,7 @@ uploads an image (required) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md index 8f612e8ba19f..e21d61aa3f20 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md index 0dc93840cd7f..cbcf9ead7e6c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md index 5fcfa98e0b36..8c22491d783c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 b46dc95a5ec1..af562bb66e0f 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final String orderId = orderId_example; // String | ID of the order that needs to be deleted @@ -66,7 +66,7 @@ Returns a map of status codes to quantities ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; // TODO Configure API key authorization: api_key //defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final int orderId = 789; // int | ID of pet that needs to be fetched @@ -152,7 +152,7 @@ Place an order for a pet ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getStoreApi(); final Order order = ; // Order | order placed for purchasing the pet diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md index c219f987c19c..1c0ee4595a65 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md index fa87e64d8595..c51ef002c6b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties 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 987932d8b821..3021cfa7c4dd 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 @@ -2,7 +2,7 @@ ## Load the API package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* @@ -28,7 +28,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final User user = ; // User | Created user object @@ -70,7 +70,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final BuiltList user = ; // BuiltList | List of user object @@ -112,7 +112,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final BuiltList user = ; // BuiltList | List of user object @@ -154,7 +154,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The name that needs to be deleted @@ -196,7 +196,7 @@ Get user by user name ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. @@ -239,7 +239,7 @@ Logs user into the system ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | The user name for login @@ -284,7 +284,7 @@ Logs out current logged in user session ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); @@ -322,7 +322,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getUserApi(); final String username = username_example; // String | name that need to be deleted 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/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api.dart rename to samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 9ae4491269b0..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -3,6 +3,6 @@ // -export 'api.dart'; +export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart index df58fb1a06d8..1a849fdc085c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -8,7 +8,6 @@ import 'package:openapi/src/repository_base.dart'; import 'package:openapi/models.dart'; import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; import 'package:openapi/src/model/date.dart'; import 'package:openapi/src/model/file_schema_test_class.dart'; import 'package:openapi/src/model/health_check_result.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart index d60391b2b60c..b040bbf92da2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart @@ -7,7 +7,6 @@ import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; import 'package:openapi/src/model/api_response.dart'; import 'package:openapi/src/model/pet.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart index 2d143a58b09b..1ce9390ee274 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart @@ -7,7 +7,6 @@ import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; import 'package:openapi/src/model/user.dart'; class UserApi { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart index 1c1bbff39188..e766e712faec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart @@ -5,7 +5,7 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'repository_impl.dart'; -import 'package:openapi/api.dart'; +import 'package:openapi/apis.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart index ed3bb12f25b8..7a2534bcfe7c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart @@ -12,7 +12,8 @@ import 'package:dio/dio.dart'; /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. /// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { +dynamic encodeFormParameter( + Serializers serializers, dynamic value, FullType type) { if (value == null) { return ''; } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart index 6b618e77ca4e..fcfc669d1d66 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart @@ -1,52 +1,55 @@ class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) + : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => + (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } } abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); + Object serialize(T src, TypeInfo parsedType, {Object? context}); + T deserialize(Object value, TypeInfo parsedType, {Object? context}); - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file + String encodeStringParameter(T src, TypeInfo parsedType, + {Object? context}); + Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); + Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart index 2a1cc1a0a4c0..0efdf678482a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart @@ -1,3 +1,21 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + + String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -41,14 +59,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart index 1f5aa928cbf2..4ad5bcf06143 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart @@ -12,34 +12,53 @@ import 'package:dio/dio.dart'; import 'repository_base.dart'; import 'serializers.dart'; +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } else { + return FullType( + info.root, info.parameters.map(typeInfoToFullType).toList(),); + } +} + class BuiltValueJsonRepository extends SerializationRepositoryBase { final Serializers serializers; const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo parsedType, {Object? context}) { - + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - - @override - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}) { + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } @override - Object encodeQueryParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { + } @override - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}) { + Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } @override - Object serialize(T src, TypeInfo parsedType, {Object? context}) { - + String encodeStringParameter(T src, TypeInfo inputTypeInfo, + {Object? context,}) { } + + } /* diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart index c231e6dc2807..0ee0559d710c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `mapOfMapProperty`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart index 64e241a4dce3..a423afab69b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `singleRefType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart index 39b8b59cdf51..023e09145fe3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `color`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart index ddafef2a831b..b758bba36ae0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for AnotherFakeApi void main() { final instance = Openapi().getAnotherFakeApi(); @@ -15,6 +14,5 @@ void main() { test('test call123testSpecialTags', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart index cf1a744cd629..9587579a4ab0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `message`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart index a679a6c4223d..ad6d165e3c83 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayArrayNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart index cc648bc115c5..456681ced455 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `arrayNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart index 210216f224b5..7b89588b2157 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `arrayArrayOfModel`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart index 23e04b0001bb..c1fb9cd73dc7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart @@ -32,11 +32,10 @@ void main() { // TODO }); - // Name of the pet + // Name of the pet // String ATT_NAME test('to test the property `ATT_NAME`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart index fb7e999bf8d1..b84216c8996d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart index b8fc252acc60..000e31d7f176 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `declawed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart index 70f5fb5e02ac..c484b83670ec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart index 89f1d35e556b..1ca5ccc3a74b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart index f079565f9785..9147e96e4ea8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for DefaultApi void main() { final instance = Openapi().getDefaultApi(); @@ -11,6 +10,5 @@ void main() { test('test fooGet', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart index 98ab991b2b14..298f2d2253b4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart index 7b4f4095dc9f..8d258244accb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart index f57fcdc413df..0d810b3b9fa9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `breed`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart index 438c36db0745..c0d5de925aec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `arrayEnum`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart index b5f3aeb7fbdd..d7dc20b5eb77 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `outerEnumIntegerDefaultValue`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart index c552474e280b..b6cd879840dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for FakeApi void main() { final instance = Openapi().getFakeApi(); @@ -84,9 +83,9 @@ void main() { // TODO }); - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async test('test testEndpointParameters', () async { @@ -113,7 +112,7 @@ void main() { // test inline additionalProperties // - // + // // //Future testInlineAdditionalProperties(BuiltMap requestBody) async test('test testInlineAdditionalProperties', () async { @@ -122,7 +121,7 @@ void main() { // test json serialization of form data // - // + // // //Future testJsonFormData(String param, String param2) async test('test testJsonFormData', () async { @@ -135,6 +134,5 @@ void main() { test('test testQueryParameterCollectionFormat', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart index 3075147f52fd..979c752e1c26 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for FakeClassnameTags123Api void main() { final instance = Openapi().getFakeClassnameTags123Api(); @@ -15,6 +14,5 @@ void main() { test('test testClassname', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart index ca8695bd4a47..1ef8cf8861b4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `files`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart index c64cbb8034c3..cea887a87fd8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `string`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart index 205237788aeb..f840bcda0d17 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `bar`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart index 558c3aa4b659..3827c02e13ae 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart @@ -88,6 +88,5 @@ void main() { test('to test the property `patternWithDigitsAndDelimiter`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart index c34522214751..8b00db3d0711 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `foo`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart index fda0c9218217..050e2c9b814f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `nullableMessage`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart index 56a27610ee5a..56c3d448c6c5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `indirectMap`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart index 85b113387a08..dcaa8d351ae5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `map`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart index 11bac07fafb8..8064eb959a32 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `classField`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart index f494dfd08499..1998f27d715a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `client`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart index 03e5855bf004..fa31f816801c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for ModelEnumClass void main() { - - group(ModelEnumClass, () { - }); + group(ModelEnumClass, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart index 4f1397726226..a07c60c5d85d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart @@ -12,6 +12,5 @@ void main() { test('to test the property `sourceURI`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart index d35e02fe0c9a..0c4e3c45c7a9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `n123list`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart index eedfe7eb281a..b60abdfd6021 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `return_`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart index 6b2329bb0819..d04e76fef9e0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `n123number`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart index 1a6767dbb2ab..32f0eba4fb2e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart @@ -66,6 +66,5 @@ void main() { test('to test the property `objectItemsNullable`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart index 7167d78a4962..7f34d2a5ce60 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `justNumber`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart index cd04ed4d48e0..d1ad3e291dfa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart @@ -26,6 +26,5 @@ void main() { test('to test the property `bars`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart index 7ff992230bf6..3ed96043d80c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `complete`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart index dac257d9a0d6..99a7cb7db596 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `myBoolean`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart index 502c8326be58..a5c83f615194 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumDefaultValue void main() { - - group(OuterEnumDefaultValue, () { - }); + group(OuterEnumDefaultValue, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart index c535fe8ac354..49ebbfcead7f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumIntegerDefaultValue void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); + group(OuterEnumIntegerDefaultValue, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart index d945bc8c489d..3c6b81305c71 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumInteger void main() { - - group(OuterEnumInteger, () { - }); + group(OuterEnumInteger, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart index 8e11eb02fb8a..4ee10f379d5e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnum void main() { - - group(OuterEnum, () { - }); + group(OuterEnum, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart index d6d763c5d93a..cb621828cbc0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `value`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart index bd23e2e9e73d..32a58c15534d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for PetApi void main() { final instance = Openapi().getPetApi(); @@ -9,7 +8,7 @@ void main() { group(PetApi, () { // Add a new pet to the store // - // + // // //Future addPet(Pet pet) async test('test addPet', () async { @@ -18,7 +17,7 @@ void main() { // Deletes a pet // - // + // // //Future deletePet(int petId, { String apiKey }) async test('test deletePet', () async { @@ -54,7 +53,7 @@ void main() { // Update an existing pet // - // + // // //Future updatePet(Pet pet) async test('test updatePet', () async { @@ -63,7 +62,7 @@ void main() { // Updates a pet in the store with form data // - // + // // //Future updatePetWithForm(int petId, { String name, String status }) async test('test updatePetWithForm', () async { @@ -72,7 +71,7 @@ void main() { // uploads an image // - // + // // //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async test('test uploadFile', () async { @@ -81,12 +80,11 @@ void main() { // uploads an image (required) // - // + // // //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async test('test uploadFileWithRequiredFile', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart index b2bac5351d2e..7d57000d4d98 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart @@ -37,6 +37,5 @@ void main() { test('to test the property `status`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart index 550d3d793ec6..f4652322f2c7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `baz`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart index 5cd85add393e..2c265f0d24ae 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart @@ -3,7 +3,5 @@ import 'package:openapi/openapi.dart'; // tests for SingleRefType void main() { - - group(SingleRefType, () { - }); + group(SingleRefType, () {}); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart index 08a4592a1ed7..f81e03f7188d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart @@ -8,9 +8,10 @@ void main() { group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + test( + 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', + () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart index 77b3d9f00224..434bba4e5d7a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for StoreApi void main() { final instance = Openapi().getStoreApi(); @@ -36,12 +35,11 @@ void main() { // Place an order for a pet // - // + // // //Future placeOrder(Order order) async test('test placeOrder', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart index 6f7c63b8f0c2..253a283fc867 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart @@ -16,6 +16,5 @@ void main() { test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart index 29f63ba073ba..e7f3b4112e7d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for UserApi void main() { final instance = Openapi().getUserApi(); @@ -18,7 +17,7 @@ void main() { // Creates list of users with given input array // - // + // // //Future createUsersWithArrayInput(BuiltList user) async test('test createUsersWithArrayInput', () async { @@ -27,7 +26,7 @@ void main() { // Creates list of users with given input array // - // + // // //Future createUsersWithListInput(BuiltList user) async test('test createUsersWithListInput', () async { @@ -45,7 +44,7 @@ void main() { // Get user by user name // - // + // // //Future getUserByName(String username) async test('test getUserByName', () async { @@ -54,7 +53,7 @@ void main() { // Logs user into the system // - // + // // //Future loginUser(String username, String password) async test('test loginUser', () async { @@ -63,7 +62,7 @@ void main() { // Logs out current logged in user session // - // + // // //Future logoutUser() async test('test logoutUser', () async { @@ -78,6 +77,5 @@ void main() { test('test updateUser', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart index 1e6a1bc23faa..40bef6e6d21c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart @@ -47,6 +47,5 @@ void main() { test('to test the property `userStatus`', () async { // TODO }); - }); } From 8d4f73cc322d57ed5b206507478258c5400815b4 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 13 May 2023 15:02:18 +0200 Subject: [PATCH 06/31] update tests to include new option --- .../codegen/dart/dio/DartDioClientOptionsTest.java | 3 ++- .../codegen/options/DartDioClientOptionsProvider.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index 23eee3fd2a2c..f457de7c81d5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -52,7 +52,8 @@ protected void verifyOptions() { verify(clientCodegen).setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); - verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setLibrary(DartDioClientCodegen.NETWORKING_LIBRARY_DEFAULT); + verify(clientCodegen).setSerializationLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index 60cb35293226..2015a52a1360 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -61,6 +61,7 @@ public Map createOptions() { .put(DartDioClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(DartDioClientCodegen.PUB_REPOSITORY, PUB_REPOSITORY_VALUE) .put(DartDioClientCodegen.PUB_PUBLISH_TO, PUB_PUBLISH_TO_VALUE) + .put(CodegenConstants.LIBRARY, DartDioClientCodegen.NETWORKING_LIBRARY_DEFAULT) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT) .put(DartDioClientCodegen.FINAL_PROPERTIES, DartDioClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) From b7d7e76201bc27e487c284c250ccf54f8e27ca99 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:02:53 +0200 Subject: [PATCH 07/31] merge test schemas --- bin/configs/dart-dio-built_value-v3.yaml | 15 + .../dart-dio-json_serializable-v3.yaml | 13 + ...io-oneof-polymorphism-and-inheritance.yaml | 11 - bin/configs/dart-dio-oneof-primitive.yaml | 11 - bin/configs/dart-dio-oneof.yaml | 11 - ...ore-client-lib-fake-json_serializable.yaml | 12 - .../dart-dio-petstore-client-lib-fake.yaml | 13 - .../{oneof => dio/built_value}/.gitignore | 0 .../built_value}/.openapi-generator-ignore | 0 .../dio/built_value/.openapi-generator/FILES | 246 +++++++ .../built_value}/.openapi-generator/VERSION | 0 .../built_value}/README.md | 68 +- .../built_value}/analysis_options.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../built_value}/doc/Addressable.md | 0 .../built_value}/doc/AllOfWithSingleRef.md | 0 .../built_value}/doc/Animal.md | 0 .../built_value}/doc/AnotherFakeApi.md | 0 .../built_value}/doc/ApiResponse.md | 0 .../{oneof => dio/built_value}/doc/Apple.md | 0 .../dio/built_value/doc/AppleAllOfDisc.md | 16 + .../dio/built_value/doc/AppleAnyOfDisc.md | 16 + .../built_value/doc/AppleGrandparentDisc.md | 16 + .../dio/built_value/doc/AppleOneOfDisc.md | 16 + .../dio/built_value/doc/AppleReqDisc.md | 16 + .../built_value/doc/AppleVariant1.md} | 4 +- .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../built_value}/doc/ArrayOfNumberOnly.md | 0 .../built_value}/doc/ArrayTest.md | 0 .../{oneof => dio/built_value}/doc/Banana.md | 0 .../dio/built_value/doc/BananaAllOfDisc.md | 16 + .../dio/built_value/doc/BananaAnyOfDisc.md | 16 + .../built_value/doc/BananaGrandparentDisc.md | 16 + .../dio/built_value/doc/BananaOneOfDisc.md | 16 + .../dio/built_value/doc/BananaReqDisc.md | 16 + .../built_value}/doc/Bar.md | 0 .../built_value}/doc/BarApi.md | 2 +- .../built_value}/doc/BarCreate.md | 0 .../built_value}/doc/BarRef.md | 0 .../built_value}/doc/BarRefOrValue.md | 0 .../built_value}/doc/Capitalization.md | 0 .../built_value}/doc/Cat.md | 0 .../built_value}/doc/CatAllOf.md | 0 .../built_value}/doc/Category.md | 0 .../built_value}/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 15 + .../doc/ComposedDiscOptionalTypeCorrect.md | 15 + .../ComposedDiscOptionalTypeInconsistent.md | 15 + .../doc/ComposedDiscOptionalTypeIncorrect.md | 15 + .../doc/ComposedDiscRequiredInconsistent.md | 15 + .../doc/ComposedDiscTypeInconsistent.md | 15 + .../doc/ComposedDiscTypeIncorrect.md} | 4 +- .../dio/built_value/doc/DefaultApi.md | 244 +++++++ .../built_value}/doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 15 + .../doc/DiscOptionalTypeCorrect.md | 15 + .../doc/DiscOptionalTypeIncorrect.md | 15 + .../dio/built_value/doc/DiscTypeIncorrect.md | 15 + .../built_value}/doc/Dog.md | 0 .../built_value}/doc/DogAllOf.md | 0 .../built_value}/doc/Entity.md | 0 .../built_value}/doc/EntityRef.md | 0 .../built_value}/doc/EnumArrays.md | 0 .../built_value}/doc/EnumTest.md | 0 .../built_value}/doc/Extensible.md | 0 .../built_value}/doc/FakeApi.md | 0 .../doc/FakeClassnameTags123Api.md | 0 .../built_value}/doc/FileSchemaTestClass.md | 0 .../built_value}/doc/Foo.md | 0 .../built_value}/doc/FooApi.md | 2 +- .../doc/FooBasicGetDefaultResponse.md} | 2 +- .../built_value}/doc/FooRef.md | 0 .../built_value}/doc/FooRefOrValue.md | 0 .../built_value}/doc/FormatTest.md | 0 .../{oneof => dio/built_value}/doc/Fruit.md | 0 .../dio/built_value/doc/FruitAllOfDisc.md | 15 + .../dio/built_value/doc/FruitAnyOfDisc.md | 15 + .../built_value/doc/FruitGrandparentDisc.md | 15 + .../dio/built_value/doc/FruitInlineDisc.md | 17 + .../built_value/doc/FruitInlineDiscOneOf.md | 16 + .../built_value/doc/FruitInlineDiscOneOf1.md | 16 + .../built_value/doc/FruitInlineInlineDisc.md | 15 + .../doc/FruitInlineInlineDiscOneOf.md | 16 + .../doc/FruitInlineInlineDiscOneOf1.md | 16 + .../doc/FruitInlineInlineDiscOneOfOneOf.md | 15 + .../dio/built_value/doc/FruitOneOfDisc.md | 15 + .../dio/built_value/doc/FruitReqDisc.md | 17 + .../dart-dio/dio/built_value/doc/FruitType.md | 15 + .../dio/built_value/doc/FruitVariant1.md | 16 + .../built_value/doc/GigaOneOf.md} | 2 +- .../dio/built_value/doc/GrapeVariant1.md | 15 + .../built_value}/doc/HasOnlyReadOnly.md | 0 .../built_value}/doc/HealthCheckResult.md | 0 .../built_value}/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../built_value}/doc/Model200Response.md | 0 .../built_value}/doc/ModelClient.md | 0 .../built_value}/doc/ModelEnumClass.md | 0 .../built_value}/doc/ModelFile.md | 0 .../built_value}/doc/ModelList.md | 0 .../built_value}/doc/ModelReturn.md | 0 .../built_value}/doc/Name.md | 0 .../built_value}/doc/NullableClass.md | 0 .../built_value}/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 2 +- .../built_value/doc/OneOfPrimitiveChild.md | 15 + .../built_value}/doc/Order.md | 0 .../built_value}/doc/OuterComposite.md | 0 .../built_value}/doc/OuterEnum.md | 0 .../built_value}/doc/OuterEnumDefaultValue.md | 0 .../built_value}/doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dart-dio/dio/built_value/doc/Parent.md | 15 + .../built_value}/doc/Pasta.md | 0 .../built_value}/doc/Pet.md | 0 .../built_value}/doc/PetApi.md | 0 .../built_value}/doc/Pizza.md | 0 .../built_value}/doc/PizzaSpeziale.md | 0 .../built_value}/doc/ReadOnlyFirst.md | 0 .../built_value}/doc/SingleRefType.md | 0 .../built_value}/doc/SpecialModelName.md | 0 .../built_value}/doc/StoreApi.md | 0 .../built_value}/doc/Tag.md | 0 .../built_value}/doc/User.md | 0 .../built_value}/doc/UserApi.md | 0 .../built_value}/lib/apis.dart | 2 + .../dart-dio/dio/built_value/lib/models.dart | 109 +++ .../built_value}/lib/openapi.dart | 1 - .../lib/src/api/another_fake_api.dart | 35 +- .../built_value}/lib/src/api/bar_api.dart | 43 +- .../built_value/lib/src/api/default_api.dart | 685 ++++++++++++++++++ .../built_value}/lib/src/api/fake_api.dart | 640 +++++++++------- .../src/api/fake_classname_tags123_api.dart | 35 +- .../built_value}/lib/src/api/foo_api.dart | 71 +- .../built_value}/lib/src/api/pet_api.dart | 277 +++---- .../built_value}/lib/src/api/store_api.dart | 115 +-- .../built_value}/lib/src/api/user_api.dart | 203 +++--- .../built_value}/lib/src/api_client.dart | 39 +- .../dio/built_value/lib/src/api_util.dart | 61 ++ .../built_value}/lib/src/auth/_exports.dart | 2 +- .../lib/src/auth/api_key_auth.dart | 4 +- .../built_value}/lib/src/auth/auth.dart | 3 +- .../built_value}/lib/src/auth/basic_auth.dart | 9 +- .../lib/src/auth/bearer_auth.dart | 3 +- .../built_value}/lib/src/auth/oauth.dart | 3 +- .../built_value}/lib/src/date_serializer.dart | 1 - .../model/additional_properties_class.dart | 44 +- .../lib/src/model/addressable.dart | 16 +- .../lib/src/model/all_of_with_single_ref.dart | 21 +- .../built_value}/lib/src/model/animal.dart | 56 +- .../lib/src/model/api_response.dart | 11 +- .../built_value}/lib/src/model/apple.dart | 7 +- .../lib/src/model/apple_all_of_disc.dart | 125 ++++ .../lib/src/model/apple_any_of_disc.dart | 134 ++++ .../lib/src/model/apple_grandparent_disc.dart | 130 ++++ .../lib/src/model/apple_one_of_disc.dart | 128 ++++ .../lib/src/model/apple_req_disc.dart | 124 ++++ .../lib/src/model/apple_variant1.dart} | 55 +- .../model/array_of_array_of_number_only.dart | 34 +- .../lib/src/model/array_of_number_only.dart | 19 +- .../lib/src/model/array_test.dart | 27 +- .../built_value}/lib/src/model/banana.dart | 7 +- .../lib/src/model/banana_all_of_disc.dart | 125 ++++ .../lib/src/model/banana_any_of_disc.dart | 134 ++++ .../src/model/banana_grandparent_disc.dart | 130 ++++ .../lib/src/model/banana_one_of_disc.dart | 128 ++++ .../lib/src/model/banana_req_disc.dart | 126 ++++ .../built_value}/lib/src/model/bar.dart | 15 +- .../lib/src/model/bar_create.dart | 13 +- .../built_value}/lib/src/model/bar_ref.dart | 7 +- .../lib/src/model/bar_ref_or_value.dart | 68 +- .../lib/src/model/capitalization.dart | 31 +- .../built_value}/lib/src/model/cat.dart | 16 +- .../lib/src/model/cat_all_of.dart | 15 +- .../built_value}/lib/src/model/category.dart | 12 +- .../lib/src/model/class_model.dart | 7 +- ...composed_disc_missing_from_properties.dart | 131 ++++ .../composed_disc_optional_type_correct.dart | 131 ++++ ...posed_disc_optional_type_inconsistent.dart | 147 ++++ ...composed_disc_optional_type_incorrect.dart | 131 ++++ .../composed_disc_required_inconsistent.dart | 147 ++++ .../composed_disc_type_inconsistent.dart | 147 ++++ .../model/composed_disc_type_incorrect.dart | 130 ++++ .../built_value}/lib/src/model/date.dart | 0 .../lib/src/model/deprecated_object.dart | 19 +- .../model/disc_missing_from_properties.dart | 118 +++ .../src/model/disc_optional_type_correct.dart | 117 +++ .../model/disc_optional_type_incorrect.dart | 118 +++ .../lib/src/model/disc_type_incorrect.dart | 111 +++ .../built_value}/lib/src/model/dog.dart | 16 +- .../lib/src/model/dog_all_of.dart | 15 +- .../built_value}/lib/src/model/entity.dart | 113 +-- .../lib/src/model/entity_ref.dart | 59 +- .../lib/src/model/enum_arrays.dart | 51 +- .../built_value}/lib/src/model/enum_test.dart | 102 +-- .../lib/src/model/extensible.dart | 16 +- .../lib/src/model/file_schema_test_class.dart | 26 +- .../built_value}/lib/src/model/foo.dart | 11 +- .../foo_basic_get_default_response.dart} | 46 +- .../built_value}/lib/src/model/foo_ref.dart | 9 +- .../lib/src/model/foo_ref_or_value.dart | 68 +- .../lib/src/model/format_test.dart | 33 +- .../built_value}/lib/src/model/fruit.dart | 22 +- .../lib/src/model/fruit_all_of_disc.dart | 138 ++++ .../lib/src/model/fruit_any_of_disc.dart | 138 ++++ .../lib/src/model/fruit_grandparent_disc.dart | 142 ++++ .../lib/src/model/fruit_inline_disc.dart | 140 ++++ .../src/model/fruit_inline_disc_one_of.dart | 130 ++++ .../src/model/fruit_inline_disc_one_of1.dart | 130 ++++ .../src/model/fruit_inline_inline_disc.dart | 143 ++++ .../fruit_inline_inline_disc_one_of.dart | 133 ++++ .../fruit_inline_inline_disc_one_of1.dart | 133 ++++ ...ruit_inline_inline_disc_one_of_one_of.dart | 117 +++ .../lib/src/model/fruit_one_of_disc.dart | 138 ++++ .../lib/src/model/fruit_req_disc.dart | 137 ++++ .../built_value/lib/src/model/fruit_type.dart | 143 ++++ .../lib/src/model/fruit_variant1.dart | 132 ++++ .../lib/src/model/giga_one_of.dart | 79 ++ .../lib/src/model/grape_variant1.dart | 112 +++ .../lib/src/model/has_only_read_only.dart | 21 +- .../lib/src/model/health_check_result.dart | 19 +- .../built_value}/lib/src/model/map_test.dart | 62 +- ...rties_and_additional_properties_class.dart | 43 +- .../lib/src/model/model200_response.dart | 21 +- .../lib/src/model/model_client.dart | 7 +- .../lib/src/model/model_enum_class.dart | 10 +- .../lib/src/model/model_file.dart | 5 +- .../lib/src/model/model_list.dart | 7 +- .../lib/src/model/model_return.dart | 7 +- .../built_value}/lib/src/model/name.dart | 13 +- .../lib/src/model/nullable_class.dart | 74 +- .../lib/src/model/number_only.dart | 7 +- .../model/object_with_deprecated_fields.dart | 41 +- .../src/model/one_of_primitive_child.dart} | 44 +- .../built_value}/lib/src/model/order.dart | 30 +- .../lib/src/model/outer_composite.dart | 23 +- .../lib/src/model/outer_enum.dart | 4 +- .../src/model/outer_enum_default_value.dart | 13 +- .../lib/src/model/outer_enum_integer.dart | 7 +- .../outer_enum_integer_default_value.dart | 13 +- .../outer_object_with_enum_property.dart | 26 +- .../dio/built_value/lib/src/model/parent.dart | 139 ++++ .../built_value}/lib/src/model/pasta.dart | 9 +- .../built_value}/lib/src/model/pet.dart | 24 +- .../built_value}/lib/src/model/pizza.dart | 40 +- .../lib/src/model/pizza_speziale.dart | 19 +- .../lib/src/model/read_only_first.dart | 18 +- .../lib/src/model/single_ref_type.dart | 4 +- .../lib/src/model/special_model_name.dart | 29 +- .../built_value}/lib/src/model/tag.dart | 9 +- .../built_value}/lib/src/model/user.dart | 19 +- .../built_value/lib/src/repository_base.dart} | 32 +- .../built_value/lib/src/repository_impl.dart | 48 ++ .../built_value}/lib/src/serializers.dart | 85 ++- .../built_value}/pom.xml | 10 +- .../{oneof => dio/built_value}/pubspec.yaml | 0 .../additional_properties_class_test.dart | 0 .../built_value}/test/addressable_test.dart | 1 - .../test/all_of_with_single_ref_test.dart | 0 .../built_value}/test/animal_test.dart | 0 .../test/another_fake_api_test.dart | 0 .../built_value}/test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 20 + .../test/apple_any_of_disc_test.dart | 20 + .../test/apple_grandparent_disc_test.dart | 20 + .../test/apple_one_of_disc_test.dart | 20 + .../built_value/test/apple_req_disc_test.dart | 20 + .../built_value}/test/apple_test.dart | 1 - .../built_value/test/apple_variant1_test.dart | 15 + .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../built_value}/test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 20 + .../test/banana_any_of_disc_test.dart | 20 + .../test/banana_grandparent_disc_test.dart | 20 + .../test/banana_one_of_disc_test.dart | 20 + .../test/banana_req_disc_test.dart | 20 + .../built_value}/test/banana_test.dart | 1 - .../built_value}/test/bar_api_test.dart | 2 - .../built_value}/test/bar_create_test.dart | 1 - .../test/bar_ref_or_value_test.dart | 1 - .../built_value}/test/bar_ref_test.dart | 1 - .../built_value}/test/bar_test.dart | 1 - .../test/capitalization_test.dart | 0 .../built_value}/test/cat_all_of_test.dart | 0 .../built_value}/test/cat_test.dart | 0 .../built_value}/test/category_test.dart | 0 .../built_value}/test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 15 + ...posed_disc_optional_type_correct_test.dart | 15 + ..._disc_optional_type_inconsistent_test.dart | 15 + ...sed_disc_optional_type_incorrect_test.dart | 15 + ...posed_disc_required_inconsistent_test.dart | 15 + .../composed_disc_type_inconsistent_test.dart | 15 + .../composed_disc_type_incorrect_test.dart | 15 + .../built_value/test/default_api_test.dart | 39 + .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 15 + .../test/disc_optional_type_correct_test.dart | 15 + .../disc_optional_type_incorrect_test.dart | 15 + .../test/disc_type_incorrect_test.dart | 15 + .../built_value}/test/dog_all_of_test.dart | 0 .../built_value}/test/dog_test.dart | 0 .../built_value}/test/entity_ref_test.dart | 1 - .../built_value}/test/entity_test.dart | 1 - .../built_value}/test/enum_arrays_test.dart | 0 .../built_value}/test/enum_test_test.dart | 0 .../built_value}/test/extensible_test.dart | 1 - .../built_value}/test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../built_value}/test/foo_api_test.dart | 2 - .../foo_basic_get_default_response_test.dart} | 6 +- .../test/foo_ref_or_value_test.dart | 1 - .../built_value}/test/foo_ref_test.dart | 1 - .../built_value}/test/foo_test.dart | 1 - .../built_value}/test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 15 + .../test/fruit_any_of_disc_test.dart | 15 + .../test/fruit_grandparent_disc_test.dart | 15 + .../test/fruit_inline_disc_one_of1_test.dart | 20 + .../test/fruit_inline_disc_one_of_test.dart | 20 + .../test/fruit_inline_disc_test.dart | 25 + ...fruit_inline_inline_disc_one_of1_test.dart | 20 + ...inline_inline_disc_one_of_one_of_test.dart | 15 + .../fruit_inline_inline_disc_one_of_test.dart | 20 + .../test/fruit_inline_inline_disc_test.dart | 15 + .../test/fruit_one_of_disc_test.dart | 15 + .../built_value/test/fruit_req_disc_test.dart | 25 + .../built_value}/test/fruit_test.dart | 1 - .../dio/built_value/test/fruit_type_test.dart | 15 + .../built_value/test/fruit_variant1_test.dart | 20 + .../built_value/test/giga_one_of_test.dart} | 7 +- .../built_value/test/grape_variant1_test.dart | 15 + .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../built_value}/test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../built_value}/test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../built_value}/test/model_file_test.dart | 0 .../built_value}/test/model_list_test.dart | 0 .../built_value}/test/model_return_test.dart | 0 .../built_value}/test/name_test.dart | 0 .../test/nullable_class_test.dart | 0 .../built_value}/test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 2 +- .../test/one_of_primitive_child_test.dart} | 7 +- .../built_value}/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../built_value}/test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../dio/built_value/test/parent_test.dart | 15 + .../built_value}/test/pasta_test.dart | 1 - .../built_value}/test/pet_api_test.dart | 0 .../built_value}/test/pet_test.dart | 0 .../test/pizza_speziale_test.dart | 1 - .../built_value}/test/pizza_test.dart | 1 - .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../built_value}/test/store_api_test.dart | 0 .../built_value}/test/tag_test.dart | 0 .../built_value}/test/user_api_test.dart | 0 .../built_value}/test/user_test.dart | 0 .../built_value_tests}/.gitignore | 0 .../built_value_tests}/README.md | 0 .../built_value_tests}/analysis_options.yaml | 0 .../built_value_tests}/pubspec.yaml | 2 +- .../built_value_tests}/puby.yaml | 0 .../test/api/authentication_test.dart | 0 .../test/api/fake_api_test.dart | 0 .../test/api/pet_api_test.dart | 0 .../test/api/store_api_test.dart | 0 .../test/api_util_test.dart | 0 .../test/model/date_serializer_test.dart | 0 .../test/model/date_test.dart | 0 .../json_serializable}/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/FILES | 244 +++++++ .../.openapi-generator/VERSION | 0 .../json_serializable}/README.md | 68 +- .../json_serializable}/analysis_options.yaml | 0 .../json_serializable}/build.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../dio/json_serializable/doc/Addressable.md | 16 + .../doc/AllOfWithSingleRef.md | 0 .../json_serializable}/doc/Animal.md | 0 .../json_serializable}/doc/AnotherFakeApi.md | 0 .../json_serializable}/doc/ApiResponse.md | 0 .../dio/json_serializable/doc/Apple.md | 15 + .../json_serializable/doc/AppleAllOfDisc.md | 16 + .../json_serializable/doc/AppleAnyOfDisc.md | 16 + .../doc/AppleGrandparentDisc.md | 16 + .../json_serializable/doc/AppleOneOfDisc.md | 16 + .../dio/json_serializable/doc/AppleReqDisc.md | 16 + .../json_serializable/doc/AppleVariant1.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../doc/ArrayOfNumberOnly.md | 0 .../json_serializable}/doc/ArrayTest.md | 0 .../dio/json_serializable/doc/Banana.md | 15 + .../json_serializable/doc/BananaAllOfDisc.md | 16 + .../json_serializable/doc/BananaAnyOfDisc.md | 16 + .../doc/BananaGrandparentDisc.md | 16 + .../json_serializable/doc/BananaOneOfDisc.md | 16 + .../json_serializable/doc/BananaReqDisc.md | 16 + .../dart-dio/dio/json_serializable/doc/Bar.md | 22 + .../json_serializable/doc/BarApi.md} | 26 +- .../dio/json_serializable/doc/BarCreate.md | 22 + .../json_serializable/doc/BarRef.md} | 4 +- .../json_serializable/doc/BarRefOrValue.md | 19 + .../json_serializable}/doc/Capitalization.md | 0 .../json_serializable}/doc/Cat.md | 0 .../json_serializable}/doc/CatAllOf.md | 0 .../json_serializable}/doc/Category.md | 0 .../json_serializable}/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 15 + .../doc/ComposedDiscOptionalTypeCorrect.md | 15 + .../ComposedDiscOptionalTypeInconsistent.md | 15 + .../doc/ComposedDiscOptionalTypeIncorrect.md | 15 + .../doc/ComposedDiscRequiredInconsistent.md | 15 + .../doc/ComposedDiscTypeInconsistent.md | 15 + .../doc/ComposedDiscTypeIncorrect.md | 15 + .../dio/json_serializable/doc/DefaultApi.md | 244 +++++++ .../doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 15 + .../doc/DiscOptionalTypeCorrect.md | 15 + .../doc/DiscOptionalTypeIncorrect.md | 15 + .../doc/DiscTypeIncorrect.md | 15 + .../json_serializable}/doc/Dog.md | 0 .../json_serializable}/doc/DogAllOf.md | 0 .../dio/json_serializable/doc/Entity.md | 19 + .../dio/json_serializable/doc/EntityRef.md | 21 + .../json_serializable}/doc/EnumArrays.md | 0 .../json_serializable}/doc/EnumTest.md | 0 .../dio/json_serializable/doc/Extensible.md | 17 + .../json_serializable}/doc/FakeApi.md | 0 .../doc/FakeClassnameTags123Api.md | 0 .../doc/FileSchemaTestClass.md | 0 .../dart-dio/dio/json_serializable/doc/Foo.md | 21 + .../dio/json_serializable/doc/FooApi.md | 93 +++ .../doc/FooBasicGetDefaultResponse.md} | 2 +- .../dio/json_serializable/doc/FooRef.md | 20 + .../json_serializable/doc/FooRefOrValue.md | 19 + .../json_serializable}/doc/FormatTest.md | 0 .../dio/json_serializable/doc/Fruit.md | 17 + .../json_serializable/doc/FruitAllOfDisc.md | 15 + .../json_serializable/doc/FruitAnyOfDisc.md | 15 + .../doc/FruitGrandparentDisc.md | 15 + .../json_serializable/doc/FruitInlineDisc.md | 17 + .../doc/FruitInlineDiscOneOf.md | 16 + .../doc/FruitInlineDiscOneOf1.md | 16 + .../doc/FruitInlineInlineDisc.md | 15 + .../doc/FruitInlineInlineDiscOneOf.md | 16 + .../doc/FruitInlineInlineDiscOneOf1.md | 16 + .../doc/FruitInlineInlineDiscOneOfOneOf.md | 15 + .../json_serializable/doc/FruitOneOfDisc.md | 15 + .../dio/json_serializable/doc/FruitReqDisc.md | 17 + .../dio/json_serializable/doc/FruitType.md | 15 + .../json_serializable/doc/FruitVariant1.md | 16 + .../json_serializable/doc/GigaOneOf.md} | 2 +- .../json_serializable/doc/GrapeVariant1.md | 15 + .../json_serializable}/doc/HasOnlyReadOnly.md | 0 .../doc/HealthCheckResult.md | 0 .../json_serializable}/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../doc/Model200Response.md | 0 .../json_serializable}/doc/ModelClient.md | 0 .../json_serializable}/doc/ModelEnumClass.md | 0 .../json_serializable}/doc/ModelFile.md | 0 .../json_serializable}/doc/ModelList.md | 0 .../json_serializable}/doc/ModelReturn.md | 0 .../json_serializable}/doc/Name.md | 0 .../json_serializable}/doc/NullableClass.md | 0 .../json_serializable}/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 2 +- .../doc/OneOfPrimitiveChild.md | 15 + .../json_serializable}/doc/Order.md | 0 .../json_serializable}/doc/OuterComposite.md | 0 .../json_serializable}/doc/OuterEnum.md | 0 .../doc/OuterEnumDefaultValue.md | 0 .../doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dio/json_serializable/doc/Parent.md | 15 + .../dio/json_serializable/doc/Pasta.md | 20 + .../json_serializable}/doc/Pet.md | 0 .../json_serializable}/doc/PetApi.md | 0 .../dio/json_serializable/doc/Pizza.md | 20 + .../json_serializable/doc/PizzaSpeziale.md | 20 + .../json_serializable}/doc/ReadOnlyFirst.md | 0 .../json_serializable}/doc/SingleRefType.md | 0 .../doc/SpecialModelName.md | 0 .../json_serializable}/doc/StoreApi.md | 0 .../json_serializable}/doc/Tag.md | 0 .../json_serializable}/doc/User.md | 0 .../json_serializable}/doc/UserApi.md | 0 .../json_serializable}/lib/apis.dart | 2 + .../dio/json_serializable/lib/models.dart | 106 +++ .../json_serializable}/lib/openapi.dart | 1 - .../lib/src/api/another_fake_api.dart | 35 +- .../lib/src/api/bar_api.dart} | 71 +- .../lib/src/api/default_api.dart | 684 +++++++++++++++++ .../lib/src/api/fake_api.dart | 641 +++++++++------- .../src/api/fake_classname_tags123_api.dart | 35 +- .../lib/src/api/foo_api.dart | 259 +++++++ .../lib/src/api/pet_api.dart | 277 +++---- .../lib/src/api/store_api.dart | 115 +-- .../lib/src/api/user_api.dart | 203 +++--- .../lib/src/api_client.dart | 39 +- .../json_serializable/lib/src/api_util.dart | 61 ++ .../lib/src/auth/_exports.dart | 2 +- .../lib/src/auth/api_key_auth.dart | 4 +- .../json_serializable}/lib/src/auth/auth.dart | 3 +- .../lib/src/auth/basic_auth.dart | 9 +- .../lib/src/auth/bearer_auth.dart | 3 +- .../lib/src/auth/oauth.dart | 3 +- .../model/additional_properties_class.dart | 46 +- .../lib/src/model/addressable.dart | 48 ++ .../lib/src/model/all_of_with_single_ref.dart | 46 +- .../lib/src/model/animal.dart | 43 +- .../lib/src/model/api_response.dart | 53 ++ .../lib/src/model/apple.dart | 40 + .../lib/src/model/apple_all_of_disc.dart | 48 ++ .../lib/src/model/apple_any_of_disc.dart | 49 ++ .../lib/src/model/apple_grandparent_disc.dart | 48 ++ .../lib/src/model/apple_one_of_disc.dart | 49 ++ .../lib/src/model/apple_req_disc.dart | 48 ++ .../lib/src/model/apple_variant1.dart | 41 ++ .../model/array_of_array_of_number_only.dart | 29 +- .../lib/src/model/array_of_number_only.dart | 28 +- .../lib/src/model/array_test.dart | 58 ++ .../lib/src/model/banana.dart | 40 + .../lib/src/model/banana_all_of_disc.dart | 48 ++ .../lib/src/model/banana_any_of_disc.dart | 49 ++ .../src/model/banana_grandparent_disc.dart | 48 ++ .../lib/src/model/banana_one_of_disc.dart | 49 ++ .../lib/src/model/banana_req_disc.dart | 48 ++ .../json_serializable/lib/src/model/bar.dart | 93 +++ .../lib/src/model/bar_create.dart | 95 +++ .../lib/src/model/bar_ref.dart | 75 ++ .../lib/src/model/bar_ref_or_value.dart | 75 ++ .../lib/src/model/capitalization.dart | 75 ++ .../json_serializable}/lib/src/model/cat.dart | 62 +- .../lib/src/model/cat_all_of.dart | 27 +- .../lib/src/model/category.dart | 46 +- .../lib/src/model/class_model.dart | 27 +- ...composed_disc_missing_from_properties.dart | 45 ++ .../composed_disc_optional_type_correct.dart | 44 ++ ...posed_disc_optional_type_inconsistent.dart | 47 ++ ...composed_disc_optional_type_incorrect.dart | 46 ++ .../composed_disc_required_inconsistent.dart | 46 ++ .../composed_disc_type_inconsistent.dart | 44 ++ .../model/composed_disc_type_incorrect.dart | 43 ++ .../lib/src/model/deprecated_object.dart | 27 +- .../model/disc_missing_from_properties.dart | 42 ++ .../src/model/disc_optional_type_correct.dart | 42 ++ .../model/disc_optional_type_incorrect.dart | 42 ++ .../lib/src/model/disc_type_incorrect.dart | 42 ++ .../json_serializable}/lib/src/model/dog.dart | 62 +- .../lib/src/model/dog_all_of.dart | 27 +- .../lib/src/model/entity.dart | 72 ++ .../lib/src/model/entity_ref.dart | 87 +++ .../lib/src/model/enum_arrays.dart | 50 +- .../lib/src/model/enum_test.dart | 164 +---- .../lib/src/model/extensible.dart | 57 ++ .../lib/src/model/file_schema_test_class.dart | 46 +- .../json_serializable/lib/src/model/foo.dart | 87 +++ .../model/foo_basic_get_default_response.dart | 43 ++ .../lib/src/model/foo_ref.dart | 81 +++ .../lib/src/model/foo_ref_or_value.dart | 75 ++ .../lib/src/model/format_test.dart | 150 ++++ .../lib/src/model/fruit.dart | 54 ++ .../lib/src/model/fruit_all_of_disc.dart | 44 ++ .../lib/src/model/fruit_any_of_disc.dart | 44 ++ .../lib/src/model/fruit_grandparent_disc.dart | 44 ++ .../lib/src/model/fruit_inline_disc.dart | 55 ++ .../src/model/fruit_inline_disc_one_of.dart | 48 ++ .../src/model/fruit_inline_disc_one_of1.dart | 48 ++ .../src/model/fruit_inline_inline_disc.dart | 44 ++ .../fruit_inline_inline_disc_one_of.dart | 49 ++ .../fruit_inline_inline_disc_one_of1.dart | 49 ++ ...ruit_inline_inline_disc_one_of_one_of.dart | 43 ++ .../lib/src/model/fruit_one_of_disc.dart | 44 ++ .../lib/src/model/fruit_req_disc.dart | 55 ++ .../lib/src/model/fruit_type.dart | 42 ++ .../lib/src/model/fruit_variant1.dart | 48 ++ .../lib/src/model/giga_one_of.dart | 42 ++ .../lib/src/model/grape_variant1.dart | 41 ++ .../lib/src/model/has_only_read_only.dart | 44 +- .../lib/src/model/health_check_result.dart | 28 +- .../lib/src/model/map_test.dart | 71 ++ ...rties_and_additional_properties_class.dart | 56 ++ .../lib/src/model/model200_response.dart | 44 +- .../lib/src/model/model_client.dart | 27 +- .../lib/src/model/model_enum_class.dart | 1 - .../lib/src/model/model_file.dart | 30 +- .../lib/src/model/model_list.dart | 28 +- .../lib/src/model/model_return.dart | 28 +- .../json_serializable/lib/src/model/name.dart | 61 ++ .../lib/src/model/nullable_class.dart | 121 ++++ .../lib/src/model/number_only.dart | 28 +- .../model/object_with_deprecated_fields.dart | 82 +-- .../lib/src/model/one_of_primitive_child.dart | 42 ++ .../lib/src/model/order.dart | 90 +++ .../lib/src/model/outer_composite.dart | 54 ++ .../lib/src/model/outer_enum.dart | 1 - .../src/model/outer_enum_default_value.dart | 1 - .../lib/src/model/outer_enum_integer.dart | 1 - .../outer_enum_integer_default_value.dart | 1 - .../outer_object_with_enum_property.dart | 28 +- .../lib/src/model/parent.dart | 40 + .../lib/src/model/pasta.dart | 81 +++ .../json_serializable/lib/src/model/pet.dart | 88 +++ .../lib/src/model/pizza.dart | 81 +++ .../lib/src/model/pizza_speziale.dart | 82 +++ .../lib/src/model/read_only_first.dart | 44 +- .../lib/src/model/single_ref_type.dart | 1 - .../lib/src/model/special_model_name.dart | 29 +- .../json_serializable}/lib/src/model/tag.dart | 41 +- .../json_serializable/lib/src/model/user.dart | 86 +++ .../lib/src/repository_base.dart} | 32 +- .../lib/src/repository_impl.dart | 325 +++++++++ .../json_serializable}/pom.xml | 0 .../json_serializable}/pubspec.yaml | 0 .../additional_properties_class_test.dart | 0 .../test/addressable_test.dart | 22 + .../test/all_of_with_single_ref_test.dart | 0 .../json_serializable}/test/animal_test.dart | 0 .../test/another_fake_api_test.dart | 0 .../test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 20 + .../test/apple_any_of_disc_test.dart | 20 + .../test/apple_grandparent_disc_test.dart | 20 + .../test/apple_one_of_disc_test.dart | 20 + .../test/apple_req_disc_test.dart | 20 + .../json_serializable/test/apple_test.dart | 15 + .../test/apple_variant1_test.dart | 15 + .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 20 + .../test/banana_any_of_disc_test.dart | 20 + .../test/banana_grandparent_disc_test.dart | 20 + .../test/banana_one_of_disc_test.dart | 20 + .../test/banana_req_disc_test.dart | 20 + .../json_serializable/test/banana_test.dart | 15 + .../json_serializable/test/bar_api_test.dart | 16 + .../test/bar_create_test.dart | 55 ++ .../test/bar_ref_or_value_test.dart | 40 + .../json_serializable/test/bar_ref_test.dart | 40 + .../dio/json_serializable/test/bar_test.dart | 54 ++ .../test/capitalization_test.dart | 0 .../test/cat_all_of_test.dart | 0 .../json_serializable}/test/cat_test.dart | 0 .../test/category_test.dart | 0 .../test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 16 + ...posed_disc_optional_type_correct_test.dart | 16 + ..._disc_optional_type_inconsistent_test.dart | 16 + ...sed_disc_optional_type_incorrect_test.dart | 16 + ...posed_disc_required_inconsistent_test.dart | 16 + .../composed_disc_type_inconsistent_test.dart | 16 + .../composed_disc_type_incorrect_test.dart | 16 + .../test/default_api_test.dart | 39 + .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 16 + .../test/disc_optional_type_correct_test.dart | 16 + .../disc_optional_type_incorrect_test.dart | 16 + .../test/disc_type_incorrect_test.dart | 15 + .../test/dog_all_of_test.dart | 0 .../json_serializable}/test/dog_test.dart | 0 .../test/entity_ref_test.dart | 52 ++ .../json_serializable/test/entity_test.dart | 40 + .../test/enum_arrays_test.dart | 0 .../test/enum_test_test.dart | 0 .../test/extensible_test.dart | 28 + .../test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../json_serializable/test/foo_api_test.dart | 23 + .../foo_basic_get_default_response_test.dart} | 7 +- .../test/foo_ref_or_value_test.dart | 40 + .../json_serializable/test/foo_ref_test.dart | 45 ++ .../dio/json_serializable/test/foo_test.dart | 50 ++ .../test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 15 + .../test/fruit_any_of_disc_test.dart | 15 + .../test/fruit_grandparent_disc_test.dart | 15 + .../test/fruit_inline_disc_one_of1_test.dart | 20 + .../test/fruit_inline_disc_one_of_test.dart | 20 + .../test/fruit_inline_disc_test.dart | 25 + ...fruit_inline_inline_disc_one_of1_test.dart | 21 + ...inline_inline_disc_one_of_one_of_test.dart | 16 + .../fruit_inline_inline_disc_one_of_test.dart | 21 + .../test/fruit_inline_inline_disc_test.dart | 15 + .../test/fruit_one_of_disc_test.dart | 15 + .../test/fruit_req_disc_test.dart | 25 + .../json_serializable/test/fruit_test.dart | 25 + .../test/fruit_type_test.dart | 15 + .../test/fruit_variant1_test.dart | 20 + .../test/giga_one_of_test.dart | 15 + .../test/grape_variant1_test.dart | 15 + .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../test/model_file_test.dart | 0 .../test/model_list_test.dart | 0 .../test/model_return_test.dart | 0 .../json_serializable}/test/name_test.dart | 0 .../test/nullable_class_test.dart | 0 .../test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 2 +- .../test/one_of_primitive_child_test.dart | 15 + .../json_serializable}/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../json_serializable/test/parent_test.dart | 15 + .../json_serializable/test/pasta_test.dart | 45 ++ .../json_serializable}/test/pet_api_test.dart | 0 .../json_serializable}/test/pet_test.dart | 0 .../test/pizza_speziale_test.dart | 45 ++ .../json_serializable/test/pizza_test.dart | 45 ++ .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../test/store_api_test.dart | 0 .../json_serializable}/test/tag_test.dart | 0 .../test/user_api_test.dart | 0 .../json_serializable}/test/user_test.dart | 0 .../dart-dio/oneof/.openapi-generator/FILES | 27 - .../client/petstore/dart-dio/oneof/README.md | 84 --- .../petstore/dart-dio/oneof/doc/DefaultApi.md | 51 -- .../petstore/dart-dio/oneof/lib/api.dart | 2 - .../petstore/dart-dio/oneof/lib/apis.dart | 2 - .../petstore/dart-dio/oneof/lib/models.dart | 8 - .../dart-dio/oneof/lib/src/api_client.dart | 71 -- .../dart-dio/oneof/lib/src/api_util.dart | 77 -- .../dart-dio/oneof/lib/src/auth/auth.dart | 18 - .../dart-dio/oneof/lib/src/auth/oauth.dart | 26 - .../oneof/lib/src/date_serializer.dart | 31 - .../oneof/lib/src/json_repository_base.dart | 52 -- .../oneof/lib/src/repository_base.dart | 61 -- .../oneof/lib/src/repository_impl.dart | 134 ---- .../dart-dio/oneof/lib/src/serializers.dart | 31 - .../client/petstore/dart-dio/oneof/pom.xml | 88 --- .../dart-dio/oneof/test/default_api_test.dart | 16 - .../.openapi-generator/FILES | 51 -- .../README.md | 99 --- .../analysis_options.yaml | 11 - .../lib/api.dart | 3 - .../lib/apis.dart | 3 - .../lib/models.dart | 19 - .../lib/src/api_client.dart | 77 -- .../lib/src/api_util.dart | 77 -- .../lib/src/auth/api_key_auth.dart | 30 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/oauth.dart | 26 - .../lib/src/json_repository_base.dart | 52 -- .../lib/src/model/date.dart | 70 -- .../lib/src/repository_base.dart | 61 -- .../lib/src/repository_impl.dart | 134 ---- .../lib/src/serializers.dart | 51 -- .../pom.xml | 88 --- .../pubspec.yaml | 19 - .../dart-dio/oneof_primitive/.gitignore | 41 -- .../oneof_primitive/.openapi-generator-ignore | 23 - .../oneof_primitive/.openapi-generator/FILES | 25 - .../.openapi-generator/VERSION | 1 - .../dart-dio/oneof_primitive/README.md | 83 --- .../oneof_primitive/analysis_options.yaml | 11 - .../oneof_primitive/doc/DefaultApi.md | 51 -- .../dart-dio/oneof_primitive/lib/api.dart | 2 - .../dart-dio/oneof_primitive/lib/apis.dart | 2 - .../dart-dio/oneof_primitive/lib/models.dart | 7 - .../dart-dio/oneof_primitive/lib/openapi.dart | 8 - .../lib/src/api/default_api.dart | 140 ---- .../oneof_primitive/lib/src/api_client.dart | 71 -- .../oneof_primitive/lib/src/api_util.dart | 77 -- .../lib/src/auth/_exports.dart | 5 - .../lib/src/auth/bearer_auth.dart | 26 - .../lib/src/date_serializer.dart | 31 - .../lib/src/json_repository_base.dart | 52 -- .../oneof_primitive/lib/src/model/date.dart | 70 -- .../lib/src/model/example.dart | 72 -- .../lib/src/repository_base.dart | 61 -- .../lib/src/repository_impl.dart | 134 ---- .../oneof_primitive/lib/src/serializers.dart | 30 - .../petstore/dart-dio/oneof_primitive/pom.xml | 88 --- .../dart-dio/oneof_primitive/pubspec.yaml | 19 - .../test/default_api_test.dart | 16 - .../.gitignore | 41 -- .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 127 ---- .../.openapi-generator/VERSION | 1 - .../doc/DefaultApi.md | 51 -- .../doc/InlineResponseDefault.md | 15 - .../lib/models.dart | 51 -- .../lib/openapi.dart | 8 - .../lib/src/api/default_api.dart | 140 ---- .../lib/src/auth/_exports.dart | 5 - .../lib/src/auth/api_key_auth.dart | 30 - .../lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../lib/src/deserialize.dart | 202 ------ .../lib/src/model/api_response.dart | 86 --- .../lib/src/model/array_test.dart | 87 --- .../lib/src/model/capitalization.dart | 135 ---- .../lib/src/model/foo.dart | 54 -- .../src/model/foo_get_default_response.dart | 55 -- .../lib/src/model/format_test.dart | 302 -------- .../lib/src/model/map_test.dart | 113 --- ...rties_and_additional_properties_class.dart | 87 --- .../lib/src/model/name.dart | 102 --- .../lib/src/model/nullable_class.dart | 230 ------ .../lib/src/model/order.dart | 148 ---- .../lib/src/model/outer_composite.dart | 86 --- .../lib/src/model/pet.dart | 150 ---- .../lib/src/model/user.dart | 167 ----- .../lib/src/repository_base.dart | 61 -- .../lib/src/repository_impl.dart | 184 ----- .../test/default_api_test.dart | 14 - .../test/foo_test.dart | 15 - .../petstore_client_lib_fake/.gitignore | 41 -- .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 129 ---- .../.openapi-generator/VERSION | 1 - .../analysis_options.yaml | 11 - .../doc/InlineResponseDefault.md | 15 - .../petstore_client_lib_fake/lib/models.dart | 53 -- .../petstore_client_lib_fake/lib/openapi.dart | 8 - .../lib/src/api/default_api.dart | 140 ---- .../lib/src/api_util.dart | 78 -- .../lib/src/auth/_exports.dart | 5 - .../lib/src/auth/api_key_auth.dart | 30 - .../lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../lib/src/auth/oauth.dart | 26 - .../lib/src/date_serializer.dart | 31 - .../lib/src/model/date.dart | 70 -- .../lib/src/repository_base.dart | 61 -- .../lib/src/repository_impl.dart | 134 ---- .../petstore_client_lib_fake/pubspec.yaml | 19 - .../test/default_api_test.dart | 14 - .../test/foo_test.dart | 15 - 860 files changed, 19411 insertions(+), 9679 deletions(-) create mode 100644 bin/configs/dart-dio-built_value-v3.yaml create mode 100644 bin/configs/dart-dio-json_serializable-v3.yaml delete mode 100644 bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml delete mode 100644 bin/configs/dart-dio-oneof-primitive.yaml delete mode 100644 bin/configs/dart-dio-oneof.yaml delete mode 100644 bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml delete mode 100644 bin/configs/dart-dio-petstore-client-lib-fake.yaml rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/.gitignore (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/.openapi-generator-ignore (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/.openapi-generator/VERSION (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/README.md (73%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/AdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Addressable.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/AllOfWithSingleRef.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Animal.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/AnotherFakeApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ApiResponse.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/doc/Apple.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable/doc/Foo.md => dio/built_value/doc/AppleVariant1.md} (82%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/ArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/ArrayTest.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/doc/Banana.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Bar.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/BarApi.md (95%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/BarCreate.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/BarRef.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/BarRefOrValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Capitalization.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Cat.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/CatAllOf.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Category.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/ClassModel.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/doc/Foo.md => dio/built_value/doc/ComposedDiscTypeIncorrect.md} (82%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/DeprecatedObject.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Dog.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/DogAllOf.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Entity.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/EntityRef.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/EnumArrays.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/EnumTest.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Extensible.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/FakeApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/FakeClassnameTags123Api.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/FileSchemaTestClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Foo.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/FooApi.md (97%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md => dio/built_value/doc/FooBasicGetDefaultResponse.md} (90%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/FooRef.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/FooRefOrValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/FormatTest.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/doc/Fruit.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive/doc/Example.md => dio/built_value/doc/GigaOneOf.md} (93%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/HasOnlyReadOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/HealthCheckResult.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/MapTest.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/Model200Response.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ModelClient.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ModelEnumClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ModelFile.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ModelList.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ModelReturn.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Name.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/NullableClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/NumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/ObjectWithDeprecatedFields.md (89%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Order.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterComposite.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterEnum.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterEnumDefaultValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterEnumInteger.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/OuterObjectWithEnumProperty.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Pasta.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/Pet.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/PetApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/Pizza.md (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/doc/PizzaSpeziale.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/ReadOnlyFirst.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/SingleRefType.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/SpecialModelName.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/StoreApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/Tag.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/doc/User.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/doc/UserApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/apis.dart (81%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/openapi.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/api/another_fake_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/api/bar_api.dart (88%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/api/fake_api.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/lib/src/api/fake_classname_tags123_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/api/foo_api.dart (87%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/api/pet_api.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/api/store_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/api/user_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/lib/src/api_client.dart (74%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/auth/_exports.dart (83%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive => dio/built_value}/lib/src/auth/api_key_auth.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive => dio/built_value}/lib/src/auth/auth.dart (80%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive => dio/built_value}/lib/src/auth/basic_auth.dart (70%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/auth/bearer_auth.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive => dio/built_value}/lib/src/auth/oauth.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/date_serializer.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/additional_properties_class.dart (71%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/addressable.dart (91%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/all_of_with_single_ref.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/animal.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/api_response.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/model/apple.dart (95%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/lib/src/model/foo.dart => dio/built_value/lib/src/model/apple_variant1.dart} (62%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/array_of_array_of_number_only.dart (72%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/array_of_number_only.dart (85%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/array_test.dart (85%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/model/banana.dart (95%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/bar.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/bar_create.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/bar_ref.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/bar_ref_or_value.dart (71%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/capitalization.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/cat.dart (92%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/cat_all_of.dart (90%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/category.dart (93%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/class_model.dart (95%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/model/date.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/deprecated_object.dart (85%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/dog.dart (92%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/dog_all_of.dart (90%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/entity.dart (80%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/entity_ref.dart (87%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/enum_arrays.dart (72%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/enum_test.dart (75%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/extensible.dart (92%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/file_schema_test_class.dart (84%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/foo.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart => dio/built_value/lib/src/model/foo_basic_get_default_response.dart} (63%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/foo_ref.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/foo_ref_or_value.dart (71%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/format_test.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/lib/src/model/fruit.dart (85%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/has_only_read_only.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/health_check_result.dart (85%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/map_test.dart (72%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/mixed_properties_and_additional_properties_class.dart (75%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model200_response.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model_client.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model_enum_class.dart (87%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model_file.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model_list.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/model_return.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/name.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/nullable_class.dart (81%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/number_only.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/object_with_deprecated_fields.dart (80%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive/lib/src/model/child.dart => dio/built_value/lib/src/model/one_of_primitive_child.dart} (65%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/order.dart (91%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_composite.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_enum.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_enum_default_value.dart (77%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_enum_integer.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_enum_integer_default_value.dart (83%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/outer_object_with_enum_property.dart (79%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/parent.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/pasta.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/pet.dart (94%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/pizza.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/lib/src/model/pizza_speziale.dart (92%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/read_only_first.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/single_ref_type.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/special_model_name.dart (79%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/tag.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/model/user.dart (96%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/lib/src/json_repository_base.dart => dio/built_value/lib/src/repository_base.dart} (66%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/lib/src/serializers.dart (62%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/pom.xml (92%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/pubspec.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/addressable_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/all_of_with_single_ref_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/animal_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/another_fake_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/api_response_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/test/apple_test.dart (99%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/array_of_array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/array_test_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/test/banana_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/bar_api_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/bar_create_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/bar_ref_or_value_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/bar_ref_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/bar_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/capitalization_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/cat_all_of_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/cat_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/category_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/class_model_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/deprecated_object_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/dog_all_of_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/dog_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/entity_ref_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/entity_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/enum_arrays_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/enum_test_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/extensible_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/fake_classname_tags123_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/file_schema_test_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/foo_api_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/test/foo_get_default_response_test.dart => dio/built_value/test/foo_basic_get_default_response_test.dart} (64%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/foo_ref_or_value_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/foo_ref_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/foo_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/format_test_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/built_value}/test/fruit_test.dart (99%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive/test/example_test.dart => dio/built_value/test/giga_one_of_test.dart} (74%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/has_only_read_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/health_check_result_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/map_test_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/model200_response_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/model_client_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/model_enum_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/model_file_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/model_list_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/model_return_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/name_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/nullable_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/object_with_deprecated_fields_test.dart (95%) rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive/test/child_test.dart => dio/built_value/test/one_of_primitive_child_test.dart} (67%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/order_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/outer_composite_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/outer_enum_default_value_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/outer_enum_integer_default_value_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/outer_enum_integer_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/outer_enum_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/outer_object_with_enum_property_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/pasta_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/pet_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/pizza_speziale_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/built_value}/test/pizza_test.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/read_only_first_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/built_value}/test/single_ref_type_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/special_model_name_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/store_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/tag_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/user_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/built_value}/test/user_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/.gitignore (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/README.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/pubspec.yaml (89%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/puby.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/api/authentication_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/api/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/api/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/api/store_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/api_util_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/model/date_serializer_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake_tests => dio/built_value_tests}/test/model/date_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/.gitignore (100%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/.openapi-generator-ignore (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/.openapi-generator/VERSION (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/README.md (73%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/build.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/AdditionalPropertiesClass.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/AllOfWithSingleRef.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Animal.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/AnotherFakeApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ApiResponse.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/ArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/ArrayTest.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/doc/DefaultApi.md => dio/json_serializable/doc/BarApi.md} (55%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md => dio/json_serializable/doc/BarRef.md} (90%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Capitalization.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Cat.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/CatAllOf.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Category.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/ClassModel.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/DeprecatedObject.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Dog.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/DogAllOf.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/EnumArrays.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/EnumTest.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/FakeApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/FakeClassnameTags123Api.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/FileSchemaTestClass.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake/doc/FooGetDefaultResponse.md => dio/json_serializable/doc/FooBasicGetDefaultResponse.md} (90%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/FormatTest.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md rename samples/openapi3/client/petstore/dart-dio/{oneof_primitive/doc/Child.md => dio/json_serializable/doc/GigaOneOf.md} (93%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/HasOnlyReadOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/HealthCheckResult.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/MapTest.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/Model200Response.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ModelClient.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ModelEnumClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ModelFile.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ModelList.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ModelReturn.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Name.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/NullableClass.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/NumberOnly.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/ObjectWithDeprecatedFields.md (90%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Order.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterComposite.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterEnum.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterEnumDefaultValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterEnumInteger.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/OuterObjectWithEnumProperty.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/Pet.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/PetApi.md (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/ReadOnlyFirst.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/SingleRefType.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/SpecialModelName.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/StoreApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/Tag.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/doc/User.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/doc/UserApi.md (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/apis.dart (81%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/lib/openapi.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/api/another_fake_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{oneof/lib/src/api/default_api.dart => dio/json_serializable/lib/src/api/bar_api.dart} (74%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/api/fake_api.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/lib/src/api/fake_classname_tags123_api.dart (88%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/api/pet_api.dart (86%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/api/store_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/api/user_api.dart (88%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/lib/src/api_client.dart (74%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/lib/src/auth/_exports.dart (83%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/json_serializable}/lib/src/auth/api_key_auth.dart (89%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/lib/src/auth/auth.dart (80%) rename samples/openapi3/client/petstore/dart-dio/{oneof => dio/json_serializable}/lib/src/auth/basic_auth.dart (70%) rename samples/openapi3/client/petstore/dart-dio/{oneof_polymorphism_and_inheritance => dio/json_serializable}/lib/src/auth/bearer_auth.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/auth/oauth.dart (82%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/additional_properties_class.dart (57%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/all_of_with_single_ref.dart (58%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/animal.dart (58%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/array_of_array_of_number_only.dart (64%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/array_of_number_only.dart (66%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/cat.dart (53%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/cat_all_of.dart (60%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/category.dart (52%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/class_model.dart (60%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/deprecated_object.dart (69%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/dog.dart (54%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/dog_all_of.dart (60%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/enum_arrays.dart (62%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/enum_test.dart (50%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/file_schema_test_class.dart (61%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/has_only_read_only.dart (60%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/health_check_result.dart (62%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model200_response.dart (58%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model_client.dart (60%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model_enum_class.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model_file.dart (57%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model_list.dart (60%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/model_return.dart (60%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/number_only.dart (59%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/object_with_deprecated_fields.dart (53%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/outer_enum.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/outer_enum_default_value.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/outer_enum_integer.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/outer_enum_integer_default_value.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/outer_object_with_enum_property.dart (69%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/read_only_first.dart (53%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/single_ref_type.dart (99%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/special_model_name.dart (56%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/lib/src/model/tag.dart (60%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart => dio/json_serializable/lib/src/repository_base.dart} (66%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/pom.xml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/pubspec.yaml (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/additional_properties_class_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/all_of_with_single_ref_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/animal_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/another_fake_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/api_response_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/array_of_array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/array_test_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/capitalization_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/cat_all_of_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/cat_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/category_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/class_model_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/deprecated_object_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/dog_all_of_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/dog_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/enum_arrays_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/enum_test_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/fake_classname_tags123_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/file_schema_test_class_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart => dio/json_serializable/test/foo_basic_get_default_response_test.dart} (56%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/format_test_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/has_only_read_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/health_check_result_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/map_test_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/model200_response_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/model_client_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/model_enum_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/model_file_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/model_list_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/model_return_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/name_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/nullable_class_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/number_only_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/object_with_deprecated_fields_test.dart (96%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/order_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/outer_composite_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/outer_enum_default_value_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/outer_enum_integer_default_value_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/outer_enum_integer_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/outer_enum_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/outer_object_with_enum_property_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/pet_test.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/read_only_first_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake => dio/json_serializable}/test/single_ref_type_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/special_model_name_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/store_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/tag_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/user_api_test.dart (100%) rename samples/openapi3/client/petstore/dart-dio/{petstore_client_lib_fake-json_serializable => dio/json_serializable}/test/user_test.dart (100%) delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart diff --git a/bin/configs/dart-dio-built_value-v3.yaml b/bin/configs/dart-dio-built_value-v3.yaml new file mode 100644 index 000000000000..b68fe1267488 --- /dev/null +++ b/bin/configs/dart-dio-built_value-v3.yaml @@ -0,0 +1,15 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/dio/built_value +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml +templateDir: modules/openapi-generator/src/main/resources/dart +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + library: dio + serializationLibrary: built_value +reservedWordsMappings: + class: "classField" diff --git a/bin/configs/dart-dio-json_serializable-v3.yaml b/bin/configs/dart-dio-json_serializable-v3.yaml new file mode 100644 index 000000000000..c9435a24e001 --- /dev/null +++ b/bin/configs/dart-dio-json_serializable-v3.yaml @@ -0,0 +1,13 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/dio/json_serializable +inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml +templateDir: modules/openapi-generator/src/main/resources/dart +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + library: dio + serializationLibrary: json_serializable diff --git a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml deleted file mode 100644 index d3d5b622bc0f..000000000000 --- a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof-primitive.yaml b/bin/configs/dart-dio-oneof-primitive.yaml deleted file mode 100644 index 29130b5dc468..000000000000 --- a/bin/configs/dart-dio-oneof-primitive.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof_primitive -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof.yaml b/bin/configs/dart-dio-oneof.yaml deleted file mode 100644 index 865312cdd493..000000000000 --- a/bin/configs/dart-dio-oneof.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/oneof -inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml b/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml deleted file mode 100644 index 9809a61d7a00..000000000000 --- a/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml +++ /dev/null @@ -1,12 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" - serializationLibrary: "json_serializable" diff --git a/bin/configs/dart-dio-petstore-client-lib-fake.yaml b/bin/configs/dart-dio-petstore-client-lib-fake.yaml deleted file mode 100644 index 3faed9515af8..000000000000 --- a/bin/configs/dart-dio-petstore-client-lib-fake.yaml +++ /dev/null @@ -1,13 +0,0 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - enumUnknownDefaultCase: "true" -reservedWordsMappings: - class: "classField" diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore b/samples/openapi3/client/petstore/dart-dio/dio/built_value/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/.gitignore rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES new file mode 100644 index 000000000000..c9a0229c88b9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES @@ -0,0 +1,246 @@ +.gitignore +README.md +analysis_options.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/Apple.md +doc/AppleAllOfDisc.md +doc/AppleAnyOfDisc.md +doc/AppleGrandparentDisc.md +doc/AppleOneOfDisc.md +doc/AppleReqDisc.md +doc/AppleVariant1.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/BananaAllOfDisc.md +doc/BananaAnyOfDisc.md +doc/BananaGrandparentDisc.md +doc/BananaOneOfDisc.md +doc/BananaReqDisc.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/ClassModel.md +doc/ComposedDiscMissingFromProperties.md +doc/ComposedDiscOptionalTypeCorrect.md +doc/ComposedDiscOptionalTypeInconsistent.md +doc/ComposedDiscOptionalTypeIncorrect.md +doc/ComposedDiscRequiredInconsistent.md +doc/ComposedDiscTypeInconsistent.md +doc/ComposedDiscTypeIncorrect.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/DiscMissingFromProperties.md +doc/DiscOptionalTypeCorrect.md +doc/DiscOptionalTypeIncorrect.md +doc/DiscTypeIncorrect.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Extensible.md +doc/FakeApi.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooApi.md +doc/FooBasicGetDefaultResponse.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.md +doc/FruitAllOfDisc.md +doc/FruitAnyOfDisc.md +doc/FruitGrandparentDisc.md +doc/FruitInlineDisc.md +doc/FruitInlineDiscOneOf.md +doc/FruitInlineDiscOneOf1.md +doc/FruitInlineInlineDisc.md +doc/FruitInlineInlineDiscOneOf.md +doc/FruitInlineInlineDiscOneOf1.md +doc/FruitInlineInlineDiscOneOfOneOf.md +doc/FruitOneOfDisc.md +doc/FruitReqDisc.md +doc/FruitType.md +doc/FruitVariant1.md +doc/GigaOneOf.md +doc/GrapeVariant1.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/OneOfPrimitiveChild.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Parent.md +doc/Pasta.md +doc/Pet.md +doc/PetApi.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +lib/apis.dart +lib/models.dart +lib/openapi.dart +lib/src/api/another_fake_api.dart +lib/src/api/bar_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/foo_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/api_client.dart +lib/src/api_util.dart +lib/src/auth/_exports.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.dart +lib/src/model/apple_all_of_disc.dart +lib/src/model/apple_any_of_disc.dart +lib/src/model/apple_grandparent_disc.dart +lib/src/model/apple_one_of_disc.dart +lib/src/model/apple_req_disc.dart +lib/src/model/apple_variant1.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/banana.dart +lib/src/model/banana_all_of_disc.dart +lib/src/model/banana_any_of_disc.dart +lib/src/model/banana_grandparent_disc.dart +lib/src/model/banana_one_of_disc.dart +lib/src/model/banana_req_disc.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/composed_disc_missing_from_properties.dart +lib/src/model/composed_disc_optional_type_correct.dart +lib/src/model/composed_disc_optional_type_inconsistent.dart +lib/src/model/composed_disc_optional_type_incorrect.dart +lib/src/model/composed_disc_required_inconsistent.dart +lib/src/model/composed_disc_type_inconsistent.dart +lib/src/model/composed_disc_type_incorrect.dart +lib/src/model/date.dart +lib/src/model/deprecated_object.dart +lib/src/model/disc_missing_from_properties.dart +lib/src/model/disc_optional_type_correct.dart +lib/src/model/disc_optional_type_incorrect.dart +lib/src/model/disc_type_incorrect.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_basic_get_default_response.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.dart +lib/src/model/fruit_all_of_disc.dart +lib/src/model/fruit_any_of_disc.dart +lib/src/model/fruit_grandparent_disc.dart +lib/src/model/fruit_inline_disc.dart +lib/src/model/fruit_inline_disc_one_of.dart +lib/src/model/fruit_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc.dart +lib/src/model/fruit_inline_inline_disc_one_of.dart +lib/src/model/fruit_inline_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart +lib/src/model/fruit_one_of_disc.dart +lib/src/model/fruit_req_disc.dart +lib/src/model/fruit_type.dart +lib/src/model/fruit_variant1.dart +lib/src/model/giga_one_of.dart +lib/src/model/grape_variant1.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/one_of_primitive_child.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/parent.dart +lib/src/model/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md similarity index 73% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md index 17d711efe34e..f10ccbb6dff2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md @@ -65,7 +65,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- [*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic | +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive | +[*DefaultApi*](doc/DefaultApi.md) | [**oneofGet**](doc/DefaultApi.md#oneofget) | **GET** /oneof | +[*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 | [*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | @@ -84,6 +90,8 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | [*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos [*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store [*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet [*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -110,26 +118,77 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) - [Animal](doc/Animal.md) - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [AppleAllOfDisc](doc/AppleAllOfDisc.md) + - [AppleAnyOfDisc](doc/AppleAnyOfDisc.md) + - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) + - [AppleOneOfDisc](doc/AppleOneOfDisc.md) + - [AppleReqDisc](doc/AppleReqDisc.md) + - [AppleVariant1](doc/AppleVariant1.md) - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [BananaAllOfDisc](doc/BananaAllOfDisc.md) + - [BananaAnyOfDisc](doc/BananaAnyOfDisc.md) + - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) + - [BananaOneOfDisc](doc/BananaOneOfDisc.md) + - [BananaReqDisc](doc/BananaReqDisc.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) - [Capitalization](doc/Capitalization.md) - [Cat](doc/Cat.md) - [CatAllOf](doc/CatAllOf.md) - [Category](doc/Category.md) - [ClassModel](doc/ClassModel.md) + - [ComposedDiscMissingFromProperties](doc/ComposedDiscMissingFromProperties.md) + - [ComposedDiscOptionalTypeCorrect](doc/ComposedDiscOptionalTypeCorrect.md) + - [ComposedDiscOptionalTypeInconsistent](doc/ComposedDiscOptionalTypeInconsistent.md) + - [ComposedDiscOptionalTypeIncorrect](doc/ComposedDiscOptionalTypeIncorrect.md) + - [ComposedDiscRequiredInconsistent](doc/ComposedDiscRequiredInconsistent.md) + - [ComposedDiscTypeInconsistent](doc/ComposedDiscTypeInconsistent.md) + - [ComposedDiscTypeIncorrect](doc/ComposedDiscTypeIncorrect.md) - [DeprecatedObject](doc/DeprecatedObject.md) + - [DiscMissingFromProperties](doc/DiscMissingFromProperties.md) + - [DiscOptionalTypeCorrect](doc/DiscOptionalTypeCorrect.md) + - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) + - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) - [Dog](doc/Dog.md) - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) - [EnumArrays](doc/EnumArrays.md) - [EnumTest](doc/EnumTest.md) + - [Extensible](doc/Extensible.md) - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - [Foo](doc/Foo.md) - - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.md) + - [FruitAllOfDisc](doc/FruitAllOfDisc.md) + - [FruitAnyOfDisc](doc/FruitAnyOfDisc.md) + - [FruitGrandparentDisc](doc/FruitGrandparentDisc.md) + - [FruitInlineDisc](doc/FruitInlineDisc.md) + - [FruitInlineDiscOneOf](doc/FruitInlineDiscOneOf.md) + - [FruitInlineDiscOneOf1](doc/FruitInlineDiscOneOf1.md) + - [FruitInlineInlineDisc](doc/FruitInlineInlineDisc.md) + - [FruitInlineInlineDiscOneOf](doc/FruitInlineInlineDiscOneOf.md) + - [FruitInlineInlineDiscOneOf1](doc/FruitInlineInlineDiscOneOf1.md) + - [FruitInlineInlineDiscOneOfOneOf](doc/FruitInlineInlineDiscOneOfOneOf.md) + - [FruitOneOfDisc](doc/FruitOneOfDisc.md) + - [FruitReqDisc](doc/FruitReqDisc.md) + - [FruitType](doc/FruitType.md) + - [FruitVariant1](doc/FruitVariant1.md) + - [GigaOneOf](doc/GigaOneOf.md) + - [GrapeVariant1](doc/GrapeVariant1.md) - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - [HealthCheckResult](doc/HealthCheckResult.md) - [MapTest](doc/MapTest.md) @@ -144,6 +203,7 @@ Class | Method | HTTP request | Description - [NullableClass](doc/NullableClass.md) - [NumberOnly](doc/NumberOnly.md) - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [OneOfPrimitiveChild](doc/OneOfPrimitiveChild.md) - [Order](doc/Order.md) - [OuterComposite](doc/OuterComposite.md) - [OuterEnum](doc/OuterEnum.md) @@ -151,7 +211,11 @@ Class | Method | HTTP request | Description - [OuterEnumInteger](doc/OuterEnumInteger.md) - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Parent](doc/Parent.md) + - [Pasta](doc/Pasta.md) - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Addressable.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Addressable.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Animal.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Apple.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md new file mode 100644 index 000000000000..0e7d4c990e48 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md new file mode 100644 index 000000000000..b49ab2f0fe8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md new file mode 100644 index 000000000000..41bb14fd764b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md new file mode 100644 index 000000000000..85eeb8a99eea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md new file mode 100644 index 000000000000..262c02ab50eb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleVariant1.md similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleVariant1.md index 97240f9bce11..82de5e6a492a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleVariant1.md @@ -1,4 +1,4 @@ -# openapi.model.Foo +# openapi.model.AppleVariant1 ## Load the model package ```dart @@ -8,7 +8,7 @@ import 'package:openapi/openapi.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [default to 'bar'] +**kind** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Banana.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md new file mode 100644 index 000000000000..668b2bf1af02 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md new file mode 100644 index 000000000000..8468888bf7e1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md new file mode 100644 index 000000000000..81bbb6cb54a6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md new file mode 100644 index 000000000000..951cc5839179 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md new file mode 100644 index 000000000000..574a3383916b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Bar.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarApi.md similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarApi.md index 03dffa412100..16e6c66fcc10 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarApi.md @@ -5,7 +5,7 @@ import 'package:openapi/openapi.dart'; ``` -All URIs are relative to *http://localhost:8080* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarCreate.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarCreate.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Cat.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Category.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Category.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md new file mode 100644 index 000000000000..4137cc1a0add --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..ab27d1c4473a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md new file mode 100644 index 000000000000..8c32b4c72b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..4f0fab65accc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md new file mode 100644 index 000000000000..bc60f26b183c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscRequiredInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md new file mode 100644 index 000000000000..0cdb9b880b9f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeIncorrect.md similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeIncorrect.md index 97240f9bce11..8000df558df6 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeIncorrect.md @@ -1,4 +1,4 @@ -# openapi.model.Foo +# openapi.model.ComposedDiscTypeIncorrect ## Load the model package ```dart @@ -8,7 +8,7 @@ import 'package:openapi/openapi.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [default to 'bar'] +**fruitType** | **int** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md new file mode 100644 index 000000000000..3834af5d03ff --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md @@ -0,0 +1,244 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/openapi.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooBasicGet**](DefaultApi.md#foobasicget) | **GET** /foo-basic | +[**list**](DefaultApi.md#list) | **GET** /oneof-primitive | +[**oneofGet**](DefaultApi.md#oneofget) | **GET** /oneof | +[**test**](DefaultApi.md#test) | **PUT** /variant1 | +[**variant1Get**](DefaultApi.md#variant1get) | **GET** /variant1 | +[**variant2Get**](DefaultApi.md#variant2get) | **GET** /variant2 | + + +# **fooBasicGet** +> FooBasicGetDefaultResponse fooBasicGet() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooBasicGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->fooBasicGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooBasicGetDefaultResponse**](FooBasicGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list** +> GigaOneOf list() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GigaOneOf**](GigaOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **oneofGet** +> Fruit oneofGet() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.oneofGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->oneofGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test** +> test(body) + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); +final JsonObject body = ; // JsonObject | + +try { + api.test(body); +} catch on DioError (e) { + print('Exception when calling DefaultApi->test: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **JsonObject**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant1Get** +> FruitVariant1 variant1Get() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant1Get(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->variant1Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitVariant1**](FruitVariant1.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant2Get** +> FruitAllOfDisc variant2Get() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant2Get(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->variant2Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitAllOfDisc**](FruitAllOfDisc.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md new file mode 100644 index 000000000000..c38a5c2b5226 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.DiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..38601f552917 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..b6787edea47b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md new file mode 100644 index 000000000000..519a8e0333e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Dog.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Entity.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Entity.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EntityRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EntityRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Extensible.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Extensible.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Foo.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooApi.md similarity index 97% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooApi.md index 9d9f869e7ee0..53fb4c208ea6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooApi.md @@ -5,7 +5,7 @@ import 'package:openapi/openapi.dart'; ``` -All URIs are relative to *http://localhost:8080* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooBasicGetDefaultResponse.md similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooBasicGetDefaultResponse.md index baf746b7dc5a..504630ea31a9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooBasicGetDefaultResponse.md @@ -1,4 +1,4 @@ -# openapi.model.FooGetDefaultResponse +# openapi.model.FooBasicGetDefaultResponse ## Load the model package ```dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Fruit.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md new file mode 100644 index 000000000000..f63fe99752c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md new file mode 100644 index 000000000000..c77b16556c53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md new file mode 100644 index 000000000000..ce9687bf5a6a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md new file mode 100644 index 000000000000..634614481813 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitInlineDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md new file mode 100644 index 000000000000..c842f7706c46 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md new file mode 100644 index 000000000000..2ab55f905a67 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md new file mode 100644 index 000000000000..a94f2de1f3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md new file mode 100644 index 000000000000..511b8519164e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md new file mode 100644 index 000000000000..59d09becd314 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md new file mode 100644 index 000000000000..5267793720af --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDiscOneOfOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md new file mode 100644 index 000000000000..98c529e8c203 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md new file mode 100644 index 000000000000..6ed06ec95a84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md new file mode 100644 index 000000000000..a5ac48ebfcef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md @@ -0,0 +1,15 @@ +# openapi.model.FruitType + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md new file mode 100644 index 000000000000..f56649903b0f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitVariant1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GigaOneOf.md similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GigaOneOf.md index 3a81137a5a9b..c4148a9477f6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GigaOneOf.md @@ -1,4 +1,4 @@ -# openapi.model.Example +# openapi.model.GigaOneOf ## Load the model package ```dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md new file mode 100644 index 000000000000..ac6637c2a1c9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md @@ -0,0 +1,15 @@ +# openapi.model.GrapeVariant1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ObjectWithDeprecatedFields.md similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ObjectWithDeprecatedFields.md index 45b46abcf65d..97a6433501e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ObjectWithDeprecatedFields.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **uuid** | **String** | | [optional] **id** | **num** | | [optional] **deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | **BuiltList<String>** | | [optional] +**bars** | [**BuiltList<Bar>**](Bar.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md new file mode 100644 index 000000000000..cb1eec1c5b7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md @@ -0,0 +1,15 @@ +# openapi.model.OneOfPrimitiveChild + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md new file mode 100644 index 000000000000..cb343a1e4f5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md @@ -0,0 +1,15 @@ +# openapi.model.Parent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pasta.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pasta.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pizza.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pizza.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PizzaSpeziale.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PizzaSpeziale.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/apis.dart similarity index 81% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/apis.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/apis.dart index 21c64ae9bd39..4facc7ca3861 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/apis.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/apis.dart @@ -1,8 +1,10 @@ export 'package:openapi/src/api_client.dart'; export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/bar_api.dart'; export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/api/fake_api.dart'; export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; export 'package:openapi/src/api/pet_api.dart'; export 'package:openapi/src/api/store_api.dart'; export 'package:openapi/src/api/user_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart new file mode 100644 index 000000000000..00f307146d5c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart @@ -0,0 +1,109 @@ +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/date_serializer.dart'; +export 'package:openapi/src/model/date.dart'; +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/apple_all_of_disc.dart'; +export 'package:openapi/src/model/apple_any_of_disc.dart'; +export 'package:openapi/src/model/apple_grandparent_disc.dart'; +export 'package:openapi/src/model/apple_one_of_disc.dart'; +export 'package:openapi/src/model/apple_req_disc.dart'; +export 'package:openapi/src/model/apple_variant1.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/banana_all_of_disc.dart'; +export 'package:openapi/src/model/banana_any_of_disc.dart'; +export 'package:openapi/src/model/banana_grandparent_disc.dart'; +export 'package:openapi/src/model/banana_one_of_disc.dart'; +export 'package:openapi/src/model/banana_req_disc.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_correct.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/composed_disc_required_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_incorrect.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/disc_missing_from_properties.dart'; +export 'package:openapi/src/model/disc_optional_type_correct.dart'; +export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/disc_type_incorrect.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_basic_get_default_response.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/fruit.dart'; +export 'package:openapi/src/model/fruit_all_of_disc.dart'; +export 'package:openapi/src/model/fruit_any_of_disc.dart'; +export 'package:openapi/src/model/fruit_grandparent_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +export 'package:openapi/src/model/fruit_one_of_disc.dart'; +export 'package:openapi/src/model/fruit_req_disc.dart'; +export 'package:openapi/src/model/fruit_type.dart'; +export 'package:openapi/src/model/fruit_variant1.dart'; +export 'package:openapi/src/model/giga_one_of.dart'; +export 'package:openapi/src/model/grape_variant1.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/one_of_primitive_child.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/parent.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/openapi.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/openapi.dart index 6c3dbb746aa8..1865b320d1b4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/openapi.dart @@ -2,7 +2,6 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart index 47ff15f3cfcc..e39fc0a1d7f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class AnotherFakeApi { - - final AnotherFakeApiRaw _rawApi; + final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; - const AnotherFakeApi(this._rawApi, this._repository); + const AnotherFakeApi(this.rawApi, this._repository); /// To test special tags /// To test special tags and operation ID starting with number @@ -29,7 +29,7 @@ class AnotherFakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -37,13 +37,11 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.call123testSpecialTags( - + final _response = await rawApi.call123testSpecialTags( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -52,16 +50,18 @@ class AnotherFakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -83,11 +83,9 @@ class AnotherFakeApi { extra: _response.extra, ); } - } class AnotherFakeApiRaw { - final Dio _dio; const AnotherFakeApiRaw(this._dio); @@ -106,10 +104,11 @@ class AnotherFakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -129,6 +128,7 @@ class AnotherFakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -141,7 +141,4 @@ class AnotherFakeApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart index 024a0430400b..dff1f1dd4090 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart @@ -5,22 +5,22 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/bar.dart'; import 'package:openapi/src/model/bar_create.dart'; class BarApi { - - final BarApiRaw _rawApi; + final BarApiRaw rawApi; final SerializationRepositoryBase _repository; - const BarApi(this._rawApi, this._repository); + const BarApi(this.rawApi, this._repository); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -30,7 +30,7 @@ class BarApi { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioError] if API call or serialization fails - Future> createBar({ + Future> createBar({ required BarCreate barCreate, CancelToken? cancelToken, Map? headers, @@ -38,13 +38,11 @@ class BarApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(barCreate, const TypeInfo(BarCreate)); - final _response = await _rawApi.createBar( - + final _response = await rawApi.createBar( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -53,16 +51,18 @@ class BarApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Bar? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Bar), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Bar), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -84,20 +84,18 @@ class BarApi { extra: _response.extra, ); } - } class BarApiRaw { - final Dio _dio; const BarApiRaw(this._dio); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -107,10 +105,11 @@ class BarApiRaw { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioError] if API call or serialization fails - Future> createBar({ + Future> createBar({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -130,6 +129,7 @@ class BarApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -142,7 +142,4 @@ class BarApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart new file mode 100644 index 000000000000..52184533e3e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart @@ -0,0 +1,685 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; +import 'package:dio/dio.dart'; +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/models.dart'; +import 'package:built_value/json_object.dart'; +import 'package:openapi/src/model/foo_basic_get_default_response.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/fruit_all_of_disc.dart'; +import 'package:openapi/src/model/fruit_variant1.dart'; +import 'package:openapi/src/model/giga_one_of.dart'; + +class DefaultApi { + final DefaultApiRaw rawApi; + final SerializationRepositoryBase _repository; + + const DefaultApi(this.rawApi, this._repository); + + /// fooBasicGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> fooBasicGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.fooBasicGet( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooBasicGetDefaultResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FooBasicGetDefaultResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data + /// Throws [DioError] if API call or serialization fails + Future> list({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.list( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + GigaOneOf? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(GigaOneOf), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// oneofGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioError] if API call or serialization fails + Future> oneofGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.oneofGet( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Fruit? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Fruit), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test + /// + /// + /// Parameters: + /// * [body] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> test({ + JsonObject? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + Object? _bodyData; + _bodyData = body; + + final _response = await rawApi.test( + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// variant1Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data + /// Throws [DioError] if API call or serialization fails + Future> variant1Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.variant1Get( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitVariant1? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FruitVariant1), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// variant2Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data + /// Throws [DioError] if API call or serialization fails + Future> variant2Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.variant2Get( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitAllOfDisc? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FruitAllOfDisc), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} + +class DefaultApiRaw { + final Dio _dio; + + const DefaultApiRaw(this._dio); + + /// fooBasicGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> fooBasicGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo-basic'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data + /// Throws [DioError] if API call or serialization fails + Future> list({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof-primitive'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// oneofGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioError] if API call or serialization fails + Future> oneofGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// test + /// + /// + /// Parameters: + /// * [body] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> test({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'PUT', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// variant1Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data + /// Throws [DioError] if API call or serialization fails + Future> variant1Get({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// variant2Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data + /// Throws [DioError] if API call or serialization fails + Future> variant2Get({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant2'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart index 1a849fdc085c..55f31dc05f8c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -19,14 +20,13 @@ import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { - - final FakeApiRaw _rawApi; + final FakeApiRaw rawApi; final SerializationRepositoryBase _repository; - const FakeApi(this._rawApi, this._repository); + const FakeApi(this.rawApi, this._repository); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -38,34 +38,33 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.fakeHealthGet( - - + }) async { + final _response = await rawApi.fakeHealthGet( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(HealthCheckResult), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(HealthCheckResult), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -89,7 +88,7 @@ class FakeApi { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -104,7 +103,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ required Pet pet, String? query1, String? header1, @@ -114,15 +113,21 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.fakeHttpSignatureTest( - - query1: query1 == null ? null : _repository.encodeQueryParameter(query1, const TypeInfo(String)) , - header1: header1 == null ? null : _repository.encodeStringParameter(header1, const TypeInfo(String)) , + final _response = await rawApi.fakeHttpSignatureTest( + query1: query1 == null + ? null + : encodeQueryParameter( + _repository, + query1, + const TypeInfo(String), + ), + header1: header1 == null + ? null + : _repository.serialize(header1, const TypeInfo(String)).toString(), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -131,7 +136,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -150,7 +155,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ bool? body, CancelToken? cancelToken, Map? headers, @@ -158,13 +163,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterBooleanSerialize( - + final _response = await rawApi.fakeOuterBooleanSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -173,16 +176,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(bool), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(bool), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -219,7 +224,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ OuterComposite? outerComposite, CancelToken? cancelToken, Map? headers, @@ -227,13 +232,13 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = outerComposite == null ? null : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); + _bodyData = outerComposite == null + ? null + : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); - final _response = await _rawApi.fakeOuterCompositeSerialize( - + final _response = await rawApi.fakeOuterCompositeSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -242,16 +247,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(OuterComposite), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(OuterComposite), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -288,7 +295,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ num? body, CancelToken? cancelToken, Map? headers, @@ -296,13 +303,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterNumberSerialize( - + final _response = await rawApi.fakeOuterNumberSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -311,16 +316,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); num? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(num), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(num), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -357,7 +364,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ String? body, CancelToken? cancelToken, Map? headers, @@ -365,13 +372,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterStringSerialize( - + final _response = await rawApi.fakeOuterStringSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -380,16 +385,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -426,7 +433,8 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + Future> + fakePropertyEnumIntegerSerialize({ required OuterObjectWithEnumProperty outerObjectWithEnumProperty, CancelToken? cancelToken, Map? headers, @@ -434,13 +442,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(outerObjectWithEnumProperty, const TypeInfo(OuterObjectWithEnumProperty)); + _bodyData = _repository.serialize(outerObjectWithEnumProperty, + const TypeInfo(OuterObjectWithEnumProperty)); - final _response = await _rawApi.fakePropertyEnumIntegerSerialize( - + final _response = await rawApi.fakePropertyEnumIntegerSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -449,16 +456,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterObjectWithEnumProperty? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(OuterObjectWithEnumProperty), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(OuterObjectWithEnumProperty), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -495,7 +504,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ MultipartFile? body, CancelToken? cancelToken, Map? headers, @@ -503,13 +512,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body?.finalize(); - final _response = await _rawApi.testBodyWithBinary( - + final _response = await rawApi.testBodyWithBinary( body: _bodyData, requestContentType: 'image/png', cancelToken: cancelToken, @@ -518,7 +525,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -527,7 +534,7 @@ class FakeApi { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -537,7 +544,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ required FileSchemaTestClass fileSchemaTestClass, CancelToken? cancelToken, Map? headers, @@ -545,13 +552,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + _bodyData = _repository.serialize( + fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); - final _response = await _rawApi.testBodyWithFileSchema( - + final _response = await rawApi.testBodyWithFileSchema( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -560,17 +566,17 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -580,7 +586,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required String query, required User user, CancelToken? cancelToken, @@ -589,14 +595,16 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.testBodyWithQueryParams( - - query: _repository.encodeQueryParameter(query, const TypeInfo(String)) , + final _response = await rawApi.testBodyWithQueryParams( + query: encodeQueryParameter( + _repository, + query, + const TypeInfo(String), + ), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -605,7 +613,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -624,7 +632,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -632,13 +640,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.testClientModel( - + final _response = await rawApi.testClientModel( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -647,16 +653,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -679,8 +687,8 @@ class FakeApi { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -706,7 +714,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ required num number, required double double_, required String patternWithoutDelimiter, @@ -727,28 +735,45 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (integer != null) r'integer': _repository.encodeFormParameter(integer, const TypeInfo(int)), - if (int32 != null) r'int32': _repository.encodeFormParameter(int32, const TypeInfo(int)), - if (int64 != null) r'int64': _repository.encodeFormParameter(int64, const TypeInfo(int)), - r'number': _repository.encodeFormParameter(number, const TypeInfo(num)), - if (float != null) r'float': _repository.encodeFormParameter(float, const TypeInfo(double)), - r'double': _repository.encodeFormParameter(double_, const TypeInfo(double)), - if (string != null) r'string': _repository.encodeFormParameter(string, const TypeInfo(String)), - r'pattern_without_delimiter': _repository.encodeFormParameter(patternWithoutDelimiter, const TypeInfo(String)), - r'byte': _repository.encodeFormParameter(byte, const TypeInfo(String)), - if (binary != null) r'binary': _repository.encodeFormParameter(binary, const TypeInfo(Uint8List)), - if (date != null) r'date': _repository.encodeFormParameter(date, const TypeInfo(Date)), - if (dateTime != null) r'dateTime': _repository.encodeFormParameter(dateTime, const TypeInfo(DateTime)), - if (password != null) r'password': _repository.encodeFormParameter(password, const TypeInfo(String)), - if (callback != null) r'callback': _repository.encodeFormParameter(callback, const TypeInfo(String)), + if (integer != null) + r'integer': + encodeFormParameter(_repository, integer, const TypeInfo(int)), + if (int32 != null) + r'int32': encodeFormParameter(_repository, int32, const TypeInfo(int)), + if (int64 != null) + r'int64': encodeFormParameter(_repository, int64, const TypeInfo(int)), + r'number': encodeFormParameter(_repository, number, const TypeInfo(num)), + if (float != null) + r'float': + encodeFormParameter(_repository, float, const TypeInfo(double)), + r'double': + encodeFormParameter(_repository, double_, const TypeInfo(double)), + if (string != null) + r'string': + encodeFormParameter(_repository, string, const TypeInfo(String)), + r'pattern_without_delimiter': encodeFormParameter( + _repository, patternWithoutDelimiter, const TypeInfo(String)), + r'byte': encodeFormParameter(_repository, byte, const TypeInfo(String)), + if (binary != null) + r'binary': + encodeFormParameter(_repository, binary, const TypeInfo(Uint8List)), + if (date != null) + r'date': encodeFormParameter(_repository, date, const TypeInfo(Date)), + if (dateTime != null) + r'dateTime': encodeFormParameter( + _repository, dateTime, const TypeInfo(DateTime)), + if (password != null) + r'password': + encodeFormParameter(_repository, password, const TypeInfo(String)), + if (callback != null) + r'callback': + encodeFormParameter(_repository, callback, const TypeInfo(String)), }; - final _response = await _rawApi.testEndpointParameters( - + final _response = await rawApi.testEndpointParameters( body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -757,7 +782,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -772,7 +797,7 @@ class FakeApi { /// * [enumQueryString] - Query parameter enum test (string) /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] + /// * [enumQueryModelArray] /// * [enumFormStringArray] - Form parameter enum test (string array) /// * [enumFormString] - Form parameter enum test (string) /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -784,7 +809,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ BuiltList? enumHeaderStringArray, String? enumHeaderString = '-efg', BuiltList? enumQueryStringArray, @@ -800,23 +825,68 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': _repository.encodeFormParameter(enumFormStringArray, const TypeInfo(String, [const TypeInfo(String)])), - if (enumFormString != null) r'enum_form_string': _repository.encodeFormParameter(enumFormString, const TypeInfo(String)), + if (enumFormStringArray != null) + r'enum_form_string_array': encodeFormParameter( + _repository, + enumFormStringArray, + const TypeInfo(String, [const TypeInfo(String)])), + if (enumFormString != null) + r'enum_form_string': encodeFormParameter( + _repository, enumFormString, const TypeInfo(String)), }; - final _response = await _rawApi.testEnumParameters( - - enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository.encodeStringParameter(enumHeaderStringArray, const TypeInfo(String, [const TypeInfo(String)])) , - enumHeaderString: enumHeaderString == null ? null : _repository.encodeStringParameter(enumHeaderString, const TypeInfo(String)) , - enumQueryStringArray: enumQueryStringArray == null ? null : _repository.encodeQueryParameter(enumQueryStringArray, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , - enumQueryString: enumQueryString == null ? null : _repository.encodeQueryParameter(enumQueryString, const TypeInfo(String)) , - enumQueryInteger: enumQueryInteger == null ? null : _repository.encodeQueryParameter(enumQueryInteger, const TypeInfo(int)) , - enumQueryDouble: enumQueryDouble == null ? null : _repository.encodeQueryParameter(enumQueryDouble, const TypeInfo(double)) , - enumQueryModelArray: enumQueryModelArray == null ? null : _repository.encodeQueryParameter(enumQueryModelArray, const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), context: ListFormat.multi) , + final _response = await rawApi.testEnumParameters( + enumHeaderStringArray: enumHeaderStringArray == null + ? null + : _repository + .serialize(enumHeaderStringArray, + const TypeInfo(String, [const TypeInfo(String)])) + .toString(), + enumHeaderString: enumHeaderString == null + ? null + : _repository + .serialize(enumHeaderString, const TypeInfo(String)) + .toString(), + enumQueryStringArray: enumQueryStringArray == null + ? null + : encodeQueryParameter( + _repository, + enumQueryStringArray, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.multi, + ), + enumQueryString: enumQueryString == null + ? null + : encodeQueryParameter( + _repository, + enumQueryString, + const TypeInfo(String), + ), + enumQueryInteger: enumQueryInteger == null + ? null + : encodeQueryParameter( + _repository, + enumQueryInteger, + const TypeInfo(int), + ), + enumQueryDouble: enumQueryDouble == null + ? null + : encodeQueryParameter( + _repository, + enumQueryDouble, + const TypeInfo(double), + ), + enumQueryModelArray: enumQueryModelArray == null + ? null + : encodeQueryParameter( + _repository, + enumQueryModelArray, + const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), + format: ListFormat.multi, + ), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -825,7 +895,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -849,7 +919,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required int requiredStringGroup, required bool requiredBooleanGroup, required int requiredInt64Group, @@ -862,30 +932,53 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.testGroupParameters( - - requiredStringGroup: _repository.encodeQueryParameter(requiredStringGroup, const TypeInfo(int)) , - requiredBooleanGroup: _repository.encodeStringParameter(requiredBooleanGroup, const TypeInfo(bool)) , - requiredInt64Group: _repository.encodeQueryParameter(requiredInt64Group, const TypeInfo(int)) , - stringGroup: stringGroup == null ? null : _repository.encodeQueryParameter(stringGroup, const TypeInfo(int)) , - booleanGroup: booleanGroup == null ? null : _repository.encodeStringParameter(booleanGroup, const TypeInfo(bool)) , - int64Group: int64Group == null ? null : _repository.encodeQueryParameter(int64Group, const TypeInfo(int)) , - + }) async { + final _response = await rawApi.testGroupParameters( + requiredStringGroup: encodeQueryParameter( + _repository, + requiredStringGroup, + const TypeInfo(int), + ), + requiredBooleanGroup: _repository + .serialize(requiredBooleanGroup, const TypeInfo(bool)) + .toString(), + requiredInt64Group: encodeQueryParameter( + _repository, + requiredInt64Group, + const TypeInfo(int), + ), + stringGroup: stringGroup == null + ? null + : encodeQueryParameter( + _repository, + stringGroup, + const TypeInfo(int), + ), + booleanGroup: booleanGroup == null + ? null + : _repository + .serialize(booleanGroup, const TypeInfo(bool)) + .toString(), + int64Group: int64Group == null + ? null + : encodeQueryParameter( + _repository, + int64Group, + const TypeInfo(int), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -898,7 +991,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ required BuiltMap requestBody, CancelToken? cancelToken, Map? headers, @@ -906,13 +999,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(requestBody, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + _bodyData = _repository.serialize(requestBody, + const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); - final _response = await _rawApi.testInlineAdditionalProperties( - + final _response = await rawApi.testInlineAdditionalProperties( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -921,13 +1013,13 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -941,7 +1033,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ required String param, required String param2, CancelToken? cancelToken, @@ -950,16 +1042,15 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - r'param': _repository.encodeFormParameter(param, const TypeInfo(String)), - r'param2': _repository.encodeFormParameter(param2, const TypeInfo(String)), + r'param': encodeFormParameter(_repository, param, const TypeInfo(String)), + r'param2': + encodeFormParameter(_repository, param2, const TypeInfo(String)), }; - final _response = await _rawApi.testJsonFormData( - + final _response = await rawApi.testJsonFormData( body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -968,7 +1059,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -977,13 +1068,13 @@ class FakeApi { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -993,7 +1084,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required BuiltList pipe, required BuiltList ioutil, required BuiltList http, @@ -1007,39 +1098,70 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.testQueryParameterCollectionFormat( - - pipe: _repository.encodeQueryParameter(pipe, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.pipes) , - ioutil: _repository.encodeQueryParameter(ioutil, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - http: _repository.encodeQueryParameter(http, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.ssv) , - url: _repository.encodeQueryParameter(url, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - context: _repository.encodeQueryParameter(context, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , - allowEmpty: _repository.encodeQueryParameter(allowEmpty, const TypeInfo(String)) , - language: language == null ? null : _repository.encodeQueryParameter(language, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])) , - + }) async { + final _response = await rawApi.testQueryParameterCollectionFormat( + pipe: encodeQueryParameter( + _repository, + pipe, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.pipes, + ), + ioutil: encodeQueryParameter( + _repository, + ioutil, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), + http: encodeQueryParameter( + _repository, + http, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.ssv, + ), + url: encodeQueryParameter( + _repository, + url, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), + context: encodeQueryParameter( + _repository, + context, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.multi, + ), + allowEmpty: encodeQueryParameter( + _repository, + allowEmpty, + const TypeInfo(String), + ), + language: language == null + ? null + : encodeQueryParameter( + _repository, + language, + const TypeInfo( + String, [TypeInfo(String), const TypeInfo(String)]), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } - } class FakeApiRaw { - final Dio _dio; const FakeApiRaw(this._dio); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1051,10 +1173,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1074,6 +1197,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1088,7 +1212,7 @@ class FakeApiRaw { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -1103,12 +1227,13 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ Object? query1, String? header1, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1135,6 +1260,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1167,10 +1293,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1190,6 +1317,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1217,10 +1345,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1240,6 +1369,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1267,10 +1397,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1290,6 +1421,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1317,10 +1449,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1340,6 +1473,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1367,10 +1501,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + Future> fakePropertyEnumIntegerSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1390,6 +1525,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1417,10 +1553,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1440,6 +1577,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1457,7 +1595,7 @@ class FakeApiRaw { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1467,10 +1605,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1490,6 +1629,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1504,11 +1644,11 @@ class FakeApiRaw { } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1518,11 +1658,12 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required Object query, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1542,6 +1683,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1574,10 +1716,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1597,6 +1740,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1610,8 +1754,8 @@ class FakeApiRaw { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -1637,10 +1781,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1666,6 +1811,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1689,7 +1835,7 @@ class FakeApiRaw { /// * [enumQueryString] - Query parameter enum test (string) /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] + /// * [enumQueryModelArray] /// * [enumFormStringArray] - Form parameter enum test (string array) /// * [enumFormString] - Form parameter enum test (string) /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1701,7 +1847,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ String? enumHeaderStringArray, String? enumHeaderString, Object? enumQueryStringArray, @@ -1712,6 +1858,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1723,7 +1870,8 @@ class FakeApiRaw { final _options = Options( method: r'GET', headers: { - if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderStringArray != null) + r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, @@ -1733,15 +1881,18 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryStringArray != null) + r'enum_query_string_array': enumQueryStringArray, if (enumQueryString != null) r'enum_query_string': enumQueryString, if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, + if (enumQueryModelArray != null) + r'enum_query_model_array': enumQueryModelArray, }; return await _dio.request( @@ -1774,7 +1925,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required Object requiredStringGroup, required String requiredBooleanGroup, required Object requiredInt64Group, @@ -1784,6 +1935,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1811,6 +1963,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1833,7 +1986,7 @@ class FakeApiRaw { } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -1846,10 +1999,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1869,6 +2023,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1883,7 +2038,7 @@ class FakeApiRaw { } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -1897,10 +2052,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1920,6 +2076,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1937,13 +2094,13 @@ class FakeApiRaw { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1953,7 +2110,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required Object pipe, required Object ioutil, required Object http, @@ -1964,6 +2121,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1983,6 +2141,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -2006,7 +2165,4 @@ class FakeApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart index df883fef655f..48dcd4c0c139 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class FakeClassnameTags123Api { - - final FakeClassnameTags123ApiRaw _rawApi; + final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; - const FakeClassnameTags123Api(this._rawApi, this._repository); + const FakeClassnameTags123Api(this.rawApi, this._repository); /// To test class name in snake case /// To test class name in snake case @@ -29,7 +29,7 @@ class FakeClassnameTags123Api { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -37,13 +37,11 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.testClassname( - + final _response = await rawApi.testClassname( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -52,16 +50,18 @@ class FakeClassnameTags123Api { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -83,11 +83,9 @@ class FakeClassnameTags123Api { extra: _response.extra, ); } - } class FakeClassnameTags123ApiRaw { - final Dio _dio; const FakeClassnameTags123ApiRaw(this._dio); @@ -106,10 +104,11 @@ class FakeClassnameTags123ApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -136,6 +135,7 @@ class FakeClassnameTags123ApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -148,7 +148,4 @@ class FakeClassnameTags123ApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart similarity index 87% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart index b5b72b00b36f..a945593958a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart @@ -5,20 +5,20 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/foo.dart'; import 'package:openapi/src/model/foo_ref_or_value.dart'; class FooApi { - - final FooApiRaw _rawApi; + final FooApiRaw rawApi; final SerializationRepositoryBase _repository; - const FooApi(this._rawApi, this._repository); + const FooApi(this.rawApi, this._repository); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -31,7 +31,7 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioError] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ Foo? foo, CancelToken? cancelToken, Map? headers, @@ -39,13 +39,12 @@ class FooApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); + _bodyData = + foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); - final _response = await _rawApi.createFoo( - + final _response = await rawApi.createFoo( body: _bodyData, requestContentType: 'application/json;charset=utf-8', cancelToken: cancelToken, @@ -54,16 +53,18 @@ class FooApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooRefOrValue? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(FooRefOrValue), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FooRefOrValue), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -87,7 +88,7 @@ class FooApi { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -99,34 +100,33 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future>> getAllFoos({ + Future>> getAllFoos({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getAllFoos( - - + }) async { + final _response = await rawApi.getAllFoos( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltList? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(BuiltList, [const TypeInfo(FooRefOrValue)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltList, [const TypeInfo(FooRefOrValue)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -148,17 +148,15 @@ class FooApi { extra: _response.extra, ); } - } class FooApiRaw { - final Dio _dio; const FooApiRaw(this._dio); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -171,10 +169,11 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioError] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -194,6 +193,7 @@ class FooApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -208,7 +208,7 @@ class FooApiRaw { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -220,10 +220,11 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future> getAllFoos({ + Future> getAllFoos({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -243,6 +244,7 @@ class FooApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -255,7 +257,4 @@ class FooApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart similarity index 86% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart index b040bbf92da2..06ea1bdb914d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart @@ -5,20 +5,20 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/api_response.dart'; import 'package:openapi/src/model/pet.dart'; class PetApi { - - final PetApiRaw _rawApi; + final PetApiRaw rawApi; final SerializationRepositoryBase _repository; - const PetApi(this._rawApi, this._repository); + const PetApi(this.rawApi, this._repository); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -31,7 +31,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> addPet({ + Future> addPet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -39,13 +39,11 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.addPet( - + final _response = await rawApi.addPet( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -54,17 +52,17 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -74,7 +72,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required int petId, String? apiKey, CancelToken? cancelToken, @@ -83,20 +81,19 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deletePet( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), - apiKey: apiKey == null ? null : _repository.encodeStringParameter(apiKey, const TypeInfo(String)) , - + }) async { + final _response = await rawApi.deletePet( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + apiKey: apiKey == null + ? null + : _repository.serialize(apiKey, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -115,7 +112,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ + Future>> findPetsByStatus({ @Deprecated('status is deprecated') required BuiltList status, CancelToken? cancelToken, Map? headers, @@ -123,28 +120,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.findPetsByStatus( - - status: _repository.encodeQueryParameter(status, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - + }) async { + final _response = await rawApi.findPetsByStatus( + status: encodeQueryParameter( + _repository, + status, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltList? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(BuiltList, [const TypeInfo(Pet)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltList, [const TypeInfo(Pet)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -182,7 +183,7 @@ class PetApi { /// Returns a [Future] containing a [Response] with a [BuiltSet] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ + Future>> findPetsByTags({ required BuiltSet tags, CancelToken? cancelToken, Map? headers, @@ -190,28 +191,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.findPetsByTags( - - tags: _repository.encodeQueryParameter(tags, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - + }) async { + final _response = await rawApi.findPetsByTags( + tags: encodeQueryParameter( + _repository, + tags, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltSet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(BuiltSet, [const TypeInfo(Pet)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltSet, [const TypeInfo(Pet)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -248,7 +253,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required int petId, CancelToken? cancelToken, Map? headers, @@ -256,28 +261,27 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getPetById( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), - + }) async { + final _response = await rawApi.getPetById( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Pet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Pet), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Pet), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -301,7 +305,7 @@ class PetApi { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -314,7 +318,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -322,13 +326,11 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.updatePet( - + final _response = await rawApi.updatePet( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -337,13 +339,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -358,7 +360,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required int petId, String? name, String? status, @@ -368,17 +370,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (name != null) r'name': _repository.encodeFormParameter(name, const TypeInfo(String)), - if (status != null) r'status': _repository.encodeFormParameter(status, const TypeInfo(String)), + if (name != null) + r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), + if (status != null) + r'status': + encodeFormParameter(_repository, status, const TypeInfo(String)), }; - final _response = await _rawApi.updatePetWithForm( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.updatePetWithForm( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -387,13 +390,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -408,7 +411,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required int petId, String? additionalMetadata, MultipartFile? file, @@ -418,17 +421,17 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (additionalMetadata != null) + r'additionalMetadata': encodeFormParameter( + _repository, additionalMetadata, const TypeInfo(String)), if (file != null) r'file': file, }); - final _response = await _rawApi.uploadFile( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.uploadFile( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -437,16 +440,18 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -470,7 +475,7 @@ class PetApi { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -485,7 +490,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, String? additionalMetadata, @@ -495,17 +500,17 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (additionalMetadata != null) + r'additionalMetadata': encodeFormParameter( + _repository, additionalMetadata, const TypeInfo(String)), r'requiredFile': requiredFile, }); - final _response = await _rawApi.uploadFileWithRequiredFile( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.uploadFileWithRequiredFile( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -514,16 +519,18 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -545,17 +552,15 @@ class PetApi { extra: _response.extra, ); } - } class PetApiRaw { - final Dio _dio; const PetApiRaw(this._dio); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -568,10 +573,11 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> addPet({ + Future> addPet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -596,6 +602,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -610,11 +617,11 @@ class PetApiRaw { } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -624,12 +631,13 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required String petId, String? apiKey, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -637,7 +645,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -655,6 +664,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -682,11 +692,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioError] if API call or serialization fails - Future> findPetsByStatus({ + Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -711,6 +722,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -744,11 +756,12 @@ class PetApiRaw { /// Returns a [Future] containing a [Response] with a [BuiltSet] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future> findPetsByTags({ + Future> findPetsByTags({ required Object tags, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -773,6 +786,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -805,11 +819,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -817,7 +832,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'GET', headers: { @@ -836,6 +852,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -850,7 +867,7 @@ class PetApiRaw { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -863,10 +880,11 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -891,6 +909,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -905,7 +924,7 @@ class PetApiRaw { } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -920,11 +939,12 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -932,7 +952,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -949,6 +970,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -963,7 +985,7 @@ class PetApiRaw { } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -978,11 +1000,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -990,7 +1013,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}/uploadImage' + .replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1007,6 +1031,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1021,7 +1046,7 @@ class PetApiRaw { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1036,11 +1061,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1048,7 +1074,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/fake/{petId}/uploadImageWithRequiredFile' + .replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1065,6 +1092,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1077,7 +1105,4 @@ class PetApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart index 4392c5a9dc6d..9d5b0ea36be3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart @@ -5,16 +5,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/order.dart'; class StoreApi { - - final StoreApiRaw _rawApi; + final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; - const StoreApi(this._rawApi, this._repository); + const StoreApi(this.rawApi, this._repository); /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -30,7 +30,7 @@ class StoreApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, CancelToken? cancelToken, Map? headers, @@ -38,19 +38,17 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deleteOrder( - - orderId: _repository.encodeStringParameter(orderId, const TypeInfo(String)), - + }) async { + final _response = await rawApi.deleteOrder( + orderId: + _repository.serialize(orderId, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -68,34 +66,33 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [BuiltMap] as data /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getInventory( - - + }) async { + final _response = await rawApi.getInventory( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltMap? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(BuiltMap, [TypeInfo(String), const TypeInfo(int)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(BuiltMap, [TypeInfo(String), const TypeInfo(int)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -132,7 +129,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required int orderId, CancelToken? cancelToken, Map? headers, @@ -140,28 +137,27 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getOrderById( - - orderId: _repository.encodeStringParameter(orderId, const TypeInfo(int)), - + }) async { + final _response = await rawApi.getOrderById( + orderId: _repository.serialize(orderId, const TypeInfo(int)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -185,7 +181,7 @@ class StoreApi { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -198,7 +194,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ required Order order, CancelToken? cancelToken, Map? headers, @@ -206,13 +202,11 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(order, const TypeInfo(Order)); - final _response = await _rawApi.placeOrder( - + final _response = await rawApi.placeOrder( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -221,16 +215,18 @@ class StoreApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -252,11 +248,9 @@ class StoreApi { extra: _response.extra, ); } - } class StoreApiRaw { - final Dio _dio; const StoreApiRaw(this._dio); @@ -275,11 +269,12 @@ class StoreApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -287,7 +282,8 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}' + .replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -299,6 +295,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -325,10 +322,11 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltMap] as data /// Throws [DioError] if API call or serialization fails - Future> getInventory({ + Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -355,6 +353,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -382,11 +381,12 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -394,7 +394,8 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}' + .replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'GET', headers: { @@ -406,6 +407,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -420,7 +422,7 @@ class StoreApiRaw { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -433,10 +435,11 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -456,6 +459,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -468,7 +472,4 @@ class StoreApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart index 1ce9390ee274..b5cc18ba6dd7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart @@ -5,16 +5,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/user.dart'; class UserApi { - - final UserApiRaw _rawApi; + final UserApiRaw rawApi; final SerializationRepositoryBase _repository; - const UserApi(this._rawApi, this._repository); + const UserApi(this.rawApi, this._repository); /// Create user /// This can only be done by the logged in user. @@ -30,7 +30,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUser({ + Future> createUser({ required User user, CancelToken? cancelToken, Map? headers, @@ -38,13 +38,11 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.createUser( - + final _response = await rawApi.createUser( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -53,13 +51,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -72,7 +70,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ required BuiltList user, CancelToken? cancelToken, Map? headers, @@ -80,13 +78,12 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + _bodyData = _repository.serialize( + user, const TypeInfo(User, [const TypeInfo(User)])); - final _response = await _rawApi.createUsersWithArrayInput( - + final _response = await rawApi.createUsersWithArrayInput( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -95,13 +92,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -114,7 +111,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ required BuiltList user, CancelToken? cancelToken, Map? headers, @@ -122,13 +119,12 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + _bodyData = _repository.serialize( + user, const TypeInfo(User, [const TypeInfo(User)])); - final _response = await _rawApi.createUsersWithListInput( - + final _response = await rawApi.createUsersWithListInput( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -137,7 +133,7 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -156,7 +152,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, CancelToken? cancelToken, Map? headers, @@ -164,25 +160,23 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deleteUser( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), - + }) async { + final _response = await rawApi.deleteUser( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -195,7 +189,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, CancelToken? cancelToken, Map? headers, @@ -203,28 +197,28 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getUserByName( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), - + }) async { + final _response = await rawApi.getUserByName( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); User? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(User), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(User), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -248,7 +242,7 @@ class UserApi { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -262,7 +256,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required String username, required String password, CancelToken? cancelToken, @@ -271,29 +265,36 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.loginUser( - - username: _repository.encodeQueryParameter(username, const TypeInfo(String)) , - password: _repository.encodeQueryParameter(password, const TypeInfo(String)) , - + }) async { + final _response = await rawApi.loginUser( + username: encodeQueryParameter( + _repository, + username, + const TypeInfo(String), + ), + password: encodeQueryParameter( + _repository, + password, + const TypeInfo(String), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -317,7 +318,7 @@ class UserApi { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -329,25 +330,22 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.logoutUser( - - + }) async { + final _response = await rawApi.logoutUser( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -367,7 +365,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, required User user, CancelToken? cancelToken, @@ -376,14 +374,13 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.updateUser( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), + final _response = await rawApi.updateUser( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -392,15 +389,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } - } class UserApiRaw { - final Dio _dio; const UserApiRaw(this._dio); @@ -419,10 +414,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUser({ + Future> createUser({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -442,6 +438,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -456,7 +453,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -469,10 +466,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -492,6 +490,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -506,7 +505,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -519,10 +518,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -542,6 +542,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -569,11 +570,12 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -581,7 +583,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'DELETE', headers: { @@ -593,6 +596,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -607,7 +611,7 @@ class UserApiRaw { } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -620,11 +624,12 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -632,7 +637,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'GET', headers: { @@ -644,6 +650,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -658,7 +665,7 @@ class UserApiRaw { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -672,12 +679,13 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required Object username, required Object password, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -697,6 +705,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -717,7 +726,7 @@ class UserApiRaw { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -729,10 +738,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -752,6 +762,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -780,11 +791,12 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -792,7 +804,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'PUT', headers: { @@ -804,6 +817,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -816,7 +830,4 @@ class UserApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_client.dart similarity index 74% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_client.dart index cb089e80ee1f..f0bc019b85df 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_client.dart @@ -15,7 +15,6 @@ class Openapi { final Dio dio; final SerializationRepositoryBase serializationRepository; - Openapi({ Dio? dio, SerializationRepositoryBase? serializationRepositoryOverride, @@ -26,7 +25,9 @@ class Openapi { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? JsonSerializableRepository() { + )), + this.serializationRepository = serializationRepositoryOverride ?? + BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -41,25 +42,36 @@ class Openapi { void setOAuthToken(String name, String token) { if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) + as OAuthInterceptor) + .tokens[name] = token; } } void setBearerAuth(String name, String token) { if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) + as BearerAuthInterceptor) + .tokens[name] = token; } } void setBasicAuth(String name, String username, String password) { if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) + as BasicAuthInterceptor) + .authInfo[name] = BasicAuthInfo(username, password); } } void setApiKey(String name, String apiKey) { if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + (this + .dio + .interceptors + .firstWhere((element) => element is ApiKeyAuthInterceptor) + as ApiKeyAuthInterceptor) + .apiKeys[name] = apiKey; } } @@ -69,6 +81,12 @@ class Openapi { return AnotherFakeApi(AnotherFakeApiRaw(dio), serializationRepository); } + /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(BarApiRaw(dio), serializationRepository); + } + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { @@ -84,7 +102,14 @@ class Openapi { /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); + return FakeClassnameTags123Api( + FakeClassnameTags123ApiRaw(dio), serializationRepository); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(FooApiRaw(dio), serializationRepository); } /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart new file mode 100644 index 000000000000..056ba3bcd8ec --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart @@ -0,0 +1,61 @@ +import 'package:dio/dio.dart'; +import 'dart:convert'; +import 'package:openapi/models.dart'; +import 'dart:typed_data'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +Object encodeFormParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +Object encodeQueryParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +ListParam encodeCollectionQueryParameter( + SerializationRepositoryBase repository, + Iterable value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = repository.serialize( + value, + type, + ); + if (serialized is Iterable) { + return ListParam(serialized.toList(), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/_exports.dart similarity index 83% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/_exports.dart index f038e92358ef..7219f2ecefa2 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/_exports.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/_exports.dart @@ -2,4 +2,4 @@ export 'api_key_auth.dart'; export 'basic_auth.dart'; export 'oauth.dart'; export 'bearer_auth.dart'; -export 'auth.dart'; \ No newline at end of file +export 'auth.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/api_key_auth.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/api_key_auth.dart index ee16e3f0f92f..312a5ad42602 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/api_key_auth.dart @@ -2,7 +2,6 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - import 'package:dio/dio.dart'; import 'package:openapi/src/auth/auth.dart'; @@ -11,7 +10,8 @@ class ApiKeyAuthInterceptor extends AuthInterceptor { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + final authInfo = + getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); for (final info in authInfo) { final authName = info['name'] as String; final authKeyName = info['keyName'] as String; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/auth.dart similarity index 80% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/auth.dart index f7ae9bf3f11e..c6fcca595cb3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/auth.dart @@ -8,7 +8,8 @@ abstract class AuthInterceptor extends Interceptor { /// Get auth information on given route for the given type. /// Can return an empty list if type is not present on auth data or /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + List> getAuthInfo( + RequestOptions route, bool Function(Map secure) handles) { if (route.extra.containsKey('secure')) { final auth = route.extra['secure'] as List>; return auth.where((secure) => handles(secure)).toList(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/basic_auth.dart similarity index 70% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/basic_auth.dart index b6e6dce04f9c..07b9efc0df0c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/basic_auth.dart @@ -22,12 +22,17 @@ class BasicAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + final metadataAuthInfo = getAuthInfo( + options, + (secure) => + (secure['type'] == 'http' && secure['scheme'] == 'basic') || + secure['type'] == 'basic'); for (final info in metadataAuthInfo) { final authName = info['name'] as String; final basicAuthInfo = authInfo[authName]; if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + final basicAuth = + 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; options.headers['Authorization'] = basicAuth; break; } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/bearer_auth.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/bearer_auth.dart index 1d4402b376c0..6723de5020d3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/bearer_auth.dart @@ -13,7 +13,8 @@ class BearerAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/oauth.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/oauth.dart index 337cf762b0ce..44403e3358be 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/oauth.dart @@ -13,7 +13,8 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/date_serializer.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/date_serializer.dart index 06e023d91be5..2994744ffcfb 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/date_serializer.dart @@ -7,7 +7,6 @@ import 'package:built_value/serializer.dart'; import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { - const DateSerializer(); @override diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/additional_properties_class.dart similarity index 71% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/additional_properties_class.dart index 3fdac6d5a44f..34022add8e5e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/additional_properties_class.dart @@ -12,10 +12,12 @@ part 'additional_properties_class.g.dart'; /// AdditionalPropertiesClass /// /// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] +/// * [mapProperty] +/// * [mapOfMapProperty] @BuiltValue() -abstract class AdditionalPropertiesClass implements Built { +abstract class AdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'map_property') BuiltMap? get mapProperty; @@ -24,18 +26,25 @@ abstract class AdditionalPropertiesClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); + static Serializer get serializer => + _$AdditionalPropertiesClassSerializer(); } -class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$AdditionalPropertiesClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + final Iterable types = const [ + AdditionalPropertiesClass, + _$AdditionalPropertiesClass + ]; @override final String wireName = r'AdditionalPropertiesClass'; @@ -49,14 +58,18 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer; result.mapProperty.replace(valueDes); break; case r'map_of_map_property': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapOfMapProperty.replace(valueDes); break; @@ -124,4 +143,3 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { Addressable object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -70,16 +72,19 @@ class _$AddressableSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + return serializers.deserialize(serialized, + specifiedType: FullType($Addressable)) as $Addressable; } } /// a concrete implementation of [Addressable], since [Addressable] is not instantiable @BuiltValue(instantiable: true) -abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { +abstract class $Addressable + implements Addressable, Built<$Addressable, $AddressableBuilder> { $Addressable._(); - factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + factory $Addressable([void Function($AddressableBuilder)? updates]) = + _$$Addressable; @BuiltValueHook(initializeBuilder: true) static void _defaults($AddressableBuilder b) => b; @@ -158,4 +163,3 @@ class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/all_of_with_single_ref.dart similarity index 86% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/all_of_with_single_ref.dart index 5bcd7d9dee8a..6f04a161e942 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/all_of_with_single_ref.dart @@ -12,10 +12,11 @@ part 'all_of_with_single_ref.g.dart'; /// AllOfWithSingleRef /// /// Properties: -/// * [username] -/// * [singleRefType] +/// * [username] +/// * [singleRefType] @BuiltValue() -abstract class AllOfWithSingleRef implements Built { +abstract class AllOfWithSingleRef + implements Built { @BuiltValueField(wireName: r'username') String? get username; @@ -25,16 +26,19 @@ abstract class AllOfWithSingleRef implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AllOfWithSingleRefSerializer(); + static Serializer get serializer => + _$AllOfWithSingleRefSerializer(); } -class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { +class _$AllOfWithSingleRefSerializer + implements PrimitiveSerializer { @override final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; @@ -68,7 +72,9 @@ class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { @@ -95,7 +96,9 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -106,14 +109,18 @@ class _$AnimalSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'CAT': - return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) + as Cat; case r'DOG': - return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) + as Dog; default: - return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + return serializers.deserialize(serialized, + specifiedType: FullType($Animal)) as $Animal; } } } @@ -202,4 +209,3 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/api_response.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/api_response.dart index aadcd792e2bf..14e9ccff7852 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/api_response.dart @@ -11,9 +11,9 @@ part 'api_response.g.dart'; /// ApiResponse /// /// Properties: -/// * [code] -/// * [type] -/// * [message] +/// * [code] +/// * [type] +/// * [message] @BuiltValue() abstract class ApiResponse implements Built { @BuiltValueField(wireName: r'code') @@ -77,7 +77,9 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { ApiResponse object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +143,3 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple.dart index 02ca94190b96..fa77c28e614c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple.dart @@ -11,7 +11,7 @@ part 'apple.g.dart'; /// Apple /// /// Properties: -/// * [kind] +/// * [kind] @BuiltValue() abstract class Apple implements Built { @BuiltValueField(wireName: r'kind') @@ -55,7 +55,9 @@ class _$AppleSerializer implements PrimitiveSerializer { Apple object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$AppleSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart new file mode 100644 index 000000000000..65ef1bafcf52 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple_all_of_disc.g.dart'; + +/// AppleAllOfDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class AppleAllOfDisc + implements FruitType, Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + AppleAllOfDisc._(); + + factory AppleAllOfDisc([void updates(AppleAllOfDiscBuilder b)]) = + _$AppleAllOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleAllOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$AppleAllOfDiscSerializer(); +} + +class _$AppleAllOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [AppleAllOfDisc, _$AppleAllOfDisc]; + + @override + final String wireName = r'AppleAllOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + AppleAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + AppleAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleAllOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AppleAllOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleAllOfDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart new file mode 100644 index 000000000000..7194f15f221a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/any_of.dart'; + +part 'apple_any_of_disc.g.dart'; + +/// AppleAnyOfDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class AppleAnyOfDisc + implements Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + /// Any Of [FruitType] + AnyOf get anyOf; + + AppleAnyOfDisc._(); + + factory AppleAnyOfDisc([void updates(AppleAnyOfDiscBuilder b)]) = + _$AppleAnyOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleAnyOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$AppleAnyOfDiscSerializer(); +} + +class _$AppleAnyOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [AppleAnyOfDisc, _$AppleAnyOfDisc]; + + @override + final String wireName = r'AppleAnyOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + AppleAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + AppleAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final anyOf = object.anyOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + final serialized = serializers.serialize(anyOf, + specifiedType: FullType( + AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList())); + result.addAll((serialized is Map + ? serialized.entries + .map((e) => [e.key, e.value]) + .expand((e) => e) + : serialized) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleAnyOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AppleAnyOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleAnyOfDiscBuilder(); + Object? anyOfDataSrc; + final targetType = const FullType(AnyOf, [ + FullType(FruitType), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + anyOfDataSrc = unhandled; + result.anyOf = serializers.deserialize(anyOfDataSrc, + specifiedType: targetType) as AnyOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart new file mode 100644 index 000000000000..7612f5cef18d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/parent.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple_grandparent_disc.g.dart'; + +/// AppleGrandparentDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class AppleGrandparentDisc + implements + Parent, + Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + AppleGrandparentDisc._(); + + factory AppleGrandparentDisc([void updates(AppleGrandparentDiscBuilder b)]) = + _$AppleGrandparentDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleGrandparentDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$AppleGrandparentDiscSerializer(); +} + +class _$AppleGrandparentDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + AppleGrandparentDisc, + _$AppleGrandparentDisc + ]; + + @override + final String wireName = r'AppleGrandparentDisc'; + + Iterable _serializeProperties( + Serializers serializers, + AppleGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + AppleGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleGrandparentDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AppleGrandparentDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleGrandparentDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart new file mode 100644 index 000000000000..a69bc64f1d77 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'apple_one_of_disc.g.dart'; + +/// AppleOneOfDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class AppleOneOfDisc + implements Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + /// One Of [FruitType] + OneOf get oneOf; + + AppleOneOfDisc._(); + + factory AppleOneOfDisc([void updates(AppleOneOfDiscBuilder b)]) = + _$AppleOneOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleOneOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$AppleOneOfDiscSerializer(); +} + +class _$AppleOneOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [AppleOneOfDisc, _$AppleOneOfDisc]; + + @override + final String wireName = r'AppleOneOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + AppleOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + AppleOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleOneOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AppleOneOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleOneOfDiscBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(FruitType), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart new file mode 100644 index 000000000000..f569000b454e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart @@ -0,0 +1,124 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple_req_disc.g.dart'; + +/// AppleReqDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class AppleReqDisc + implements Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + AppleReqDisc._(); + + factory AppleReqDisc([void updates(AppleReqDiscBuilder b)]) = _$AppleReqDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleReqDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AppleReqDiscSerializer(); +} + +class _$AppleReqDiscSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AppleReqDisc, _$AppleReqDisc]; + + @override + final String wireName = r'AppleReqDisc'; + + Iterable _serializeProperties( + Serializers serializers, + AppleReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + AppleReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleReqDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AppleReqDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleReqDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_variant1.dart similarity index 62% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_variant1.dart index 57e0992c67cd..673ced865449 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_variant1.dart @@ -6,45 +6,47 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; -part 'foo.g.dart'; +part 'apple_variant1.g.dart'; -/// Foo +/// AppleVariant1 /// /// Properties: -/// * [bar] +/// * [kind] @BuiltValue() -abstract class Foo implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; +abstract class AppleVariant1 + implements Built { + @BuiltValueField(wireName: r'kind') + String? get kind; - Foo._(); + AppleVariant1._(); - factory Foo([void updates(FooBuilder b)]) = _$Foo; + factory AppleVariant1([void updates(AppleVariant1Builder b)]) = + _$AppleVariant1; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b - ..bar = 'bar'; + static void _defaults(AppleVariant1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooSerializer(); + static Serializer get serializer => + _$AppleVariant1Serializer(); } -class _$FooSerializer implements PrimitiveSerializer { +class _$AppleVariant1Serializer implements PrimitiveSerializer { @override - final Iterable types = const [Foo, _$Foo]; + final Iterable types = const [AppleVariant1, _$AppleVariant1]; @override - final String wireName = r'Foo'; + final String wireName = r'AppleVariant1'; Iterable _serializeProperties( Serializers serializers, - Foo object, { + AppleVariant1 object, { FullType specifiedType = FullType.unspecified, }) sync* { - if (object.bar != null) { - yield r'bar'; + if (object.kind != null) { + yield r'kind'; yield serializers.serialize( - object.bar, + object.kind, specifiedType: const FullType(String), ); } @@ -53,10 +55,12 @@ class _$FooSerializer implements PrimitiveSerializer { @override Object serialize( Serializers serializers, - Foo object, { + AppleVariant1 object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -64,19 +68,19 @@ class _$FooSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, required List serializedList, - required FooBuilder result, + required AppleVariant1Builder result, required List unhandled, }) { for (var i = 0; i < serializedList.length; i += 2) { final key = serializedList[i] as String; final value = serializedList[i + 1]; switch (key) { - case r'bar': + case r'kind': final valueDes = serializers.deserialize( value, specifiedType: const FullType(String), ) as String; - result.bar = valueDes; + result.kind = valueDes; break; default: unhandled.add(key); @@ -87,12 +91,12 @@ class _$FooSerializer implements PrimitiveSerializer { } @override - Foo deserialize( + AppleVariant1 deserialize( Serializers serializers, Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = FooBuilder(); + final result = AppleVariant1Builder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -106,4 +110,3 @@ class _$FooSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_array_of_number_only.dart similarity index 72% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_array_of_number_only.dart index 5bc0982b8ab0..0f51b17b901d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_array_of_number_only.dart @@ -12,26 +12,35 @@ part 'array_of_array_of_number_only.g.dart'; /// ArrayOfArrayOfNumberOnly /// /// Properties: -/// * [arrayArrayNumber] +/// * [arrayArrayNumber] @BuiltValue() -abstract class ArrayOfArrayOfNumberOnly implements Built { +abstract class ArrayOfArrayOfNumberOnly + implements + Built { @BuiltValueField(wireName: r'ArrayArrayNumber') BuiltList>? get arrayArrayNumber; ArrayOfArrayOfNumberOnly._(); - factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + factory ArrayOfArrayOfNumberOnly( + [void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfArrayOfNumberOnlySerializer(); } -class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + final Iterable types = const [ + ArrayOfArrayOfNumberOnly, + _$ArrayOfArrayOfNumberOnly + ]; @override final String wireName = r'ArrayOfArrayOfNumberOnly'; @@ -45,7 +54,9 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer>; result.arrayArrayNumber.replace(valueDes); break; @@ -106,4 +121,3 @@ class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { +abstract class ArrayOfNumberOnly + implements Built { @BuiltValueField(wireName: r'ArrayNumber') BuiltList? get arrayNumber; ArrayOfNumberOnly._(); - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = + _$ArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); + static Serializer get serializer => + _$ArrayOfNumberOnlySerializer(); } -class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { +class _$ArrayOfNumberOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; @@ -56,7 +60,9 @@ class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'array_of_string') @@ -61,14 +61,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { yield r'array_array_of_integer'; yield serializers.serialize( object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ); } if (object.arrayArrayOfModel != null) { yield r'array_array_of_model'; yield serializers.serialize( object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ); } } @@ -79,7 +83,9 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { ArrayTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -104,14 +110,18 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { case r'array_array_of_integer': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(int)]) + ]), ) as BuiltList>; result.arrayArrayOfInteger.replace(valueDes); break; case r'array_array_of_model': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + specifiedType: const FullType(BuiltList, [ + FullType(BuiltList, [FullType(ReadOnlyFirst)]) + ]), ) as BuiltList>; result.arrayArrayOfModel.replace(valueDes); break; @@ -143,4 +153,3 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana.dart index bf2d632ee114..00c090ee8727 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana.dart @@ -11,7 +11,7 @@ part 'banana.g.dart'; /// Banana /// /// Properties: -/// * [count] +/// * [count] @BuiltValue() abstract class Banana implements Built { @BuiltValueField(wireName: r'count') @@ -55,7 +55,9 @@ class _$BananaSerializer implements PrimitiveSerializer { Banana object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$BananaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart new file mode 100644 index 000000000000..6ed5d198ad92 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana_all_of_disc.g.dart'; + +/// BananaAllOfDisc +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class BananaAllOfDisc + implements FruitType, Built { + @BuiltValueField(wireName: r'length') + int get length; + + BananaAllOfDisc._(); + + factory BananaAllOfDisc([void updates(BananaAllOfDiscBuilder b)]) = + _$BananaAllOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaAllOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$BananaAllOfDiscSerializer(); +} + +class _$BananaAllOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [BananaAllOfDisc, _$BananaAllOfDisc]; + + @override + final String wireName = r'BananaAllOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + BananaAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BananaAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaAllOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BananaAllOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaAllOfDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart new file mode 100644 index 000000000000..f61d88291f75 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/any_of.dart'; + +part 'banana_any_of_disc.g.dart'; + +/// BananaAnyOfDisc +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class BananaAnyOfDisc + implements Built { + @BuiltValueField(wireName: r'length') + int get length; + + /// Any Of [FruitType] + AnyOf get anyOf; + + BananaAnyOfDisc._(); + + factory BananaAnyOfDisc([void updates(BananaAnyOfDiscBuilder b)]) = + _$BananaAnyOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaAnyOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$BananaAnyOfDiscSerializer(); +} + +class _$BananaAnyOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [BananaAnyOfDisc, _$BananaAnyOfDisc]; + + @override + final String wireName = r'BananaAnyOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + BananaAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + BananaAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final anyOf = object.anyOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + final serialized = serializers.serialize(anyOf, + specifiedType: FullType( + AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList())); + result.addAll((serialized is Map + ? serialized.entries + .map((e) => [e.key, e.value]) + .expand((e) => e) + : serialized) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaAnyOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BananaAnyOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaAnyOfDiscBuilder(); + Object? anyOfDataSrc; + final targetType = const FullType(AnyOf, [ + FullType(FruitType), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + anyOfDataSrc = unhandled; + result.anyOf = serializers.deserialize(anyOfDataSrc, + specifiedType: targetType) as AnyOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart new file mode 100644 index 000000000000..45200de2eb1c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/parent.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana_grandparent_disc.g.dart'; + +/// BananaGrandparentDisc +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class BananaGrandparentDisc + implements + Parent, + Built { + @BuiltValueField(wireName: r'length') + int get length; + + BananaGrandparentDisc._(); + + factory BananaGrandparentDisc( + [void updates(BananaGrandparentDiscBuilder b)]) = _$BananaGrandparentDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaGrandparentDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$BananaGrandparentDiscSerializer(); +} + +class _$BananaGrandparentDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + BananaGrandparentDisc, + _$BananaGrandparentDisc + ]; + + @override + final String wireName = r'BananaGrandparentDisc'; + + Iterable _serializeProperties( + Serializers serializers, + BananaGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BananaGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaGrandparentDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BananaGrandparentDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaGrandparentDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart new file mode 100644 index 000000000000..5eb4611232d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'banana_one_of_disc.g.dart'; + +/// BananaOneOfDisc +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class BananaOneOfDisc + implements Built { + @BuiltValueField(wireName: r'length') + int get length; + + /// One Of [FruitType] + OneOf get oneOf; + + BananaOneOfDisc._(); + + factory BananaOneOfDisc([void updates(BananaOneOfDiscBuilder b)]) = + _$BananaOneOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaOneOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$BananaOneOfDiscSerializer(); +} + +class _$BananaOneOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [BananaOneOfDisc, _$BananaOneOfDisc]; + + @override + final String wireName = r'BananaOneOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + BananaOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + BananaOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaOneOfDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BananaOneOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaOneOfDiscBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(FruitType), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart new file mode 100644 index 000000000000..0338f1853788 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana_req_disc.g.dart'; + +/// BananaReqDisc +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class BananaReqDisc + implements Built { + @BuiltValueField(wireName: r'length') + int get length; + + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + BananaReqDisc._(); + + factory BananaReqDisc([void updates(BananaReqDiscBuilder b)]) = + _$BananaReqDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaReqDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$BananaReqDiscSerializer(); +} + +class _$BananaReqDiscSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BananaReqDisc, _$BananaReqDisc]; + + @override + final String wireName = r'BananaReqDisc'; + + Iterable _serializeProperties( + Serializers serializers, + BananaReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BananaReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaReqDiscBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BananaReqDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaReqDiscBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar.dart index cb769550b4f2..ba6b35ebf7df 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar.dart @@ -13,10 +13,10 @@ part 'bar.g.dart'; /// Bar /// /// Properties: -/// * [id] -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [id] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class @@ -37,7 +37,7 @@ abstract class Bar implements Entity, Built { factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); @@ -117,7 +117,9 @@ class _$BarSerializer implements PrimitiveSerializer { Bar object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_create.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_create.dart index 8942b6433f5e..5d726a9957e4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_create.dart @@ -13,9 +13,9 @@ part 'bar_create.g.dart'; /// BarCreate /// /// Properties: -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -37,7 +37,7 @@ abstract class BarCreate implements Entity, Built { factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarCreateBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); @@ -117,7 +117,9 @@ class _$BarCreateSerializer implements PrimitiveSerializer { BarCreate object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -216,4 +218,3 @@ class _$BarCreateSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref.dart index 2b9d2727a448..f77429fa929b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref.dart @@ -24,7 +24,7 @@ abstract class BarRef implements EntityRef, Built { factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(BarRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); @@ -97,7 +97,9 @@ class _$BarRefSerializer implements PrimitiveSerializer { BarRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -189,4 +191,3 @@ class _$BarRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref_or_value.dart similarity index 71% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref_or_value.dart index 4af61384ab76..eeb993907a02 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref_or_value.dart @@ -20,7 +20,8 @@ part 'bar_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class BarRefOrValue implements Built { +abstract class BarRefOrValue + implements Built { /// One Of [Bar], [BarRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class BarRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$BarRefOrValueSerializer(); + static Serializer get serializer => + _$BarRefOrValueSerializer(); } extension BarRefOrValueDiscriminatorExt on BarRefOrValue { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarRef) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } } + extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarRefBuilder) { - return r'BarRef'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; } + return null; + } } class _$BarRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, BarRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { final result = BarRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Bar, BarRef, ]; + final oneOfTypes = [ + Bar, + BarRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { oneOfType = BarRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/capitalization.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/capitalization.dart index 75827b9a429e..cbd4bf8cf926 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/capitalization.dart @@ -11,14 +11,15 @@ part 'capitalization.g.dart'; /// Capitalization /// /// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet @BuiltValue() -abstract class Capitalization implements Built { +abstract class Capitalization + implements Built { @BuiltValueField(wireName: r'smallCamel') String? get smallCamel; @@ -34,22 +35,25 @@ abstract class Capitalization implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CapitalizationSerializer(); + static Serializer get serializer => + _$CapitalizationSerializer(); } -class _$CapitalizationSerializer implements PrimitiveSerializer { +class _$CapitalizationSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Capitalization, _$Capitalization]; @@ -111,7 +115,9 @@ class _$CapitalizationSerializer implements PrimitiveSerializer Capitalization object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -196,4 +202,3 @@ class _$CapitalizationSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat.dart index 23d19b38b05a..ecc7facb059f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat.dart @@ -13,9 +13,9 @@ part 'cat.g.dart'; /// Cat /// /// Properties: -/// * [className] -/// * [color] -/// * [declawed] +/// * [className] +/// * [color] +/// * [declawed] @BuiltValue() abstract class Cat implements Animal, CatAllOf, Built { Cat._(); @@ -23,8 +23,9 @@ abstract class Cat implements Animal, CatAllOf, Built { factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(CatBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); @@ -69,7 +70,9 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$CatSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart index 02d9cce0cae1..18fd5b5ec591 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart @@ -11,9 +11,9 @@ part 'cat_all_of.g.dart'; /// CatAllOf /// /// Properties: -/// * [declawed] +/// * [declawed] @BuiltValue(instantiable: false) -abstract class CatAllOf { +abstract class CatAllOf { @BuiltValueField(wireName: r'declawed') bool? get declawed; @@ -48,7 +48,9 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { CatAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$CatAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($CatAllOf)) as $CatAllOf; } } /// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { +abstract class $CatAllOf + implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { $CatAllOf._(); factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; @@ -138,4 +142,3 @@ class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/category.dart similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/category.dart index 3a541dd1fa92..9c6f73f7df11 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/category.dart @@ -11,8 +11,8 @@ part 'category.g.dart'; /// Category /// /// Properties: -/// * [id] -/// * [name] +/// * [id] +/// * [name] @BuiltValue() abstract class Category implements Built { @BuiltValueField(wireName: r'id') @@ -26,8 +26,7 @@ abstract class Category implements Built { factory Category([void updates(CategoryBuilder b)]) = _$Category; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CategoryBuilder b) => b - ..name = 'default-name'; + static void _defaults(CategoryBuilder b) => b..name = 'default-name'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CategorySerializer(); @@ -65,7 +64,9 @@ class _$CategorySerializer implements PrimitiveSerializer { Category object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -122,4 +123,3 @@ class _$CategorySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/class_model.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/class_model.dart index 51166943c6cd..74442b2e44ac 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/class_model.dart @@ -11,7 +11,7 @@ part 'class_model.g.dart'; /// Model for testing model with \"_class\" property /// /// Properties: -/// * [classField] +/// * [classField] @BuiltValue() abstract class ClassModel implements Built { @BuiltValueField(wireName: r'_class') @@ -55,7 +55,9 @@ class _$ClassModelSerializer implements PrimitiveSerializer { ClassModel object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ClassModelSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart new file mode 100644 index 000000000000..8767ad934402 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart @@ -0,0 +1,131 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_missing_from_properties.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_missing_from_properties.g.dart'; + +/// ComposedDiscMissingFromProperties +/// +/// Properties: +/// * [length] +@BuiltValue() +abstract class ComposedDiscMissingFromProperties + implements + Built { + /// One Of [DiscMissingFromProperties] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscMissingFromProperties': DiscMissingFromProperties, + }; + + ComposedDiscMissingFromProperties._(); + + factory ComposedDiscMissingFromProperties( + [void updates(ComposedDiscMissingFromPropertiesBuilder b)]) = + _$ComposedDiscMissingFromProperties; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscMissingFromPropertiesBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscMissingFromPropertiesSerializer(); +} + +extension ComposedDiscMissingFromPropertiesDiscriminatorExt + on ComposedDiscMissingFromProperties { + String? get discriminatorValue { + if (this is DiscMissingFromProperties) { + return r'DiscMissingFromProperties'; + } + return null; + } +} + +extension ComposedDiscMissingFromPropertiesBuilderDiscriminatorExt + on ComposedDiscMissingFromPropertiesBuilder { + String? get discriminatorValue { + if (this is DiscMissingFromPropertiesBuilder) { + return r'DiscMissingFromProperties'; + } + return null; + } +} + +class _$ComposedDiscMissingFromPropertiesSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscMissingFromProperties, + _$ComposedDiscMissingFromProperties + ]; + + @override + final String wireName = r'ComposedDiscMissingFromProperties'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscMissingFromProperties object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscMissingFromProperties object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscMissingFromProperties deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscMissingFromPropertiesBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscMissingFromProperties.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscMissingFromProperties, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscMissingFromProperties': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscMissingFromProperties), + ) as DiscMissingFromProperties; + oneOfType = DiscMissingFromProperties; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart new file mode 100644 index 000000000000..fadcf3b8a5b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart @@ -0,0 +1,131 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_optional_type_correct.g.dart'; + +/// ComposedDiscOptionalTypeCorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscOptionalTypeCorrect + implements + Built { + /// One Of [DiscOptionalTypeCorrect] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscOptionalTypeCorrect': DiscOptionalTypeCorrect, + }; + + ComposedDiscOptionalTypeCorrect._(); + + factory ComposedDiscOptionalTypeCorrect( + [void updates(ComposedDiscOptionalTypeCorrectBuilder b)]) = + _$ComposedDiscOptionalTypeCorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscOptionalTypeCorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscOptionalTypeCorrectSerializer(); +} + +extension ComposedDiscOptionalTypeCorrectDiscriminatorExt + on ComposedDiscOptionalTypeCorrect { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + return null; + } +} + +extension ComposedDiscOptionalTypeCorrectBuilderDiscriminatorExt + on ComposedDiscOptionalTypeCorrectBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + return null; + } +} + +class _$ComposedDiscOptionalTypeCorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscOptionalTypeCorrect, + _$ComposedDiscOptionalTypeCorrect + ]; + + @override + final String wireName = r'ComposedDiscOptionalTypeCorrect'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscOptionalTypeCorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscOptionalTypeCorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscOptionalTypeCorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscOptionalTypeCorrectBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscOptionalTypeCorrect.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscOptionalTypeCorrect, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscOptionalTypeCorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscOptionalTypeCorrect), + ) as DiscOptionalTypeCorrect; + oneOfType = DiscOptionalTypeCorrect; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart new file mode 100644 index 000000000000..c4b3ecd2c73b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart @@ -0,0 +1,147 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_optional_type_inconsistent.g.dart'; + +/// ComposedDiscOptionalTypeInconsistent +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscOptionalTypeInconsistent + implements + Built { + /// One Of [DiscOptionalTypeCorrect], [DiscOptionalTypeIncorrect] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscOptionalTypeCorrect': DiscOptionalTypeCorrect, + r'DiscOptionalTypeIncorrect': DiscOptionalTypeIncorrect, + }; + + ComposedDiscOptionalTypeInconsistent._(); + + factory ComposedDiscOptionalTypeInconsistent( + [void updates(ComposedDiscOptionalTypeInconsistentBuilder b)]) = + _$ComposedDiscOptionalTypeInconsistent; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscOptionalTypeInconsistentBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscOptionalTypeInconsistentSerializer(); +} + +extension ComposedDiscOptionalTypeInconsistentDiscriminatorExt + on ComposedDiscOptionalTypeInconsistent { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + if (this is DiscOptionalTypeIncorrect) { + return r'DiscOptionalTypeIncorrect'; + } + return null; + } +} + +extension ComposedDiscOptionalTypeInconsistentBuilderDiscriminatorExt + on ComposedDiscOptionalTypeInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + if (this is DiscOptionalTypeIncorrectBuilder) { + return r'DiscOptionalTypeIncorrect'; + } + return null; + } +} + +class _$ComposedDiscOptionalTypeInconsistentSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscOptionalTypeInconsistent, + _$ComposedDiscOptionalTypeInconsistent + ]; + + @override + final String wireName = r'ComposedDiscOptionalTypeInconsistent'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscOptionalTypeInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscOptionalTypeInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscOptionalTypeInconsistent deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscOptionalTypeInconsistentBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf( + ComposedDiscOptionalTypeInconsistent.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscOptionalTypeCorrect, + DiscOptionalTypeIncorrect, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscOptionalTypeCorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscOptionalTypeCorrect), + ) as DiscOptionalTypeCorrect; + oneOfType = DiscOptionalTypeCorrect; + break; + case r'DiscOptionalTypeIncorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscOptionalTypeIncorrect), + ) as DiscOptionalTypeIncorrect; + oneOfType = DiscOptionalTypeIncorrect; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..90485dd3d62b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart @@ -0,0 +1,131 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_optional_type_incorrect.g.dart'; + +/// ComposedDiscOptionalTypeIncorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscOptionalTypeIncorrect + implements + Built { + /// One Of [DiscOptionalTypeIncorrect] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscOptionalTypeIncorrect': DiscOptionalTypeIncorrect, + }; + + ComposedDiscOptionalTypeIncorrect._(); + + factory ComposedDiscOptionalTypeIncorrect( + [void updates(ComposedDiscOptionalTypeIncorrectBuilder b)]) = + _$ComposedDiscOptionalTypeIncorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscOptionalTypeIncorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscOptionalTypeIncorrectSerializer(); +} + +extension ComposedDiscOptionalTypeIncorrectDiscriminatorExt + on ComposedDiscOptionalTypeIncorrect { + String? get discriminatorValue { + if (this is DiscOptionalTypeIncorrect) { + return r'DiscOptionalTypeIncorrect'; + } + return null; + } +} + +extension ComposedDiscOptionalTypeIncorrectBuilderDiscriminatorExt + on ComposedDiscOptionalTypeIncorrectBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeIncorrectBuilder) { + return r'DiscOptionalTypeIncorrect'; + } + return null; + } +} + +class _$ComposedDiscOptionalTypeIncorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscOptionalTypeIncorrect, + _$ComposedDiscOptionalTypeIncorrect + ]; + + @override + final String wireName = r'ComposedDiscOptionalTypeIncorrect'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscOptionalTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscOptionalTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscOptionalTypeIncorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscOptionalTypeIncorrectBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscOptionalTypeIncorrect.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscOptionalTypeIncorrect, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscOptionalTypeIncorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscOptionalTypeIncorrect), + ) as DiscOptionalTypeIncorrect; + oneOfType = DiscOptionalTypeIncorrect; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart new file mode 100644 index 000000000000..eb9a7999b103 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart @@ -0,0 +1,147 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_required_inconsistent.g.dart'; + +/// ComposedDiscRequiredInconsistent +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscRequiredInconsistent + implements + Built { + /// One Of [DiscOptionalTypeCorrect], [FruitType] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscOptionalTypeCorrect': DiscOptionalTypeCorrect, + r'FruitType': FruitType, + }; + + ComposedDiscRequiredInconsistent._(); + + factory ComposedDiscRequiredInconsistent( + [void updates(ComposedDiscRequiredInconsistentBuilder b)]) = + _$ComposedDiscRequiredInconsistent; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscRequiredInconsistentBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscRequiredInconsistentSerializer(); +} + +extension ComposedDiscRequiredInconsistentDiscriminatorExt + on ComposedDiscRequiredInconsistent { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + if (this is FruitType) { + return r'FruitType'; + } + return null; + } +} + +extension ComposedDiscRequiredInconsistentBuilderDiscriminatorExt + on ComposedDiscRequiredInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + if (this is FruitTypeBuilder) { + return r'FruitType'; + } + return null; + } +} + +class _$ComposedDiscRequiredInconsistentSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscRequiredInconsistent, + _$ComposedDiscRequiredInconsistent + ]; + + @override + final String wireName = r'ComposedDiscRequiredInconsistent'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscRequiredInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscRequiredInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscRequiredInconsistent deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscRequiredInconsistentBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscRequiredInconsistent.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscOptionalTypeCorrect, + FruitType, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscOptionalTypeCorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscOptionalTypeCorrect), + ) as DiscOptionalTypeCorrect; + oneOfType = DiscOptionalTypeCorrect; + break; + case r'FruitType': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitType), + ) as FruitType; + oneOfType = FruitType; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart new file mode 100644 index 000000000000..3d0a70bdd7d2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart @@ -0,0 +1,147 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_type_inconsistent.g.dart'; + +/// ComposedDiscTypeInconsistent +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscTypeInconsistent + implements + Built { + /// One Of [DiscTypeIncorrect], [FruitType] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscTypeIncorrect': DiscTypeIncorrect, + r'FruitType': FruitType, + }; + + ComposedDiscTypeInconsistent._(); + + factory ComposedDiscTypeInconsistent( + [void updates(ComposedDiscTypeInconsistentBuilder b)]) = + _$ComposedDiscTypeInconsistent; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscTypeInconsistentBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscTypeInconsistentSerializer(); +} + +extension ComposedDiscTypeInconsistentDiscriminatorExt + on ComposedDiscTypeInconsistent { + String? get discriminatorValue { + if (this is DiscTypeIncorrect) { + return r'DiscTypeIncorrect'; + } + if (this is FruitType) { + return r'FruitType'; + } + return null; + } +} + +extension ComposedDiscTypeInconsistentBuilderDiscriminatorExt + on ComposedDiscTypeInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscTypeIncorrectBuilder) { + return r'DiscTypeIncorrect'; + } + if (this is FruitTypeBuilder) { + return r'FruitType'; + } + return null; + } +} + +class _$ComposedDiscTypeInconsistentSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscTypeInconsistent, + _$ComposedDiscTypeInconsistent + ]; + + @override + final String wireName = r'ComposedDiscTypeInconsistent'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscTypeInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscTypeInconsistent object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscTypeInconsistent deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscTypeInconsistentBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscTypeInconsistent.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscTypeIncorrect, + FruitType, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscTypeIncorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscTypeIncorrect), + ) as DiscTypeIncorrect; + oneOfType = DiscTypeIncorrect; + break; + case r'FruitType': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitType), + ) as FruitType; + oneOfType = FruitType; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart new file mode 100644 index 000000000000..8d9ddde74f60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'composed_disc_type_incorrect.g.dart'; + +/// ComposedDiscTypeIncorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class ComposedDiscTypeIncorrect + implements + Built { + /// One Of [DiscTypeIncorrect] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'DiscTypeIncorrect': DiscTypeIncorrect, + }; + + ComposedDiscTypeIncorrect._(); + + factory ComposedDiscTypeIncorrect( + [void updates(ComposedDiscTypeIncorrectBuilder b)]) = + _$ComposedDiscTypeIncorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ComposedDiscTypeIncorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$ComposedDiscTypeIncorrectSerializer(); +} + +extension ComposedDiscTypeIncorrectDiscriminatorExt + on ComposedDiscTypeIncorrect { + String? get discriminatorValue { + if (this is DiscTypeIncorrect) { + return r'DiscTypeIncorrect'; + } + return null; + } +} + +extension ComposedDiscTypeIncorrectBuilderDiscriminatorExt + on ComposedDiscTypeIncorrectBuilder { + String? get discriminatorValue { + if (this is DiscTypeIncorrectBuilder) { + return r'DiscTypeIncorrect'; + } + return null; + } +} + +class _$ComposedDiscTypeIncorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + ComposedDiscTypeIncorrect, + _$ComposedDiscTypeIncorrect + ]; + + @override + final String wireName = r'ComposedDiscTypeIncorrect'; + + Iterable _serializeProperties( + Serializers serializers, + ComposedDiscTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + ComposedDiscTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + ComposedDiscTypeIncorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ComposedDiscTypeIncorrectBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList + .indexOf(ComposedDiscTypeIncorrect.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + DiscTypeIncorrect, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'DiscTypeIncorrect': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(DiscTypeIncorrect), + ) as DiscTypeIncorrect; + oneOfType = DiscTypeIncorrect; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/date.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/date.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/deprecated_object.dart similarity index 85% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/deprecated_object.dart index 57f089c899c8..81ab5d242350 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/deprecated_object.dart @@ -11,25 +11,29 @@ part 'deprecated_object.g.dart'; /// DeprecatedObject /// /// Properties: -/// * [name] +/// * [name] @Deprecated('DeprecatedObject has been deprecated') @BuiltValue() -abstract class DeprecatedObject implements Built { +abstract class DeprecatedObject + implements Built { @BuiltValueField(wireName: r'name') String? get name; DeprecatedObject._(); - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = + _$DeprecatedObject; @BuiltValueHook(initializeBuilder: true) static void _defaults(DeprecatedObjectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DeprecatedObjectSerializer(); + static Serializer get serializer => + _$DeprecatedObjectSerializer(); } -class _$DeprecatedObjectSerializer implements PrimitiveSerializer { +class _$DeprecatedObjectSerializer + implements PrimitiveSerializer { @override final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; @@ -56,7 +60,9 @@ class _$DeprecatedObjectSerializer implements PrimitiveSerializer { + @BuiltValueField(wireName: r'length') + int? get length; + + DiscMissingFromProperties._(); + + factory DiscMissingFromProperties( + [void updates(DiscMissingFromPropertiesBuilder b)]) = + _$DiscMissingFromProperties; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DiscMissingFromPropertiesBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$DiscMissingFromPropertiesSerializer(); +} + +class _$DiscMissingFromPropertiesSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + DiscMissingFromProperties, + _$DiscMissingFromProperties + ]; + + @override + final String wireName = r'DiscMissingFromProperties'; + + Iterable _serializeProperties( + Serializers serializers, + DiscMissingFromProperties object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.length != null) { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DiscMissingFromProperties object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DiscMissingFromPropertiesBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DiscMissingFromProperties deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DiscMissingFromPropertiesBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart new file mode 100644 index 000000000000..e8684ea767bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart @@ -0,0 +1,117 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'disc_optional_type_correct.g.dart'; + +/// DiscOptionalTypeCorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class DiscOptionalTypeCorrect + implements Built { + @BuiltValueField(wireName: r'fruitType') + String? get fruitType; + + DiscOptionalTypeCorrect._(); + + factory DiscOptionalTypeCorrect( + [void updates(DiscOptionalTypeCorrectBuilder b)]) = + _$DiscOptionalTypeCorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DiscOptionalTypeCorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$DiscOptionalTypeCorrectSerializer(); +} + +class _$DiscOptionalTypeCorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + DiscOptionalTypeCorrect, + _$DiscOptionalTypeCorrect + ]; + + @override + final String wireName = r'DiscOptionalTypeCorrect'; + + Iterable _serializeProperties( + Serializers serializers, + DiscOptionalTypeCorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.fruitType != null) { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DiscOptionalTypeCorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DiscOptionalTypeCorrectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DiscOptionalTypeCorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DiscOptionalTypeCorrectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..feab5c876672 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart @@ -0,0 +1,118 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'disc_optional_type_incorrect.g.dart'; + +/// DiscOptionalTypeIncorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class DiscOptionalTypeIncorrect + implements + Built { + @BuiltValueField(wireName: r'fruitType') + int? get fruitType; + + DiscOptionalTypeIncorrect._(); + + factory DiscOptionalTypeIncorrect( + [void updates(DiscOptionalTypeIncorrectBuilder b)]) = + _$DiscOptionalTypeIncorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DiscOptionalTypeIncorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$DiscOptionalTypeIncorrectSerializer(); +} + +class _$DiscOptionalTypeIncorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + DiscOptionalTypeIncorrect, + _$DiscOptionalTypeIncorrect + ]; + + @override + final String wireName = r'DiscOptionalTypeIncorrect'; + + Iterable _serializeProperties( + Serializers serializers, + DiscOptionalTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.fruitType != null) { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DiscOptionalTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DiscOptionalTypeIncorrectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DiscOptionalTypeIncorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DiscOptionalTypeIncorrectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart new file mode 100644 index 000000000000..0a4d45595def --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart @@ -0,0 +1,111 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'disc_type_incorrect.g.dart'; + +/// DiscTypeIncorrect +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class DiscTypeIncorrect + implements Built { + @BuiltValueField(wireName: r'fruitType') + int get fruitType; + + DiscTypeIncorrect._(); + + factory DiscTypeIncorrect([void updates(DiscTypeIncorrectBuilder b)]) = + _$DiscTypeIncorrect; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DiscTypeIncorrectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$DiscTypeIncorrectSerializer(); +} + +class _$DiscTypeIncorrectSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [DiscTypeIncorrect, _$DiscTypeIncorrect]; + + @override + final String wireName = r'DiscTypeIncorrect'; + + Iterable _serializeProperties( + Serializers serializers, + DiscTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + DiscTypeIncorrect object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DiscTypeIncorrectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DiscTypeIncorrect deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DiscTypeIncorrectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog.dart index 4d9974f25b1d..7f67a3b24ba0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog.dart @@ -13,9 +13,9 @@ part 'dog.g.dart'; /// Dog /// /// Properties: -/// * [className] -/// * [color] -/// * [breed] +/// * [className] +/// * [color] +/// * [breed] @BuiltValue() abstract class Dog implements Animal, DogAllOf, Built { Dog._(); @@ -23,8 +23,9 @@ abstract class Dog implements Animal, DogAllOf, Built { factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static void _defaults(DogBuilder b) => b + ..className = b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$DogSerializer(); @@ -69,7 +70,9 @@ class _$DogSerializer implements PrimitiveSerializer { Dog object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -133,4 +136,3 @@ class _$DogSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart index bd52567fa60a..28c95d93dcf2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart @@ -11,9 +11,9 @@ part 'dog_all_of.g.dart'; /// DogAllOf /// /// Properties: -/// * [breed] +/// * [breed] @BuiltValue(instantiable: false) -abstract class DogAllOf { +abstract class DogAllOf { @BuiltValueField(wireName: r'breed') String? get breed; @@ -48,7 +48,9 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { DogAllOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -57,13 +59,15 @@ class _$DogAllOfSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + return serializers.deserialize(serialized, + specifiedType: FullType($DogAllOf)) as $DogAllOf; } } /// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable @BuiltValue(instantiable: true) -abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { +abstract class $DogAllOf + implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { $DogAllOf._(); factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; @@ -138,4 +142,3 @@ class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity.dart similarity index 80% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity.dart index 7e27fab47387..56cc04c50eb0 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity.dart @@ -42,50 +42,51 @@ abstract class Entity implements Addressable, Extensible { } extension EntityDiscriminatorExt on Entity { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; - } - if (this is BarCreate) { - return r'Bar_Create'; - } - if (this is Foo) { - return r'Foo'; - } - if (this is Pasta) { - return r'Pasta'; - } - if (this is Pizza) { - return r'Pizza'; - } - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } } + extension EntityBuilderDiscriminatorExt on EntityBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarCreateBuilder) { - return r'Bar_Create'; - } - if (this is FooBuilder) { - return r'Foo'; - } - if (this is PastaBuilder) { - return r'Pasta'; - } - if (this is PizzaBuilder) { - return r'Pizza'; - } - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } } class _$EntitySerializer implements PrimitiveSerializer { @@ -157,9 +158,12 @@ class _$EntitySerializer implements PrimitiveSerializer { return serializers.serialize(object, specifiedType: FullType(Pizza))!; } if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -170,22 +174,30 @@ class _$EntitySerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'Bar': - return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) + as Bar; case r'Bar_Create': - return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + return serializers.deserialize(serialized, + specifiedType: FullType(BarCreate)) as BarCreate; case r'Foo': - return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) + as Foo; case r'Pasta': - return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + return serializers.deserialize(serialized, + specifiedType: FullType(Pasta)) as Pasta; case r'Pizza': - return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType(Pizza)) as Pizza; case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + return serializers.deserialize(serialized, + specifiedType: FullType($Entity)) as $Entity; } } } @@ -295,4 +307,3 @@ class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity_ref.dart similarity index 87% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity_ref.dart index 7502c94dd7f3..669bbc6293bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity_ref.dart @@ -44,26 +44,27 @@ abstract class EntityRef implements Addressable, Extensible { } extension EntityRefDiscriminatorExt on EntityRef { - String? get discriminatorValue { - if (this is BarRef) { - return r'BarRef'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { - String? get discriminatorValue { - if (this is BarRefBuilder) { - return r'BarRef'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } } class _$EntityRefSerializer implements PrimitiveSerializer { @@ -139,7 +140,9 @@ class _$EntityRefSerializer implements PrimitiveSerializer { if (object is FooRef) { return serializers.serialize(object, specifiedType: FullType(FooRef))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -149,25 +152,32 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'BarRef': - return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + return serializers.deserialize(serialized, + specifiedType: FullType(BarRef)) as BarRef; case r'FooRef': - return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + return serializers.deserialize(serialized, + specifiedType: FullType(FooRef)) as FooRef; default: - return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + return serializers.deserialize(serialized, + specifiedType: FullType($EntityRef)) as $EntityRef; } } } /// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable @BuiltValue(instantiable: true) -abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { +abstract class $EntityRef + implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { $EntityRef._(); - factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = + _$$EntityRef; @BuiltValueHook(initializeBuilder: true) static void _defaults($EntityRefBuilder b) => b; @@ -281,4 +291,3 @@ class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_arrays.dart similarity index 72% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_arrays.dart index b79a175e833c..2c8e3e6e4bb8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_arrays.dart @@ -12,8 +12,8 @@ part 'enum_arrays.g.dart'; /// EnumArrays /// /// Properties: -/// * [justSymbol] -/// * [arrayEnum] +/// * [justSymbol] +/// * [arrayEnum] @BuiltValue() abstract class EnumArrays implements Built { @BuiltValueField(wireName: r'just_symbol') @@ -58,7 +58,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { yield r'array_enum'; yield serializers.serialize( object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ); } } @@ -69,7 +70,9 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { EnumArrays object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -94,7 +97,8 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { case r'array_enum': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: + const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ) as BuiltList; result.arrayEnum.replace(valueDes); break; @@ -128,36 +132,43 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { } class EnumArraysJustSymbolEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + static const EnumArraysJustSymbolEnum greaterThanEqual = + _$enumArraysJustSymbolEnum_greaterThanEqual; @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + static const EnumArraysJustSymbolEnum dollar = + _$enumArraysJustSymbolEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = + _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + static Serializer get serializer => + _$enumArraysJustSymbolEnumSerializer; - const EnumArraysJustSymbolEnum._(String name): super(name); + const EnumArraysJustSymbolEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); + static BuiltSet get values => + _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => + _$enumArraysJustSymbolEnumValueOf(name); } class EnumArraysArrayEnumEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'fish') static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; @BuiltValueEnumConst(wireName: r'crab') static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = + _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + static Serializer get serializer => + _$enumArraysArrayEnumEnumSerializer; - const EnumArraysArrayEnumEnum._(String name): super(name); + const EnumArraysArrayEnumEnum._(String name) : super(name); - static BuiltSet get values => _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); + static BuiltSet get values => + _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => + _$enumArraysArrayEnumEnumValueOf(name); } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_test.dart similarity index 75% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_test.dart index 831f5b9d6d2d..effda132acdd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_test.dart @@ -16,14 +16,14 @@ part 'enum_test.g.dart'; /// EnumTest /// /// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] @BuiltValue() abstract class EnumTest implements Built { @BuiltValueField(wireName: r'enum_string') @@ -143,7 +143,9 @@ class _$EnumTestSerializer implements PrimitiveSerializer { EnumTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +247,6 @@ class _$EnumTestSerializer implements PrimitiveSerializer { } class EnumTestEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') @@ -253,66 +254,85 @@ class EnumTestEnumStringEnum extends EnumClass { @BuiltValueEnumConst(wireName: r'') static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringEnum unknownDefaultOpenApi = + _$enumTestEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringEnumSerializer; - const EnumTestEnumStringEnum._(String name): super(name); + const EnumTestEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => + _$enumTestEnumStringEnumValueOf(name); } class EnumTestEnumStringRequiredEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + static const EnumTestEnumStringRequiredEnum UPPER = + _$enumTestEnumStringRequiredEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + static const EnumTestEnumStringRequiredEnum lower = + _$enumTestEnumStringRequiredEnum_lower; @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + static const EnumTestEnumStringRequiredEnum empty = + _$enumTestEnumStringRequiredEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = + _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + static Serializer get serializer => + _$enumTestEnumStringRequiredEnumSerializer; - const EnumTestEnumStringRequiredEnum._(String name): super(name); + const EnumTestEnumStringRequiredEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => + _$enumTestEnumStringRequiredEnumValueOf(name); } class EnumTestEnumIntegerEnum extends EnumClass { - @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + static const EnumTestEnumIntegerEnum number1 = + _$enumTestEnumIntegerEnum_number1; @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + static const EnumTestEnumIntegerEnum numberNegative1 = + _$enumTestEnumIntegerEnum_numberNegative1; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = + _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + static Serializer get serializer => + _$enumTestEnumIntegerEnumSerializer; - const EnumTestEnumIntegerEnum._(String name): super(name); + const EnumTestEnumIntegerEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => + _$enumTestEnumIntegerEnumValueOf(name); } class EnumTestEnumNumberEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + static const EnumTestEnumNumberEnum number1Period1 = + _$enumTestEnumNumberEnum_number1Period1; @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + static const EnumTestEnumNumberEnum numberNegative1Period2 = + _$enumTestEnumNumberEnum_numberNegative1Period2; @BuiltValueEnumConst(wireName: r'11184809', fallback: true) - static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = + _$enumTestEnumNumberEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + static Serializer get serializer => + _$enumTestEnumNumberEnumSerializer; - const EnumTestEnumNumberEnum._(String name): super(name); + const EnumTestEnumNumberEnum._(String name) : super(name); - static BuiltSet get values => _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); + static BuiltSet get values => + _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => + _$enumTestEnumNumberEnumValueOf(name); } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/extensible.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/extensible.dart index 2423fb276412..4751e487f2cd 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/extensible.dart @@ -15,7 +15,7 @@ part 'extensible.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue(instantiable: false) -abstract class Extensible { +abstract class Extensible { /// A URI to a JSON-Schema file that defines additional attributes and relationships @BuiltValueField(wireName: r'@schemaLocation') String? get atSchemaLocation; @@ -71,7 +71,9 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Extensible object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -80,16 +82,19 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + return serializers.deserialize(serialized, + specifiedType: FullType($Extensible)) as $Extensible; } } /// a concrete implementation of [Extensible], since [Extensible] is not instantiable @BuiltValue(instantiable: true) -abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { +abstract class $Extensible + implements Extensible, Built<$Extensible, $ExtensibleBuilder> { $Extensible._(); - factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = + _$$Extensible; @BuiltValueHook(initializeBuilder: true) static void _defaults($ExtensibleBuilder b) => b; @@ -175,4 +180,3 @@ class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/file_schema_test_class.dart similarity index 84% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/file_schema_test_class.dart index 5ab41d14f437..e28ed72311d5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/file_schema_test_class.dart @@ -13,10 +13,11 @@ part 'file_schema_test_class.g.dart'; /// FileSchemaTestClass /// /// Properties: -/// * [file] -/// * [files] +/// * [file] +/// * [files] @BuiltValue() -abstract class FileSchemaTestClass implements Built { +abstract class FileSchemaTestClass + implements Built { @BuiltValueField(wireName: r'file') ModelFile? get file; @@ -25,18 +26,24 @@ abstract class FileSchemaTestClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FileSchemaTestClassSerializer(); + static Serializer get serializer => + _$FileSchemaTestClassSerializer(); } -class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { +class _$FileSchemaTestClassSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + final Iterable types = const [ + FileSchemaTestClass, + _$FileSchemaTestClass + ]; @override final String wireName = r'FileSchemaTestClass'; @@ -68,7 +75,9 @@ class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); @@ -105,7 +105,9 @@ class _$FooSerializer implements PrimitiveSerializer { Foo object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -197,4 +199,3 @@ class _$FooSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_basic_get_default_response.dart similarity index 63% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_basic_get_default_response.dart index b5903ebd5dbf..30d1edd3b03d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_basic_get_default_response.dart @@ -7,38 +7,47 @@ import 'package:openapi/src/model/foo.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; -part 'foo_get_default_response.g.dart'; +part 'foo_basic_get_default_response.g.dart'; -/// FooGetDefaultResponse +/// FooBasicGetDefaultResponse /// /// Properties: -/// * [string] +/// * [string] @BuiltValue() -abstract class FooGetDefaultResponse implements Built { +abstract class FooBasicGetDefaultResponse + implements + Built { @BuiltValueField(wireName: r'string') Foo? get string; - FooGetDefaultResponse._(); + FooBasicGetDefaultResponse._(); - factory FooGetDefaultResponse([void updates(FooGetDefaultResponseBuilder b)]) = _$FooGetDefaultResponse; + factory FooBasicGetDefaultResponse( + [void updates(FooBasicGetDefaultResponseBuilder b)]) = + _$FooBasicGetDefaultResponse; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooGetDefaultResponseBuilder b) => b; + static void _defaults(FooBasicGetDefaultResponseBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooGetDefaultResponseSerializer(); + static Serializer get serializer => + _$FooBasicGetDefaultResponseSerializer(); } -class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer { +class _$FooBasicGetDefaultResponseSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [FooGetDefaultResponse, _$FooGetDefaultResponse]; + final Iterable types = const [ + FooBasicGetDefaultResponse, + _$FooBasicGetDefaultResponse + ]; @override - final String wireName = r'FooGetDefaultResponse'; + final String wireName = r'FooBasicGetDefaultResponse'; Iterable _serializeProperties( Serializers serializers, - FooGetDefaultResponse object, { + FooBasicGetDefaultResponse object, { FullType specifiedType = FullType.unspecified, }) sync* { if (object.string != null) { @@ -53,10 +62,12 @@ class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer serializedList, - required FooGetDefaultResponseBuilder result, + required FooBasicGetDefaultResponseBuilder result, required List unhandled, }) { for (var i = 0; i < serializedList.length; i += 2) { @@ -87,12 +98,12 @@ class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer).toList(); final unhandled = []; _deserializeProperties( @@ -106,4 +117,3 @@ class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer { factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(FooRefBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); @@ -108,7 +108,9 @@ class _$FooRefSerializer implements PrimitiveSerializer { FooRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -207,4 +209,3 @@ class _$FooRefSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref_or_value.dart similarity index 71% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref_or_value.dart index af3e4875d9d6..896800fb01f8 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref_or_value.dart @@ -20,7 +20,8 @@ part 'foo_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class FooRefOrValue implements Built { +abstract class FooRefOrValue + implements Built { /// One Of [Foo], [FooRef] OneOf get oneOf; @@ -33,36 +34,39 @@ abstract class FooRefOrValue implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooRefOrValueSerializer(); + static Serializer get serializer => + _$FooRefOrValueSerializer(); } extension FooRefOrValueDiscriminatorExt on FooRefOrValue { - String? get discriminatorValue { - if (this is Foo) { - return r'Foo'; - } - if (this is FooRef) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } } + extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { - String? get discriminatorValue { - if (this is FooBuilder) { - return r'Foo'; - } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; } + return null; + } } class _$FooRefOrValueSerializer implements PrimitiveSerializer { @@ -76,8 +80,7 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, FooRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* { - } + }) sync* {} @override Object serialize( @@ -86,7 +89,8 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,10 +102,15 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { final result = FooRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discIndex = + serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [Foo, FooRef, ]; + final oneOfTypes = [ + Foo, + FooRef, + ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -120,10 +129,13 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { oneOfType = FooRef; break; default: - throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/format_test.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/format_test.dart index 33775231476e..771056f35226 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/format_test.dart @@ -13,20 +13,20 @@ part 'format_test.g.dart'; /// FormatTest /// /// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] +/// * [integer] +/// * [int32] +/// * [int64] +/// * [number] +/// * [float] +/// * [double_] +/// * [decimal] +/// * [string] +/// * [byte] +/// * [binary] +/// * [date] +/// * [dateTime] +/// * [uuid] +/// * [password] /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. @BuiltValue() @@ -216,7 +216,9 @@ class _$FormatTestSerializer implements PrimitiveSerializer { FormatTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -371,4 +373,3 @@ class _$FormatTestSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit.dart similarity index 85% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit.dart index 11f8cfa70501..5c31531d9e55 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit.dart @@ -14,9 +14,9 @@ part 'fruit.g.dart'; /// Fruit /// /// Properties: -/// * [color] -/// * [kind] -/// * [count] +/// * [color] +/// * [kind] +/// * [count] @BuiltValue() abstract class Fruit implements Built { @BuiltValueField(wireName: r'color') @@ -64,8 +64,11 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -104,7 +107,10 @@ class _$FruitSerializer implements PrimitiveSerializer { }) { final result = FruitBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final targetType = const FullType(OneOf, [ + FullType(Apple), + FullType(Banana), + ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -116,8 +122,8 @@ class _$FruitSerializer implements PrimitiveSerializer { result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart new file mode 100644 index 000000000000..c92bbee0bd0a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_all_of_disc.dart'; +import 'package:openapi/src/model/apple_all_of_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_all_of_disc.g.dart'; + +/// FruitAllOfDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitAllOfDisc + implements Built { + /// One Of [AppleAllOfDisc], [BananaAllOfDisc] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'AppleAllOfDisc': AppleAllOfDisc, + r'BananaAllOfDisc': BananaAllOfDisc, + }; + + FruitAllOfDisc._(); + + factory FruitAllOfDisc([void updates(FruitAllOfDiscBuilder b)]) = + _$FruitAllOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitAllOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitAllOfDiscSerializer(); +} + +extension FruitAllOfDiscDiscriminatorExt on FruitAllOfDisc { + String? get discriminatorValue { + if (this is AppleAllOfDisc) { + return r'AppleAllOfDisc'; + } + if (this is BananaAllOfDisc) { + return r'BananaAllOfDisc'; + } + return null; + } +} + +extension FruitAllOfDiscBuilderDiscriminatorExt on FruitAllOfDiscBuilder { + String? get discriminatorValue { + if (this is AppleAllOfDiscBuilder) { + return r'AppleAllOfDisc'; + } + if (this is BananaAllOfDiscBuilder) { + return r'BananaAllOfDisc'; + } + return null; + } +} + +class _$FruitAllOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [FruitAllOfDisc, _$FruitAllOfDisc]; + + @override + final String wireName = r'FruitAllOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitAllOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitAllOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitAllOfDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitAllOfDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + AppleAllOfDisc, + BananaAllOfDisc, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'AppleAllOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(AppleAllOfDisc), + ) as AppleAllOfDisc; + oneOfType = AppleAllOfDisc; + break; + case r'BananaAllOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BananaAllOfDisc), + ) as BananaAllOfDisc; + oneOfType = BananaAllOfDisc; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart new file mode 100644 index 000000000000..149c94ac2f72 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple_any_of_disc.dart'; +import 'package:openapi/src/model/banana_any_of_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_any_of_disc.g.dart'; + +/// FruitAnyOfDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitAnyOfDisc + implements Built { + /// One Of [AppleAnyOfDisc], [BananaAnyOfDisc] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'AppleAnyOfDisc': AppleAnyOfDisc, + r'BananaAnyOfDisc': BananaAnyOfDisc, + }; + + FruitAnyOfDisc._(); + + factory FruitAnyOfDisc([void updates(FruitAnyOfDiscBuilder b)]) = + _$FruitAnyOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitAnyOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitAnyOfDiscSerializer(); +} + +extension FruitAnyOfDiscDiscriminatorExt on FruitAnyOfDisc { + String? get discriminatorValue { + if (this is AppleAnyOfDisc) { + return r'AppleAnyOfDisc'; + } + if (this is BananaAnyOfDisc) { + return r'BananaAnyOfDisc'; + } + return null; + } +} + +extension FruitAnyOfDiscBuilderDiscriminatorExt on FruitAnyOfDiscBuilder { + String? get discriminatorValue { + if (this is AppleAnyOfDiscBuilder) { + return r'AppleAnyOfDisc'; + } + if (this is BananaAnyOfDiscBuilder) { + return r'BananaAnyOfDisc'; + } + return null; + } +} + +class _$FruitAnyOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [FruitAnyOfDisc, _$FruitAnyOfDisc]; + + @override + final String wireName = r'FruitAnyOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitAnyOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitAnyOfDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitAnyOfDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + AppleAnyOfDisc, + BananaAnyOfDisc, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'AppleAnyOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(AppleAnyOfDisc), + ) as AppleAnyOfDisc; + oneOfType = AppleAnyOfDisc; + break; + case r'BananaAnyOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BananaAnyOfDisc), + ) as BananaAnyOfDisc; + oneOfType = BananaAnyOfDisc; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart new file mode 100644 index 000000000000..a8b2a98adf0f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_grandparent_disc.dart'; +import 'package:openapi/src/model/apple_grandparent_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_grandparent_disc.g.dart'; + +/// FruitGrandparentDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitGrandparentDisc + implements Built { + /// One Of [AppleGrandparentDisc], [BananaGrandparentDisc] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'AppleGrandparentDisc': AppleGrandparentDisc, + r'BananaGrandparentDisc': BananaGrandparentDisc, + }; + + FruitGrandparentDisc._(); + + factory FruitGrandparentDisc([void updates(FruitGrandparentDiscBuilder b)]) = + _$FruitGrandparentDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitGrandparentDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitGrandparentDiscSerializer(); +} + +extension FruitGrandparentDiscDiscriminatorExt on FruitGrandparentDisc { + String? get discriminatorValue { + if (this is AppleGrandparentDisc) { + return r'AppleGrandparentDisc'; + } + if (this is BananaGrandparentDisc) { + return r'BananaGrandparentDisc'; + } + return null; + } +} + +extension FruitGrandparentDiscBuilderDiscriminatorExt + on FruitGrandparentDiscBuilder { + String? get discriminatorValue { + if (this is AppleGrandparentDiscBuilder) { + return r'AppleGrandparentDisc'; + } + if (this is BananaGrandparentDiscBuilder) { + return r'BananaGrandparentDisc'; + } + return null; + } +} + +class _$FruitGrandparentDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitGrandparentDisc, + _$FruitGrandparentDisc + ]; + + @override + final String wireName = r'FruitGrandparentDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitGrandparentDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitGrandparentDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitGrandparentDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitGrandparentDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + AppleGrandparentDisc, + BananaGrandparentDisc, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'AppleGrandparentDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(AppleGrandparentDisc), + ) as AppleGrandparentDisc; + oneOfType = AppleGrandparentDisc; + break; + case r'BananaGrandparentDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BananaGrandparentDisc), + ) as BananaGrandparentDisc; + oneOfType = BananaGrandparentDisc; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart new file mode 100644 index 000000000000..6d5d1ab657d6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart @@ -0,0 +1,140 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_inline_disc.g.dart'; + +/// FruitInlineDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +/// * [length] +@BuiltValue() +abstract class FruitInlineDisc + implements Built { + /// One Of [FruitInlineDiscOneOf], [FruitInlineDiscOneOf1] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'FruitInlineDisc_oneOf': FruitInlineDiscOneOf, + r'FruitInlineDisc_oneOf_1': FruitInlineDiscOneOf1, + }; + + FruitInlineDisc._(); + + factory FruitInlineDisc([void updates(FruitInlineDiscBuilder b)]) = + _$FruitInlineDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineDiscSerializer(); +} + +extension FruitInlineDiscDiscriminatorExt on FruitInlineDisc { + String? get discriminatorValue { + if (this is FruitInlineDiscOneOf) { + return r'FruitInlineDisc_oneOf'; + } + if (this is FruitInlineDiscOneOf1) { + return r'FruitInlineDisc_oneOf_1'; + } + return null; + } +} + +extension FruitInlineDiscBuilderDiscriminatorExt on FruitInlineDiscBuilder { + String? get discriminatorValue { + if (this is FruitInlineDiscOneOfBuilder) { + return r'FruitInlineDisc_oneOf'; + } + if (this is FruitInlineDiscOneOf1Builder) { + return r'FruitInlineDisc_oneOf_1'; + } + return null; + } +} + +class _$FruitInlineDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [FruitInlineDisc, _$FruitInlineDisc]; + + @override + final String wireName = r'FruitInlineDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitInlineDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitInlineDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitInlineDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + FruitInlineDiscOneOf, + FruitInlineDiscOneOf1, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'FruitInlineDisc_oneOf': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitInlineDiscOneOf), + ) as FruitInlineDiscOneOf; + oneOfType = FruitInlineDiscOneOf; + break; + case r'FruitInlineDisc_oneOf_1': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitInlineDiscOneOf1), + ) as FruitInlineDiscOneOf1; + oneOfType = FruitInlineDiscOneOf1; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart new file mode 100644 index 000000000000..2c976acc688c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'fruit_inline_disc_one_of.g.dart'; + +/// FruitInlineDiscOneOf +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineDiscOneOf + implements Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + FruitInlineDiscOneOf._(); + + factory FruitInlineDiscOneOf([void updates(FruitInlineDiscOneOfBuilder b)]) = + _$FruitInlineDiscOneOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineDiscOneOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineDiscOneOfSerializer(); +} + +class _$FruitInlineDiscOneOfSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineDiscOneOf, + _$FruitInlineDiscOneOf + ]; + + @override + final String wireName = r'FruitInlineDiscOneOf'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineDiscOneOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitInlineDiscOneOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitInlineDiscOneOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitInlineDiscOneOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineDiscOneOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart new file mode 100644 index 000000000000..48a8c55588af --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'fruit_inline_disc_one_of1.g.dart'; + +/// FruitInlineDiscOneOf1 +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineDiscOneOf1 + implements Built { + @BuiltValueField(wireName: r'length') + int get length; + + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + FruitInlineDiscOneOf1._(); + + factory FruitInlineDiscOneOf1( + [void updates(FruitInlineDiscOneOf1Builder b)]) = _$FruitInlineDiscOneOf1; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineDiscOneOf1Builder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineDiscOneOf1Serializer(); +} + +class _$FruitInlineDiscOneOf1Serializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineDiscOneOf1, + _$FruitInlineDiscOneOf1 + ]; + + @override + final String wireName = r'FruitInlineDiscOneOf1'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineDiscOneOf1 object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitInlineDiscOneOf1 object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitInlineDiscOneOf1Builder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitInlineDiscOneOf1 deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineDiscOneOf1Builder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart new file mode 100644 index 000000000000..824c90e54e99 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart @@ -0,0 +1,143 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_inline_inline_disc.g.dart'; + +/// FruitInlineInlineDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineInlineDisc + implements Built { + /// One Of [FruitInlineInlineDiscOneOf], [FruitInlineInlineDiscOneOf1] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'FruitInlineInlineDisc_oneOf': FruitInlineInlineDiscOneOf, + r'FruitInlineInlineDisc_oneOf_1': FruitInlineInlineDiscOneOf1, + }; + + FruitInlineInlineDisc._(); + + factory FruitInlineInlineDisc( + [void updates(FruitInlineInlineDiscBuilder b)]) = _$FruitInlineInlineDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineInlineDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineInlineDiscSerializer(); +} + +extension FruitInlineInlineDiscDiscriminatorExt on FruitInlineInlineDisc { + String? get discriminatorValue { + if (this is FruitInlineInlineDiscOneOf) { + return r'FruitInlineInlineDisc_oneOf'; + } + if (this is FruitInlineInlineDiscOneOf1) { + return r'FruitInlineInlineDisc_oneOf_1'; + } + return null; + } +} + +extension FruitInlineInlineDiscBuilderDiscriminatorExt + on FruitInlineInlineDiscBuilder { + String? get discriminatorValue { + if (this is FruitInlineInlineDiscOneOfBuilder) { + return r'FruitInlineInlineDisc_oneOf'; + } + if (this is FruitInlineInlineDiscOneOf1Builder) { + return r'FruitInlineInlineDisc_oneOf_1'; + } + return null; + } +} + +class _$FruitInlineInlineDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineInlineDisc, + _$FruitInlineInlineDisc + ]; + + @override + final String wireName = r'FruitInlineInlineDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineInlineDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitInlineInlineDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitInlineInlineDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineInlineDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitInlineInlineDisc.discriminatorFieldName) + + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + FruitInlineInlineDiscOneOf, + FruitInlineInlineDiscOneOf1, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'FruitInlineInlineDisc_oneOf': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitInlineInlineDiscOneOf), + ) as FruitInlineInlineDiscOneOf; + oneOfType = FruitInlineInlineDiscOneOf; + break; + case r'FruitInlineInlineDisc_oneOf_1': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FruitInlineInlineDiscOneOf1), + ) as FruitInlineInlineDiscOneOf1; + oneOfType = FruitInlineInlineDiscOneOf1; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart new file mode 100644 index 000000000000..3b33e7b47913 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart @@ -0,0 +1,133 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_inline_inline_disc_one_of.g.dart'; + +/// FruitInlineInlineDiscOneOf +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineInlineDiscOneOf + implements + Built { + @BuiltValueField(wireName: r'seeds') + int get seeds; + + /// One Of [FruitInlineInlineDiscOneOfOneOf] + OneOf get oneOf; + + FruitInlineInlineDiscOneOf._(); + + factory FruitInlineInlineDiscOneOf( + [void updates(FruitInlineInlineDiscOneOfBuilder b)]) = + _$FruitInlineInlineDiscOneOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineInlineDiscOneOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineInlineDiscOneOfSerializer(); +} + +class _$FruitInlineInlineDiscOneOfSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineInlineDiscOneOf, + _$FruitInlineInlineDiscOneOf + ]; + + @override + final String wireName = r'FruitInlineInlineDiscOneOf'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineInlineDiscOneOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'seeds'; + yield serializers.serialize( + object.seeds, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitInlineInlineDiscOneOf object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitInlineInlineDiscOneOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'seeds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.seeds = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitInlineInlineDiscOneOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineInlineDiscOneOfBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(FruitInlineInlineDiscOneOfOneOf), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart new file mode 100644 index 000000000000..3c0b9a9ddd00 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart @@ -0,0 +1,133 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_inline_inline_disc_one_of1.g.dart'; + +/// FruitInlineInlineDiscOneOf1 +/// +/// Properties: +/// * [length] +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineInlineDiscOneOf1 + implements + Built { + @BuiltValueField(wireName: r'length') + int get length; + + /// One Of [FruitInlineInlineDiscOneOfOneOf] + OneOf get oneOf; + + FruitInlineInlineDiscOneOf1._(); + + factory FruitInlineInlineDiscOneOf1( + [void updates(FruitInlineInlineDiscOneOf1Builder b)]) = + _$FruitInlineInlineDiscOneOf1; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineInlineDiscOneOf1Builder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineInlineDiscOneOf1Serializer(); +} + +class _$FruitInlineInlineDiscOneOf1Serializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineInlineDiscOneOf1, + _$FruitInlineInlineDiscOneOf1 + ]; + + @override + final String wireName = r'FruitInlineInlineDiscOneOf1'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineInlineDiscOneOf1 object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'length'; + yield serializers.serialize( + object.length, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitInlineInlineDiscOneOf1 object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitInlineInlineDiscOneOf1Builder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'length': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.length = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitInlineInlineDiscOneOf1 deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineInlineDiscOneOf1Builder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(FruitInlineInlineDiscOneOfOneOf), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart new file mode 100644 index 000000000000..cc5e05999c44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart @@ -0,0 +1,117 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'fruit_inline_inline_disc_one_of_one_of.g.dart'; + +/// FruitInlineInlineDiscOneOfOneOf +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitInlineInlineDiscOneOfOneOf + implements + Built { + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + FruitInlineInlineDiscOneOfOneOf._(); + + factory FruitInlineInlineDiscOneOfOneOf( + [void updates(FruitInlineInlineDiscOneOfOneOfBuilder b)]) = + _$FruitInlineInlineDiscOneOfOneOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitInlineInlineDiscOneOfOneOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitInlineInlineDiscOneOfOneOfSerializer(); +} + +class _$FruitInlineInlineDiscOneOfOneOfSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [ + FruitInlineInlineDiscOneOfOneOf, + _$FruitInlineInlineDiscOneOfOneOf + ]; + + @override + final String wireName = r'FruitInlineInlineDiscOneOfOneOf'; + + Iterable _serializeProperties( + Serializers serializers, + FruitInlineInlineDiscOneOfOneOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitInlineInlineDiscOneOfOneOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitInlineInlineDiscOneOfOneOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitInlineInlineDiscOneOfOneOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitInlineInlineDiscOneOfOneOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart new file mode 100644 index 000000000000..075df4056894 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_one_of_disc.dart'; +import 'package:openapi/src/model/apple_one_of_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_one_of_disc.g.dart'; + +/// FruitOneOfDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitOneOfDisc + implements Built { + /// One Of [AppleOneOfDisc], [BananaOneOfDisc] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'AppleOneOfDisc': AppleOneOfDisc, + r'BananaOneOfDisc': BananaOneOfDisc, + }; + + FruitOneOfDisc._(); + + factory FruitOneOfDisc([void updates(FruitOneOfDiscBuilder b)]) = + _$FruitOneOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitOneOfDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitOneOfDiscSerializer(); +} + +extension FruitOneOfDiscDiscriminatorExt on FruitOneOfDisc { + String? get discriminatorValue { + if (this is AppleOneOfDisc) { + return r'AppleOneOfDisc'; + } + if (this is BananaOneOfDisc) { + return r'BananaOneOfDisc'; + } + return null; + } +} + +extension FruitOneOfDiscBuilderDiscriminatorExt on FruitOneOfDiscBuilder { + String? get discriminatorValue { + if (this is AppleOneOfDiscBuilder) { + return r'AppleOneOfDisc'; + } + if (this is BananaOneOfDiscBuilder) { + return r'BananaOneOfDisc'; + } + return null; + } +} + +class _$FruitOneOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [FruitOneOfDisc, _$FruitOneOfDisc]; + + @override + final String wireName = r'FruitOneOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitOneOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitOneOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitOneOfDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitOneOfDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + AppleOneOfDisc, + BananaOneOfDisc, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'AppleOneOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(AppleOneOfDisc), + ) as AppleOneOfDisc; + oneOfType = AppleOneOfDisc; + break; + case r'BananaOneOfDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BananaOneOfDisc), + ) as BananaOneOfDisc; + oneOfType = BananaOneOfDisc; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart new file mode 100644 index 000000000000..8bb855b0fb0d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart @@ -0,0 +1,137 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_req_disc.dart'; +import 'package:openapi/src/model/apple_req_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_req_disc.g.dart'; + +/// FruitReqDisc +/// +/// Properties: +/// * [seeds] +/// * [fruitType] +/// * [length] +@BuiltValue() +abstract class FruitReqDisc + implements Built { + /// One Of [AppleReqDisc], [BananaReqDisc] + OneOf get oneOf; + + static const String discriminatorFieldName = r'fruitType'; + + static const Map discriminatorMapping = { + r'AppleReqDisc': AppleReqDisc, + r'BananaReqDisc': BananaReqDisc, + }; + + FruitReqDisc._(); + + factory FruitReqDisc([void updates(FruitReqDiscBuilder b)]) = _$FruitReqDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitReqDiscBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FruitReqDiscSerializer(); +} + +extension FruitReqDiscDiscriminatorExt on FruitReqDisc { + String? get discriminatorValue { + if (this is AppleReqDisc) { + return r'AppleReqDisc'; + } + if (this is BananaReqDisc) { + return r'BananaReqDisc'; + } + return null; + } +} + +extension FruitReqDiscBuilderDiscriminatorExt on FruitReqDiscBuilder { + String? get discriminatorValue { + if (this is AppleReqDiscBuilder) { + return r'AppleReqDisc'; + } + if (this is BananaReqDiscBuilder) { + return r'BananaReqDisc'; + } + return null; + } +} + +class _$FruitReqDiscSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FruitReqDisc, _$FruitReqDisc]; + + @override + final String wireName = r'FruitReqDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitReqDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + FruitReqDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitReqDiscBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = + serializedList.indexOf(FruitReqDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [ + AppleReqDisc, + BananaReqDisc, + ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'AppleReqDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(AppleReqDisc), + ) as AppleReqDisc; + oneOfType = AppleReqDisc; + break; + case r'BananaReqDisc': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BananaReqDisc), + ) as BananaReqDisc; + oneOfType = BananaReqDisc; + break; + default: + throw UnsupportedError( + "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic( + typeIndex: oneOfTypes.indexOf(oneOfType), + types: oneOfTypes, + value: oneOfResult); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart new file mode 100644 index 000000000000..7a32c5b9ccf4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart @@ -0,0 +1,143 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'fruit_type.g.dart'; + +/// FruitType +/// +/// Properties: +/// * [fruitType] +@BuiltValue(instantiable: false) +abstract class FruitType { + @BuiltValueField(wireName: r'fruitType') + String get fruitType; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FruitTypeSerializer(); +} + +class _$FruitTypeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FruitType]; + + @override + final String wireName = r'FruitType'; + + Iterable _serializeProperties( + Serializers serializers, + FruitType object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FruitType object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + @override + FruitType deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, + specifiedType: FullType($FruitType)) as $FruitType; + } +} + +/// a concrete implementation of [FruitType], since [FruitType] is not instantiable +@BuiltValue(instantiable: true) +abstract class $FruitType + implements FruitType, Built<$FruitType, $FruitTypeBuilder> { + $FruitType._(); + + factory $FruitType([void Function($FruitTypeBuilder)? updates]) = + _$$FruitType; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($FruitTypeBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$FruitType> get serializer => _$$FruitTypeSerializer(); +} + +class _$$FruitTypeSerializer implements PrimitiveSerializer<$FruitType> { + @override + final Iterable types = const [$FruitType, _$$FruitType]; + + @override + final String wireName = r'$FruitType'; + + @override + Object serialize( + Serializers serializers, + $FruitType object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(FruitType))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitTypeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $FruitType deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $FruitTypeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart new file mode 100644 index 000000000000..d7a7a813c2c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart @@ -0,0 +1,132 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple_variant1.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/grape_variant1.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit_variant1.g.dart'; + +/// FruitVariant1 +/// +/// Properties: +/// * [color] +/// * [kind] +@BuiltValue() +abstract class FruitVariant1 + implements Built { + @BuiltValueField(wireName: r'color') + String? get color; + + /// One Of [AppleVariant1], [BuiltList] + OneOf get oneOf; + + FruitVariant1._(); + + factory FruitVariant1([void updates(FruitVariant1Builder b)]) = + _$FruitVariant1; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitVariant1Builder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitVariant1Serializer(); +} + +class _$FruitVariant1Serializer implements PrimitiveSerializer { + @override + final Iterable types = const [FruitVariant1, _$FruitVariant1]; + + @override + final String wireName = r'FruitVariant1'; + + Iterable _serializeProperties( + Serializers serializers, + FruitVariant1 object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FruitVariant1 object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = + _serializeProperties(serializers, object, specifiedType: specifiedType) + .toList(); + result.addAll(serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitVariant1Builder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FruitVariant1 deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitVariant1Builder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(AppleVariant1), + FullType(BuiltList, [FullType(GrapeVariant1)]), + ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart new file mode 100644 index 000000000000..edc39cc4ab7e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart @@ -0,0 +1,79 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/one_of_primitive_child.dart'; +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'giga_one_of.g.dart'; + +/// GigaOneOf +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class GigaOneOf implements Built { + /// One Of [DateTime], [OneOfPrimitiveChild], [String], [int], [num] + OneOf get oneOf; + + GigaOneOf._(); + + factory GigaOneOf([void updates(GigaOneOfBuilder b)]) = _$GigaOneOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(GigaOneOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$GigaOneOfSerializer(); +} + +class _$GigaOneOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [GigaOneOf, _$GigaOneOf]; + + @override + final String wireName = r'GigaOneOf'; + + Iterable _serializeProperties( + Serializers serializers, + GigaOneOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + GigaOneOf object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, + specifiedType: FullType(oneOf.valueType))!; + } + + @override + GigaOneOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = GigaOneOfBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [ + FullType(String), + FullType(DateTime), + FullType(int), + FullType(num), + FullType(OneOfPrimitiveChild), + FullType(int), + ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, + specifiedType: targetType) as OneOf; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart new file mode 100644 index 000000000000..85227f984333 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'grape_variant1.g.dart'; + +/// GrapeVariant1 +/// +/// Properties: +/// * [color] +@BuiltValue() +abstract class GrapeVariant1 + implements Built { + @BuiltValueField(wireName: r'color') + String? get color; + + GrapeVariant1._(); + + factory GrapeVariant1([void updates(GrapeVariant1Builder b)]) = + _$GrapeVariant1; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(GrapeVariant1Builder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$GrapeVariant1Serializer(); +} + +class _$GrapeVariant1Serializer implements PrimitiveSerializer { + @override + final Iterable types = const [GrapeVariant1, _$GrapeVariant1]; + + @override + final String wireName = r'GrapeVariant1'; + + Iterable _serializeProperties( + Serializers serializers, + GrapeVariant1 object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + GrapeVariant1 object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required GrapeVariant1Builder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + GrapeVariant1 deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = GrapeVariant1Builder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/has_only_read_only.dart similarity index 86% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/has_only_read_only.dart index 9683985cf198..9d2538bab52a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/has_only_read_only.dart @@ -11,10 +11,11 @@ part 'has_only_read_only.g.dart'; /// HasOnlyReadOnly /// /// Properties: -/// * [bar] -/// * [foo] +/// * [bar] +/// * [foo] @BuiltValue() -abstract class HasOnlyReadOnly implements Built { +abstract class HasOnlyReadOnly + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,16 +24,19 @@ abstract class HasOnlyReadOnly implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HasOnlyReadOnlySerializer(); + static Serializer get serializer => + _$HasOnlyReadOnlySerializer(); } -class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +class _$HasOnlyReadOnlySerializer + implements PrimitiveSerializer { @override final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; @@ -66,7 +70,9 @@ class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { +abstract class HealthCheckResult + implements Built { @BuiltValueField(wireName: r'NullableMessage') String? get nullableMessage; HealthCheckResult._(); - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = + _$HealthCheckResult; @BuiltValueHook(initializeBuilder: true) static void _defaults(HealthCheckResultBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HealthCheckResultSerializer(); + static Serializer get serializer => + _$HealthCheckResultSerializer(); } -class _$HealthCheckResultSerializer implements PrimitiveSerializer { +class _$HealthCheckResultSerializer + implements PrimitiveSerializer { @override final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; @@ -55,7 +59,9 @@ class _$HealthCheckResultSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'map_map_of_string') @@ -58,28 +58,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { yield r'map_map_of_string'; yield serializers.serialize( object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ); } if (object.mapOfEnumString != null) { yield r'map_of_enum_string'; yield serializers.serialize( object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ); } if (object.directMap != null) { yield r'direct_map'; yield serializers.serialize( object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } if (object.indirectMap != null) { yield r'indirect_map'; yield serializers.serialize( object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } } @@ -90,7 +96,9 @@ class _$MapTestSerializer implements PrimitiveSerializer { MapTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -108,28 +116,34 @@ class _$MapTestSerializer implements PrimitiveSerializer { case r'map_map_of_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + specifiedType: const FullType(BuiltMap, [ + FullType(String), + FullType(BuiltMap, [FullType(String), FullType(String)]) + ]), ) as BuiltMap>; result.mapMapOfString.replace(valueDes); break; case r'map_of_enum_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType(BuiltMap, + [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ) as BuiltMap; result.mapOfEnumString.replace(valueDes); break; case r'direct_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.directMap.replace(valueDes); break; case r'indirect_map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.indirectMap.replace(valueDes); break; @@ -163,19 +177,23 @@ class _$MapTestSerializer implements PrimitiveSerializer { } class MapTestMapOfEnumStringEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + static const MapTestMapOfEnumStringEnum UPPER = + _$mapTestMapOfEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + static const MapTestMapOfEnumStringEnum lower = + _$mapTestMapOfEnumStringEnum_lower; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = + _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + static Serializer get serializer => + _$mapTestMapOfEnumStringEnumSerializer; - const MapTestMapOfEnumStringEnum._(String name): super(name); + const MapTestMapOfEnumStringEnum._(String name) : super(name); - static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); + static BuiltSet get values => + _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => + _$mapTestMapOfEnumStringEnumValueOf(name); } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart similarity index 75% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart index 76b5933ae5a7..0d85f7d589aa 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -13,11 +13,14 @@ part 'mixed_properties_and_additional_properties_class.g.dart'; /// MixedPropertiesAndAdditionalPropertiesClass /// /// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] +/// * [uuid] +/// * [dateTime] +/// * [map] @BuiltValue() -abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { +abstract class MixedPropertiesAndAdditionalPropertiesClass + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -29,18 +32,29 @@ abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built b; + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => + b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); + static Serializer + get serializer => + _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); } -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer + implements + PrimitiveSerializer { @override - final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + final Iterable types = const [ + MixedPropertiesAndAdditionalPropertiesClass, + _$MixedPropertiesAndAdditionalPropertiesClass + ]; @override final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; @@ -68,7 +82,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti yield r'map'; yield serializers.serialize( object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ); } } @@ -79,7 +94,9 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti MixedPropertiesAndAdditionalPropertiesClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -111,7 +128,8 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti case r'map': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: + const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ) as BuiltMap; result.map.replace(valueDes); break; @@ -143,4 +161,3 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements Primiti return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model200_response.dart similarity index 86% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model200_response.dart index 0a2cfb4411ac..b9f7146fd0e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model200_response.dart @@ -11,10 +11,11 @@ part 'model200_response.g.dart'; /// Model for testing model name starting with number /// /// Properties: -/// * [name] -/// * [classField] +/// * [name] +/// * [classField] @BuiltValue() -abstract class Model200Response implements Built { +abstract class Model200Response + implements Built { @BuiltValueField(wireName: r'name') int? get name; @@ -23,16 +24,19 @@ abstract class Model200Response implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$Model200ResponseSerializer(); + static Serializer get serializer => + _$Model200ResponseSerializer(); } -class _$Model200ResponseSerializer implements PrimitiveSerializer { +class _$Model200ResponseSerializer + implements PrimitiveSerializer { @override final Iterable types = const [Model200Response, _$Model200Response]; @@ -66,7 +70,9 @@ class _$Model200ResponseSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'client') @@ -55,7 +55,9 @@ class _$ModelClientSerializer implements PrimitiveSerializer { ModelClient object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelClientSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart similarity index 87% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart index ac609bfd15ad..02835bd779f5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart @@ -10,19 +10,20 @@ import 'package:built_value/serializer.dart'; part 'model_enum_class.g.dart'; class ModelEnumClass extends EnumClass { - @BuiltValueEnumConst(wireName: r'_abc') static const ModelEnumClass abc = _$abc; @BuiltValueEnumConst(wireName: r'-efg') static const ModelEnumClass efg = _$efg; @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + static const ModelEnumClass leftParenthesisXyzRightParenthesis = + _$leftParenthesisXyzRightParenthesis; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$modelEnumClassSerializer; + static Serializer get serializer => + _$modelEnumClassSerializer; - const ModelEnumClass._(String name): super(name); + const ModelEnumClass._(String name) : super(name); static BuiltSet get values => _$values; static ModelEnumClass valueOf(String name) => _$valueOf(name); @@ -35,4 +36,3 @@ class ModelEnumClass extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_file.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_file.dart index 2702c21d36f2..a74db4217b29 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_file.dart @@ -56,7 +56,9 @@ class _$ModelFileSerializer implements PrimitiveSerializer { ModelFile object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -106,4 +108,3 @@ class _$ModelFileSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_list.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_list.dart index 579853258f8e..fbea6fe8232c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_list.dart @@ -11,7 +11,7 @@ part 'model_list.g.dart'; /// ModelList /// /// Properties: -/// * [n123list] +/// * [n123list] @BuiltValue() abstract class ModelList implements Built { @BuiltValueField(wireName: r'123-list') @@ -55,7 +55,9 @@ class _$ModelListSerializer implements PrimitiveSerializer { ModelList object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelListSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_return.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_return.dart index 45a2f67f8a40..46770cac8e9e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_return.dart @@ -11,7 +11,7 @@ part 'model_return.g.dart'; /// Model for testing reserved words /// /// Properties: -/// * [return_] +/// * [return_] @BuiltValue() abstract class ModelReturn implements Built { @BuiltValueField(wireName: r'return') @@ -55,7 +55,9 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { ModelReturn object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/name.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/name.dart index 10fa99e6a5f7..12531dce5470 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/name.dart @@ -11,10 +11,10 @@ part 'name.g.dart'; /// Model for testing model name same as property name /// /// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] @BuiltValue() abstract class Name implements Built { @BuiltValueField(wireName: r'name') @@ -86,7 +86,9 @@ class _$NameSerializer implements PrimitiveSerializer { Name object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -157,4 +159,3 @@ class _$NameSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/nullable_class.dart similarity index 81% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/nullable_class.dart index c993a41303f0..ff124c21bf20 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/nullable_class.dart @@ -14,20 +14,21 @@ part 'nullable_class.g.dart'; /// NullableClass /// /// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] @BuiltValue() -abstract class NullableClass implements Built { +abstract class NullableClass + implements Built { @BuiltValueField(wireName: r'integer_prop') int? get integerProp; @@ -66,13 +67,15 @@ abstract class NullableClass implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NullableClassSerializer(); + static Serializer get serializer => + _$NullableClassSerializer(); } class _$NullableClassSerializer implements PrimitiveSerializer { @@ -133,42 +136,48 @@ class _$NullableClassSerializer implements PrimitiveSerializer { yield r'array_nullable_prop'; yield serializers.serialize( object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ); } if (object.arrayAndItemsNullableProp != null) { yield r'array_and_items_nullable_prop'; yield serializers.serialize( object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.arrayItemsNullable != null) { yield r'array_items_nullable'; yield serializers.serialize( object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.objectNullableProp != null) { yield r'object_nullable_prop'; yield serializers.serialize( object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ); } if (object.objectAndItemsNullableProp != null) { yield r'object_and_items_nullable_prop'; yield serializers.serialize( object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } if (object.objectItemsNullable != null) { yield r'object_items_nullable'; yield serializers.serialize( object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } } @@ -179,7 +188,9 @@ class _$NullableClassSerializer implements PrimitiveSerializer { NullableClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -245,7 +256,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: + const FullType.nullable(BuiltList, [FullType(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayNullableProp.replace(valueDes); @@ -253,7 +265,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayAndItemsNullableProp.replace(valueDes); @@ -261,14 +274,16 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: + const FullType(BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList; result.arrayItemsNullable.replace(valueDes); break; case r'object_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectNullableProp.replace(valueDes); @@ -276,7 +291,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectAndItemsNullableProp.replace(valueDes); @@ -284,7 +300,8 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType( + BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap; result.objectItemsNullable.replace(valueDes); break; @@ -316,4 +333,3 @@ class _$NullableClassSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/number_only.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/number_only.dart index 482a95f3e521..bc854c85003b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/number_only.dart @@ -11,7 +11,7 @@ part 'number_only.g.dart'; /// NumberOnly /// /// Properties: -/// * [justNumber] +/// * [justNumber] @BuiltValue() abstract class NumberOnly implements Built { @BuiltValueField(wireName: r'JustNumber') @@ -55,7 +55,9 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { NumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -105,4 +107,3 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/object_with_deprecated_fields.dart similarity index 80% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/object_with_deprecated_fields.dart index 4e0ae04ae50d..036818a6a98a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/object_with_deprecated_fields.dart @@ -5,6 +5,7 @@ // ignore_for_file: unused_element import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -13,12 +14,14 @@ part 'object_with_deprecated_fields.g.dart'; /// ObjectWithDeprecatedFields /// /// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] @BuiltValue() -abstract class ObjectWithDeprecatedFields implements Built { +abstract class ObjectWithDeprecatedFields + implements + Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -32,22 +35,29 @@ abstract class ObjectWithDeprecatedFields implements Built? get bars; + BuiltList? get bars; ObjectWithDeprecatedFields._(); - factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; + factory ObjectWithDeprecatedFields( + [void updates(ObjectWithDeprecatedFieldsBuilder b)]) = + _$ObjectWithDeprecatedFields; @BuiltValueHook(initializeBuilder: true) static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); + static Serializer get serializer => + _$ObjectWithDeprecatedFieldsSerializer(); } -class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { +class _$ObjectWithDeprecatedFieldsSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + final Iterable types = const [ + ObjectWithDeprecatedFields, + _$ObjectWithDeprecatedFields + ]; @override final String wireName = r'ObjectWithDeprecatedFields'; @@ -82,7 +92,7 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer; + specifiedType: const FullType(BuiltList, [FullType(Bar)]), + ) as BuiltList; result.bars.replace(valueDes); break; default: @@ -164,4 +176,3 @@ class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { +abstract class OneOfPrimitiveChild + implements Built { @BuiltValueField(wireName: r'name') String? get name; - Child._(); + OneOfPrimitiveChild._(); - factory Child([void updates(ChildBuilder b)]) = _$Child; + factory OneOfPrimitiveChild([void updates(OneOfPrimitiveChildBuilder b)]) = + _$OneOfPrimitiveChild; @BuiltValueHook(initializeBuilder: true) - static void _defaults(ChildBuilder b) => b; + static void _defaults(OneOfPrimitiveChildBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ChildSerializer(); + static Serializer get serializer => + _$OneOfPrimitiveChildSerializer(); } -class _$ChildSerializer implements PrimitiveSerializer { +class _$OneOfPrimitiveChildSerializer + implements PrimitiveSerializer { @override - final Iterable types = const [Child, _$Child]; + final Iterable types = const [ + OneOfPrimitiveChild, + _$OneOfPrimitiveChild + ]; @override - final String wireName = r'Child'; + final String wireName = r'OneOfPrimitiveChild'; Iterable _serializeProperties( Serializers serializers, - Child object, { + OneOfPrimitiveChild object, { FullType specifiedType = FullType.unspecified, }) sync* { if (object.name != null) { @@ -52,10 +59,12 @@ class _$ChildSerializer implements PrimitiveSerializer { @override Object serialize( Serializers serializers, - Child object, { + OneOfPrimitiveChild object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -63,7 +72,7 @@ class _$ChildSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, required List serializedList, - required ChildBuilder result, + required OneOfPrimitiveChildBuilder result, required List unhandled, }) { for (var i = 0; i < serializedList.length; i += 2) { @@ -86,12 +95,12 @@ class _$ChildSerializer implements PrimitiveSerializer { } @override - Child deserialize( + OneOfPrimitiveChild deserialize( Serializers serializers, Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = ChildBuilder(); + final result = OneOfPrimitiveChildBuilder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -105,4 +114,3 @@ class _$ChildSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/order.dart similarity index 91% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/order.dart index a44e1b340c1e..35b18409ec52 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/order.dart @@ -12,12 +12,12 @@ part 'order.g.dart'; /// Order /// /// Properties: -/// * [id] -/// * [petId] -/// * [quantity] -/// * [shipDate] +/// * [id] +/// * [petId] +/// * [quantity] +/// * [shipDate] /// * [status] - Order Status -/// * [complete] +/// * [complete] @BuiltValue() abstract class Order implements Built { @BuiltValueField(wireName: r'id') @@ -45,8 +45,7 @@ abstract class Order implements Built { factory Order([void updates(OrderBuilder b)]) = _$Order; @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b - ..complete = false; + static void _defaults(OrderBuilder b) => b..complete = false; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$OrderSerializer(); @@ -114,7 +113,9 @@ class _$OrderSerializer implements PrimitiveSerializer { Order object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -201,25 +202,28 @@ class _$OrderSerializer implements PrimitiveSerializer { } class OrderStatusEnum extends EnumClass { - /// Order Status @BuiltValueEnumConst(wireName: r'placed') static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status @BuiltValueEnumConst(wireName: r'approved') static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status @BuiltValueEnumConst(wireName: r'delivered') static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + static const OrderStatusEnum unknownDefaultOpenApi = + _$orderStatusEnum_unknownDefaultOpenApi; - static Serializer get serializer => _$orderStatusEnumSerializer; + static Serializer get serializer => + _$orderStatusEnumSerializer; - const OrderStatusEnum._(String name): super(name); + const OrderStatusEnum._(String name) : super(name); static BuiltSet get values => _$orderStatusEnumValues; static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_composite.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_composite.dart index 0d6341cc1299..899262513eb7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_composite.dart @@ -11,11 +11,12 @@ part 'outer_composite.g.dart'; /// OuterComposite /// /// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] +/// * [myNumber] +/// * [myString] +/// * [myBoolean] @BuiltValue() -abstract class OuterComposite implements Built { +abstract class OuterComposite + implements Built { @BuiltValueField(wireName: r'my_number') num? get myNumber; @@ -27,16 +28,19 @@ abstract class OuterComposite implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterCompositeSerializer(); + static Serializer get serializer => + _$OuterCompositeSerializer(); } -class _$OuterCompositeSerializer implements PrimitiveSerializer { +class _$OuterCompositeSerializer + implements PrimitiveSerializer { @override final Iterable types = const [OuterComposite, _$OuterComposite]; @@ -77,7 +81,9 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer OuterComposite object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -141,4 +147,3 @@ class _$OuterCompositeSerializer implements PrimitiveSerializer return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart index 5ad5d8009bdf..bf08d4aa048d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum.g.dart'; class OuterEnum extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnum placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -22,7 +21,7 @@ class OuterEnum extends EnumClass { static Serializer get serializer => _$outerEnumSerializer; - const OuterEnum._(String name): super(name); + const OuterEnum._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnum valueOf(String name) => _$valueOf(name); @@ -35,4 +34,3 @@ class OuterEnum extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumMixin = Object with _$OuterEnumMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart index 62c3cefe8456..446e5c2fed2d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_default_value.g.dart'; class OuterEnumDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireName: r'placed') static const OuterEnumDefaultValue placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -18,11 +17,13 @@ class OuterEnumDefaultValue extends EnumClass { @BuiltValueEnumConst(wireName: r'delivered') static const OuterEnumDefaultValue delivered = _$delivered; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumDefaultValueSerializer; - const OuterEnumDefaultValue._(String name): super(name); + const OuterEnumDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; - +abstract class OuterEnumDefaultValueMixin = Object + with _$OuterEnumDefaultValueMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart index 988b30785d30..d42a7baf5dbd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer.g.dart'; class OuterEnumInteger extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumInteger number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -20,9 +19,10 @@ class OuterEnumInteger extends EnumClass { @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerSerializer; + static Serializer get serializer => + _$outerEnumIntegerSerializer; - const OuterEnumInteger._(String name): super(name); + const OuterEnumInteger._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumInteger valueOf(String name) => _$valueOf(name); @@ -35,4 +35,3 @@ class OuterEnumInteger extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart similarity index 83% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart index 3fe792cedbe9..33b46287a86b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer_default_value.g.dart'; class OuterEnumIntegerDefaultValue extends EnumClass { - @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumIntegerDefaultValue number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -18,11 +17,13 @@ class OuterEnumIntegerDefaultValue extends EnumClass { @BuiltValueEnumConst(wireNumber: 2) static const OuterEnumIntegerDefaultValue number2 = _$number2; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = + _$unknownDefaultOpenApi; - static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + static Serializer get serializer => + _$outerEnumIntegerDefaultValueSerializer; - const OuterEnumIntegerDefaultValue._(String name): super(name); + const OuterEnumIntegerDefaultValue._(String name) : super(name); static BuiltSet get values => _$values; static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); @@ -34,5 +35,5 @@ class OuterEnumIntegerDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; - +abstract class OuterEnumIntegerDefaultValueMixin = Object + with _$OuterEnumIntegerDefaultValueMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_object_with_enum_property.dart similarity index 79% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_object_with_enum_property.dart index 173329856452..43dddcba352f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_object_with_enum_property.dart @@ -12,27 +12,36 @@ part 'outer_object_with_enum_property.g.dart'; /// OuterObjectWithEnumProperty /// /// Properties: -/// * [value] +/// * [value] @BuiltValue() -abstract class OuterObjectWithEnumProperty implements Built { +abstract class OuterObjectWithEnumProperty + implements + Built { @BuiltValueField(wireName: r'value') OuterEnumInteger get value; // enum valueEnum { 0, 1, 2, }; OuterObjectWithEnumProperty._(); - factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + factory OuterObjectWithEnumProperty( + [void updates(OuterObjectWithEnumPropertyBuilder b)]) = + _$OuterObjectWithEnumProperty; @BuiltValueHook(initializeBuilder: true) static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); + static Serializer get serializer => + _$OuterObjectWithEnumPropertySerializer(); } -class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { +class _$OuterObjectWithEnumPropertySerializer + implements PrimitiveSerializer { @override - final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + final Iterable types = const [ + OuterObjectWithEnumProperty, + _$OuterObjectWithEnumProperty + ]; @override final String wireName = r'OuterObjectWithEnumProperty'; @@ -55,7 +64,9 @@ class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer get serializer => _$ParentSerializer(); +} + +class _$ParentSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Parent]; + + @override + final String wireName = r'Parent'; + + Iterable _serializeProperties( + Serializers serializers, + Parent object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'fruitType'; + yield serializers.serialize( + object.fruitType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Parent object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); + } + + @override + Parent deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Parent)) + as $Parent; + } +} + +/// a concrete implementation of [Parent], since [Parent] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Parent implements Parent, Built<$Parent, $ParentBuilder> { + $Parent._(); + + factory $Parent([void Function($ParentBuilder)? updates]) = _$$Parent; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ParentBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Parent> get serializer => _$$ParentSerializer(); +} + +class _$$ParentSerializer implements PrimitiveSerializer<$Parent> { + @override + final Iterable types = const [$Parent, _$$Parent]; + + @override + final String wireName = r'$Parent'; + + @override + Object serialize( + Serializers serializers, + $Parent object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Parent))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ParentBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'fruitType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fruitType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Parent deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $ParentBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pasta.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pasta.dart index e8b1ebdf31ea..a7e314f1ec0b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pasta.dart @@ -12,7 +12,7 @@ part 'pasta.g.dart'; /// Pasta /// /// Properties: -/// * [vendor] +/// * [vendor] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -28,7 +28,7 @@ abstract class Pasta implements Entity, Built { factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PastaBuilder b) => b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); @@ -94,7 +94,9 @@ class _$PastaSerializer implements PrimitiveSerializer { Pasta object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -179,4 +181,3 @@ class _$PastaSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pet.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pet.dart index 4d6358bef27d..02aef0413a2f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pet.dart @@ -14,11 +14,11 @@ part 'pet.g.dart'; /// Pet /// /// Properties: -/// * [id] -/// * [category] -/// * [name] -/// * [photoUrls] -/// * [tags] +/// * [id] +/// * [category] +/// * [name] +/// * [photoUrls] +/// * [tags] /// * [status] - pet status in the store @BuiltValue() abstract class Pet implements Built { @@ -111,7 +111,9 @@ class _$PetSerializer implements PrimitiveSerializer { Pet object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -198,25 +200,27 @@ class _$PetSerializer implements PrimitiveSerializer { } class PetStatusEnum extends EnumClass { - /// pet status in the store @BuiltValueEnumConst(wireName: r'available') static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store @BuiltValueEnumConst(wireName: r'pending') static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store @BuiltValueEnumConst(wireName: r'sold') static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + static const PetStatusEnum unknownDefaultOpenApi = + _$petStatusEnum_unknownDefaultOpenApi; static Serializer get serializer => _$petStatusEnumSerializer; - const PetStatusEnum._(String name): super(name); + const PetStatusEnum._(String name) : super(name); static BuiltSet get values => _$petStatusEnumValues; static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza.dart index 14c06db06d7e..ca079abe8549 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza.dart @@ -13,7 +13,7 @@ part 'pizza.g.dart'; /// Pizza /// /// Properties: -/// * [pizzaSize] +/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,20 +35,21 @@ abstract class Pizza implements Entity { } extension PizzaDiscriminatorExt on Pizza { - String? get discriminatorValue { - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; } + return null; + } } + extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? get discriminatorValue { - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; } + return null; + } } class _$PizzaSerializer implements PrimitiveSerializer { @@ -112,9 +113,12 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { if (object is PizzaSpeziale) { - return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, + specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } @override @@ -125,12 +129,15 @@ class _$PizzaSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], + specifiedType: FullType(String)) as String; switch (discValue) { case r'PizzaSpeziale': - return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, + specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + return serializers.deserialize(serialized, + specifiedType: FullType($Pizza)) as $Pizza; } } } @@ -247,4 +254,3 @@ class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza_speziale.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza_speziale.dart index 673052cc8fcf..4c6fd7f38c26 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza_speziale.dart @@ -12,26 +12,30 @@ part 'pizza_speziale.g.dart'; /// PizzaSpeziale /// /// Properties: -/// * [toppings] +/// * [toppings] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class PizzaSpeziale implements Pizza, Built { +abstract class PizzaSpeziale + implements Pizza, Built { @BuiltValueField(wireName: r'toppings') String? get toppings; PizzaSpeziale._(); - factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = + _$PizzaSpeziale; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + static void _defaults(PizzaSpezialeBuilder b) => + b..atType = b.discriminatorValue; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PizzaSpezialeSerializer(); + static Serializer get serializer => + _$PizzaSpezialeSerializer(); } class _$PizzaSpezialeSerializer implements PrimitiveSerializer { @@ -101,7 +105,9 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { PizzaSpeziale object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -193,4 +199,3 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/read_only_first.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/read_only_first.dart index b619217ab3cb..b2501901295f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/read_only_first.dart @@ -11,10 +11,11 @@ part 'read_only_first.g.dart'; /// ReadOnlyFirst /// /// Properties: -/// * [bar] -/// * [baz] +/// * [bar] +/// * [baz] @BuiltValue() -abstract class ReadOnlyFirst implements Built { +abstract class ReadOnlyFirst + implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -23,13 +24,15 @@ abstract class ReadOnlyFirst implements Built b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReadOnlyFirstSerializer(); + static Serializer get serializer => + _$ReadOnlyFirstSerializer(); } class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { @@ -66,7 +69,9 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { ReadOnlyFirst object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +128,3 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart index b51e77292e8e..5324d92a7831 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart @@ -10,7 +10,6 @@ import 'package:built_value/serializer.dart'; part 'single_ref_type.g.dart'; class SingleRefType extends EnumClass { - @BuiltValueEnumConst(wireName: r'admin') static const SingleRefType admin = _$admin; @BuiltValueEnumConst(wireName: r'user') @@ -20,7 +19,7 @@ class SingleRefType extends EnumClass { static Serializer get serializer => _$singleRefTypeSerializer; - const SingleRefType._(String name): super(name); + const SingleRefType._(String name) : super(name); static BuiltSet get values => _$values; static SingleRefType valueOf(String name) => _$valueOf(name); @@ -33,4 +32,3 @@ class SingleRefType extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/special_model_name.dart similarity index 79% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/special_model_name.dart index fa860056b45d..c5a18443b89f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/special_model_name.dart @@ -11,24 +11,28 @@ part 'special_model_name.g.dart'; /// SpecialModelName /// /// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] @BuiltValue() -abstract class SpecialModelName implements Built { +abstract class SpecialModelName + implements Built { @BuiltValueField(wireName: r'$special[property.name]') int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; SpecialModelName._(); - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = + _$SpecialModelName; @BuiltValueHook(initializeBuilder: true) static void _defaults(SpecialModelNameBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialModelNameSerializer(); + static Serializer get serializer => + _$SpecialModelNameSerializer(); } -class _$SpecialModelNameSerializer implements PrimitiveSerializer { +class _$SpecialModelNameSerializer + implements PrimitiveSerializer { @override final Iterable types = const [SpecialModelName, _$SpecialModelName]; @@ -40,10 +44,13 @@ class _$SpecialModelNameSerializer implements PrimitiveSerializer { @BuiltValueField(wireName: r'id') @@ -66,7 +66,9 @@ class _$TagSerializer implements PrimitiveSerializer { Tag object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -123,4 +125,3 @@ class _$TagSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/user.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/user.dart index f7577d7e1ee9..5d10005382ff 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/user.dart @@ -11,13 +11,13 @@ part 'user.g.dart'; /// User /// /// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] /// * [userStatus] - User Status @BuiltValue() abstract class User implements Built { @@ -133,7 +133,9 @@ class _$UserSerializer implements PrimitiveSerializer { User object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + return _serializeProperties(serializers, object, + specifiedType: specifiedType) + .toList(); } void _deserializeProperties( @@ -232,4 +234,3 @@ class _$UserSerializer implements PrimitiveSerializer { return result.build(); } } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart similarity index 66% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart index fcfc669d1d66..c9630c637573 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/json_repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart @@ -1,3 +1,25 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize( + T src, + TypeInfo inputTypeInfo, { + Object? context, + }); + T deserialize( + Object value, + TypeInfo targetTypeInfo, { + Object? context, + }); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -43,13 +65,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart new file mode 100644 index 000000000000..099bd2c75d3c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'repository_base.dart'; +import 'serializers.dart'; + +/// Converts our `TypeInfo` to `built_value`'s `FullType` +FullType typeInfoToFullType(TypeInfo info) { + if (info.nullable) { + return FullType.nullable( + info.root, + info.parameters.map(typeInfoToFullType).toList(), + ); + } else { + return FullType( + info.root, + info.parameters.map(typeInfoToFullType).toList(), + ); + } +} + +class BuiltValueJsonRepository extends SerializationRepositoryBase { + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); + + @override + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; + } + + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart similarity index 62% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart index 6293a3c59699..1f4b9ed153f0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart @@ -17,26 +17,85 @@ part 'serializers.g.dart'; @SerializersFor([ AdditionalPropertiesClass, + Addressable, + $Addressable, AllOfWithSingleRef, - Animal,$Animal, + Animal, + $Animal, ApiResponse, + Apple, + AppleAllOfDisc, + AppleAnyOfDisc, + AppleGrandparentDisc, + AppleOneOfDisc, + AppleReqDisc, + AppleVariant1, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, + Banana, + BananaAllOfDisc, + BananaAnyOfDisc, + BananaGrandparentDisc, + BananaOneOfDisc, + BananaReqDisc, + Bar, + BarCreate, + BarRef, + BarRefOrValue, Capitalization, Cat, - CatAllOf,$CatAllOf, + CatAllOf, + $CatAllOf, Category, ClassModel, + ComposedDiscMissingFromProperties, + ComposedDiscOptionalTypeCorrect, + ComposedDiscOptionalTypeInconsistent, + ComposedDiscOptionalTypeIncorrect, + ComposedDiscRequiredInconsistent, + ComposedDiscTypeInconsistent, + ComposedDiscTypeIncorrect, DeprecatedObject, + DiscMissingFromProperties, + DiscOptionalTypeCorrect, + DiscOptionalTypeIncorrect, + DiscTypeIncorrect, Dog, - DogAllOf,$DogAllOf, + DogAllOf, + $DogAllOf, + Entity, + $Entity, + EntityRef, + $EntityRef, EnumArrays, EnumTest, + Extensible, + $Extensible, FileSchemaTestClass, Foo, - FooGetDefaultResponse, + FooBasicGetDefaultResponse, + FooRef, + FooRefOrValue, FormatTest, + Fruit, + FruitAllOfDisc, + FruitAnyOfDisc, + FruitGrandparentDisc, + FruitInlineDisc, + FruitInlineDiscOneOf, + FruitInlineDiscOneOf1, + FruitInlineInlineDisc, + FruitInlineInlineDiscOneOf, + FruitInlineInlineDiscOneOf1, + FruitInlineInlineDiscOneOfOneOf, + FruitOneOfDisc, + FruitReqDisc, + FruitType, + $FruitType, + FruitVariant1, + GigaOneOf, + GrapeVariant1, HasOnlyReadOnly, HealthCheckResult, MapTest, @@ -51,6 +110,7 @@ part 'serializers.g.dart'; NullableClass, NumberOnly, ObjectWithDeprecatedFields, + OneOfPrimitiveChild, Order, OuterComposite, OuterEnum, @@ -58,7 +118,13 @@ part 'serializers.g.dart'; OuterEnumInteger, OuterEnumIntegerDefaultValue, OuterObjectWithEnumProperty, + Parent, + $Parent, + Pasta, Pet, + Pizza, + $Pizza, + PizzaSpeziale, ReadOnlyFirst, SingleRefType, SpecialModelName, @@ -86,6 +152,10 @@ Serializers serializers = (_$serializers.toBuilder() const FullType(BuiltList, [FullType(Pet)]), () => ListBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(FooRefOrValue)]), + () => ListBuilder(), + ) ..addBuilderFactory( const FullType(BuiltMap, [FullType(String), FullType(int)]), () => MapBuilder(), @@ -98,9 +168,16 @@ Serializers serializers = (_$serializers.toBuilder() const FullType(BuiltList, [FullType(String)]), () => ListBuilder(), ) + ..add(Addressable.serializer) ..add(Animal.serializer) ..add(CatAllOf.serializer) ..add(DogAllOf.serializer) + ..add(Entity.serializer) + ..add(EntityRef.serializer) + ..add(Extensible.serializer) + ..add(FruitType.serializer) + ..add(Parent.serializer) + ..add(Pizza.serializer) ..add(const OneOfSerializer()) ..add(const AnyOfSerializer()) ..add(const DateSerializer()) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml b/samples/openapi3/client/petstore/dart-dio/dio/built_value/pom.xml similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/pom.xml index 3ae0ded6004b..c17c86ab7ff2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/pom.xml @@ -1,7 +1,7 @@ 4.0.0 org.openapitools - DartDioPetstoreClientLibFakeTests + DartDioBuiltValueTests pom 1.0.0-SNAPSHOT DartDio Petstore Client Lib Fake @@ -88,7 +88,7 @@ exec - ../petstore_client_lib_fake_tests + ../built_value_tests pub get @@ -102,7 +102,7 @@ exec - ../petstore_client_lib_fake_tests + ../built_value_tests dart format @@ -119,7 +119,7 @@ exec - ../petstore_client_lib_fake_tests + ../built_value_tests dart analyze @@ -134,7 +134,7 @@ exec - ../petstore_client_lib_fake_tests + ../built_value_tests dart test diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart index 696e26e8e549..657f7ee74448 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart @@ -18,6 +18,5 @@ void main() { test('to test the property `id`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart new file mode 100644 index 000000000000..31d86af790da --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleAllOfDisc +void main() { + final instance = AppleAllOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(AppleAllOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart new file mode 100644 index 000000000000..c3bd9cdf1cb0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleAnyOfDisc +void main() { + final instance = AppleAnyOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(AppleAnyOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart new file mode 100644 index 000000000000..840b36b8a4b1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleGrandparentDisc +void main() { + final instance = AppleGrandparentDiscBuilder(); + // TODO add properties to the builder and call build() + + group(AppleGrandparentDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart new file mode 100644 index 000000000000..8f753f5fdc83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleOneOfDisc +void main() { + final instance = AppleOneOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(AppleOneOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart new file mode 100644 index 000000000000..df1e3b7464e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleReqDisc +void main() { + final instance = AppleReqDiscBuilder(); + // TODO add properties to the builder and call build() + + group(AppleReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart index 1d542169550d..0949f55b7247 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `kind`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart new file mode 100644 index 000000000000..10f6a46f11ab --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleVariant1 +void main() { + final instance = AppleVariant1Builder(); + // TODO add properties to the builder and call build() + + group(AppleVariant1, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart new file mode 100644 index 000000000000..0dcd6419d9c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaAllOfDisc +void main() { + final instance = BananaAllOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(BananaAllOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart new file mode 100644 index 000000000000..dead79eb0cae --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaAnyOfDisc +void main() { + final instance = BananaAnyOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(BananaAnyOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart new file mode 100644 index 000000000000..01ad40b891bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaGrandparentDisc +void main() { + final instance = BananaGrandparentDiscBuilder(); + // TODO add properties to the builder and call build() + + group(BananaGrandparentDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart new file mode 100644 index 000000000000..be124eb7b4cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaOneOfDisc +void main() { + final instance = BananaOneOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(BananaOneOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart new file mode 100644 index 000000000000..a034fc27dafe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaReqDisc +void main() { + final instance = BananaReqDiscBuilder(); + // TODO add properties to the builder and call build() + + group(BananaReqDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart index a883acc0a9e8..34f4c1ca36ed 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart @@ -11,6 +11,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart index 73be91c446e0..4c2cb1de1f98 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for BarApi void main() { final instance = Openapi().getBarApi(); @@ -13,6 +12,5 @@ void main() { test('test createBar', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart index 1bf90151be8b..050dcadfb0f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart @@ -51,6 +51,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart index c132ac09943b..a6ceb001ec11 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart index 9c410b2b5c54..4a31ed0904b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart index dc6daaa3400d..616f922b5d14 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart @@ -50,6 +50,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_all_of_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..235e52fe31ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscMissingFromProperties +void main() { + final instance = ComposedDiscMissingFromPropertiesBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..e891898254db --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeCorrect +void main() { + final instance = ComposedDiscOptionalTypeCorrectBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart new file mode 100644 index 000000000000..668155d37edb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeInconsistent +void main() { + final instance = ComposedDiscOptionalTypeInconsistentBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscOptionalTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..464f2087ba4c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeIncorrect +void main() { + final instance = ComposedDiscOptionalTypeIncorrectBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart new file mode 100644 index 000000000000..695f83d060b2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscRequiredInconsistent +void main() { + final instance = ComposedDiscRequiredInconsistentBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscRequiredInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart new file mode 100644 index 000000000000..b4fd9265c3a3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeInconsistent +void main() { + final instance = ComposedDiscTypeInconsistentBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart new file mode 100644 index 000000000000..8ba06950f485 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeIncorrect +void main() { + final instance = ComposedDiscTypeIncorrectBuilder(); + // TODO add properties to the builder and call build() + + group(ComposedDiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart new file mode 100644 index 000000000000..4438ef5ca1f9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart @@ -0,0 +1,39 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooBasicGet() async + test('test fooBasicGet', () async { + // TODO + }); + + //Future list() async + test('test list', () async { + // TODO + }); + + //Future oneofGet() async + test('test oneofGet', () async { + // TODO + }); + + //Future test({ JsonObject body }) async + test('test test', () async { + // TODO + }); + + //Future variant1Get() async + test('test variant1Get', () async { + // TODO + }); + + //Future variant2Get() async + test('test variant2Get', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..cb7585a900db --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscMissingFromProperties +void main() { + final instance = DiscMissingFromPropertiesBuilder(); + // TODO add properties to the builder and call build() + + group(DiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..26592261616b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeCorrect +void main() { + final instance = DiscOptionalTypeCorrectBuilder(); + // TODO add properties to the builder and call build() + + group(DiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..80328bcc3736 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeIncorrect +void main() { + final instance = DiscOptionalTypeIncorrectBuilder(); + // TODO add properties to the builder and call build() + + group(DiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart new file mode 100644 index 000000000000..95d512049d06 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscTypeIncorrect +void main() { + final instance = DiscTypeIncorrectBuilder(); + // TODO add properties to the builder and call build() + + group(DiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_all_of_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart index 836289893fb4..ce3ed9868212 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart @@ -48,6 +48,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart index 30429747562d..ca7dd754f98d 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart index 75e6211e074b..158df10ac74e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart @@ -24,6 +24,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart index f33986a08b69..8712e0bcab98 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart @@ -1,7 +1,6 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; - /// tests for FooApi void main() { final instance = Openapi().getFooApi(); @@ -20,6 +19,5 @@ void main() { test('test getAllFoos', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart similarity index 64% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart index cea887a87fd8..c3c4e462c2c1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart @@ -1,12 +1,12 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; -// tests for FooGetDefaultResponse +// tests for FooBasicGetDefaultResponse void main() { - final instance = FooGetDefaultResponseBuilder(); + final instance = FooBasicGetDefaultResponseBuilder(); // TODO add properties to the builder and call build() - group(FooGetDefaultResponse, () { + group(FooBasicGetDefaultResponse, () { // Foo string test('to test the property `string`', () async { // TODO diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart index 029d030e5e35..bcee2f7eaee1 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart @@ -36,6 +36,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart index a1398787bbcb..b28c262c3e22 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart index 93a5286e2b45..0b491bb37b68 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart @@ -46,6 +46,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart new file mode 100644 index 000000000000..91acb802e671 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAllOfDisc +void main() { + final instance = FruitAllOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitAllOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart new file mode 100644 index 000000000000..908b3625f532 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAnyOfDisc +void main() { + final instance = FruitAnyOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitAnyOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart new file mode 100644 index 000000000000..2b161c37be72 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitGrandparentDisc +void main() { + final instance = FruitGrandparentDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitGrandparentDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..f71204d0bc79 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf1 +void main() { + final instance = FruitInlineDiscOneOf1Builder(); + // TODO add properties to the builder and call build() + + group(FruitInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..ecc76d47c479 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf +void main() { + final instance = FruitInlineDiscOneOfBuilder(); + // TODO add properties to the builder and call build() + + group(FruitInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart new file mode 100644 index 000000000000..9bf4923efddc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDisc +void main() { + final instance = FruitInlineDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitInlineDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..0d13e5318543 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf1 +void main() { + final instance = FruitInlineInlineDiscOneOf1Builder(); + // TODO add properties to the builder and call build() + + group(FruitInlineInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart new file mode 100644 index 000000000000..5b52a69fe7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOfOneOf +void main() { + final instance = FruitInlineInlineDiscOneOfOneOfBuilder(); + // TODO add properties to the builder and call build() + + group(FruitInlineInlineDiscOneOfOneOf, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..a19b0b4b7382 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf +void main() { + final instance = FruitInlineInlineDiscOneOfBuilder(); + // TODO add properties to the builder and call build() + + group(FruitInlineInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart new file mode 100644 index 000000000000..52fe8b9f1fea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDisc +void main() { + final instance = FruitInlineInlineDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitInlineInlineDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart new file mode 100644 index 000000000000..f9a7c1acc30e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitOneOfDisc +void main() { + final instance = FruitOneOfDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitOneOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart new file mode 100644 index 000000000000..1e5609b3a6aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitReqDisc +void main() { + final instance = FruitReqDiscBuilder(); + // TODO add properties to the builder and call build() + + group(FruitReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart index c18790ae9566..26b265ccb93f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart @@ -21,6 +21,5 @@ void main() { test('to test the property `count`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart new file mode 100644 index 000000000000..2079c036aa71 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitType +void main() { + //final instance = FruitTypeBuilder(); + // TODO add properties to the builder and call build() + + group(FruitType, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart new file mode 100644 index 000000000000..03f0f63ad365 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitVariant1 +void main() { + final instance = FruitVariant1Builder(); + // TODO add properties to the builder and call build() + + group(FruitVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart similarity index 74% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart index ccb35121143e..8888444f3139 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart @@ -1,16 +1,15 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; -// tests for Example +// tests for GigaOneOf void main() { - final instance = ExampleBuilder(); + final instance = GigaOneOfBuilder(); // TODO add properties to the builder and call build() - group(Example, () { + group(GigaOneOf, () { // String name test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart new file mode 100644 index 000000000000..13509d311d82 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for GrapeVariant1 +void main() { + final instance = GrapeVariant1Builder(); + // TODO add properties to the builder and call build() + + group(GrapeVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart index d1ad3e291dfa..574970b317ca 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart @@ -22,7 +22,7 @@ void main() { // TODO }); - // BuiltList bars + // BuiltList bars test('to test the property `bars`', () async { // TODO }); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart similarity index 67% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart index d40451a84c2c..78c841d1973c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart @@ -1,16 +1,15 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; -// tests for Child +// tests for OneOfPrimitiveChild void main() { - final instance = ChildBuilder(); + final instance = OneOfPrimitiveChildBuilder(); // TODO add properties to the builder and call build() - group(Child, () { + group(OneOfPrimitiveChild, () { // String name test('to test the property `name`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart new file mode 100644 index 000000000000..a1cacb130ef8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Parent +void main() { + //final instance = ParentBuilder(); + // TODO add properties to the builder and call build() + + group(Parent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart index 6a3ae338eec2..42de4a90e2fa 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart index 774320231c9e..c6a78cb12fc7 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart index 5c6e1af95a59..7e0b87b9ab5a 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart @@ -41,6 +41,5 @@ void main() { test('to test the property `atType`', () async { // TODO }); - }); } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/README.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml index 5079f6732cd4..1bf1491bd60e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml @@ -14,5 +14,5 @@ dev_dependencies: http_mock_adapter: 0.4.2 mockito: 5.2.0 openapi: - path: ../petstore_client_lib_fake + path: ../built_value test: 1.21.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/puby.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/puby.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/authentication_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/authentication_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..5b1bedef564d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES @@ -0,0 +1,244 @@ +.gitignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/Apple.md +doc/AppleAllOfDisc.md +doc/AppleAnyOfDisc.md +doc/AppleGrandparentDisc.md +doc/AppleOneOfDisc.md +doc/AppleReqDisc.md +doc/AppleVariant1.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/BananaAllOfDisc.md +doc/BananaAnyOfDisc.md +doc/BananaGrandparentDisc.md +doc/BananaOneOfDisc.md +doc/BananaReqDisc.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Capitalization.md +doc/Cat.md +doc/CatAllOf.md +doc/Category.md +doc/ClassModel.md +doc/ComposedDiscMissingFromProperties.md +doc/ComposedDiscOptionalTypeCorrect.md +doc/ComposedDiscOptionalTypeInconsistent.md +doc/ComposedDiscOptionalTypeIncorrect.md +doc/ComposedDiscRequiredInconsistent.md +doc/ComposedDiscTypeInconsistent.md +doc/ComposedDiscTypeIncorrect.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/DiscMissingFromProperties.md +doc/DiscOptionalTypeCorrect.md +doc/DiscOptionalTypeIncorrect.md +doc/DiscTypeIncorrect.md +doc/Dog.md +doc/DogAllOf.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Extensible.md +doc/FakeApi.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooApi.md +doc/FooBasicGetDefaultResponse.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.md +doc/FruitAllOfDisc.md +doc/FruitAnyOfDisc.md +doc/FruitGrandparentDisc.md +doc/FruitInlineDisc.md +doc/FruitInlineDiscOneOf.md +doc/FruitInlineDiscOneOf1.md +doc/FruitInlineInlineDisc.md +doc/FruitInlineInlineDiscOneOf.md +doc/FruitInlineInlineDiscOneOf1.md +doc/FruitInlineInlineDiscOneOfOneOf.md +doc/FruitOneOfDisc.md +doc/FruitReqDisc.md +doc/FruitType.md +doc/FruitVariant1.md +doc/GigaOneOf.md +doc/GrapeVariant1.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/OneOfPrimitiveChild.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Parent.md +doc/Pasta.md +doc/Pet.md +doc/PetApi.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +lib/apis.dart +lib/models.dart +lib/openapi.dart +lib/src/api/another_fake_api.dart +lib/src/api/bar_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/foo_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/api_client.dart +lib/src/api_util.dart +lib/src/auth/_exports.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.dart +lib/src/model/apple_all_of_disc.dart +lib/src/model/apple_any_of_disc.dart +lib/src/model/apple_grandparent_disc.dart +lib/src/model/apple_one_of_disc.dart +lib/src/model/apple_req_disc.dart +lib/src/model/apple_variant1.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/banana.dart +lib/src/model/banana_all_of_disc.dart +lib/src/model/banana_any_of_disc.dart +lib/src/model/banana_grandparent_disc.dart +lib/src/model/banana_one_of_disc.dart +lib/src/model/banana_req_disc.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/cat_all_of.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/composed_disc_missing_from_properties.dart +lib/src/model/composed_disc_optional_type_correct.dart +lib/src/model/composed_disc_optional_type_inconsistent.dart +lib/src/model/composed_disc_optional_type_incorrect.dart +lib/src/model/composed_disc_required_inconsistent.dart +lib/src/model/composed_disc_type_inconsistent.dart +lib/src/model/composed_disc_type_incorrect.dart +lib/src/model/deprecated_object.dart +lib/src/model/disc_missing_from_properties.dart +lib/src/model/disc_optional_type_correct.dart +lib/src/model/disc_optional_type_incorrect.dart +lib/src/model/disc_type_incorrect.dart +lib/src/model/dog.dart +lib/src/model/dog_all_of.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_basic_get_default_response.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.dart +lib/src/model/fruit_all_of_disc.dart +lib/src/model/fruit_any_of_disc.dart +lib/src/model/fruit_grandparent_disc.dart +lib/src/model/fruit_inline_disc.dart +lib/src/model/fruit_inline_disc_one_of.dart +lib/src/model/fruit_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc.dart +lib/src/model/fruit_inline_inline_disc_one_of.dart +lib/src/model/fruit_inline_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart +lib/src/model/fruit_one_of_disc.dart +lib/src/model/fruit_req_disc.dart +lib/src/model/fruit_type.dart +lib/src/model/fruit_variant1.dart +lib/src/model/giga_one_of.dart +lib/src/model/grape_variant1.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/one_of_primitive_child.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/parent.dart +lib/src/model/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +lib/src/repository_base.dart +lib/src/repository_impl.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md similarity index 73% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md index e9ab1f88f2df..63fc95b2f653 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md @@ -66,7 +66,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- [*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic | +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive | +[*DefaultApi*](doc/DefaultApi.md) | [**oneofGet**](doc/DefaultApi.md#oneofget) | **GET** /oneof | +[*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 | [*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | @@ -85,6 +91,8 @@ Class | Method | HTTP request | Description [*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data [*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | [*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos [*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store [*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet [*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -111,26 +119,77 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) - [Animal](doc/Animal.md) - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [AppleAllOfDisc](doc/AppleAllOfDisc.md) + - [AppleAnyOfDisc](doc/AppleAnyOfDisc.md) + - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) + - [AppleOneOfDisc](doc/AppleOneOfDisc.md) + - [AppleReqDisc](doc/AppleReqDisc.md) + - [AppleVariant1](doc/AppleVariant1.md) - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [BananaAllOfDisc](doc/BananaAllOfDisc.md) + - [BananaAnyOfDisc](doc/BananaAnyOfDisc.md) + - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) + - [BananaOneOfDisc](doc/BananaOneOfDisc.md) + - [BananaReqDisc](doc/BananaReqDisc.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) - [Capitalization](doc/Capitalization.md) - [Cat](doc/Cat.md) - [CatAllOf](doc/CatAllOf.md) - [Category](doc/Category.md) - [ClassModel](doc/ClassModel.md) + - [ComposedDiscMissingFromProperties](doc/ComposedDiscMissingFromProperties.md) + - [ComposedDiscOptionalTypeCorrect](doc/ComposedDiscOptionalTypeCorrect.md) + - [ComposedDiscOptionalTypeInconsistent](doc/ComposedDiscOptionalTypeInconsistent.md) + - [ComposedDiscOptionalTypeIncorrect](doc/ComposedDiscOptionalTypeIncorrect.md) + - [ComposedDiscRequiredInconsistent](doc/ComposedDiscRequiredInconsistent.md) + - [ComposedDiscTypeInconsistent](doc/ComposedDiscTypeInconsistent.md) + - [ComposedDiscTypeIncorrect](doc/ComposedDiscTypeIncorrect.md) - [DeprecatedObject](doc/DeprecatedObject.md) + - [DiscMissingFromProperties](doc/DiscMissingFromProperties.md) + - [DiscOptionalTypeCorrect](doc/DiscOptionalTypeCorrect.md) + - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) + - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) - [Dog](doc/Dog.md) - [DogAllOf](doc/DogAllOf.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) - [EnumArrays](doc/EnumArrays.md) - [EnumTest](doc/EnumTest.md) + - [Extensible](doc/Extensible.md) - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - [Foo](doc/Foo.md) - - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.md) + - [FruitAllOfDisc](doc/FruitAllOfDisc.md) + - [FruitAnyOfDisc](doc/FruitAnyOfDisc.md) + - [FruitGrandparentDisc](doc/FruitGrandparentDisc.md) + - [FruitInlineDisc](doc/FruitInlineDisc.md) + - [FruitInlineDiscOneOf](doc/FruitInlineDiscOneOf.md) + - [FruitInlineDiscOneOf1](doc/FruitInlineDiscOneOf1.md) + - [FruitInlineInlineDisc](doc/FruitInlineInlineDisc.md) + - [FruitInlineInlineDiscOneOf](doc/FruitInlineInlineDiscOneOf.md) + - [FruitInlineInlineDiscOneOf1](doc/FruitInlineInlineDiscOneOf1.md) + - [FruitInlineInlineDiscOneOfOneOf](doc/FruitInlineInlineDiscOneOfOneOf.md) + - [FruitOneOfDisc](doc/FruitOneOfDisc.md) + - [FruitReqDisc](doc/FruitReqDisc.md) + - [FruitType](doc/FruitType.md) + - [FruitVariant1](doc/FruitVariant1.md) + - [GigaOneOf](doc/GigaOneOf.md) + - [GrapeVariant1](doc/GrapeVariant1.md) - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - [HealthCheckResult](doc/HealthCheckResult.md) - [MapTest](doc/MapTest.md) @@ -145,6 +204,7 @@ Class | Method | HTTP request | Description - [NullableClass](doc/NullableClass.md) - [NumberOnly](doc/NumberOnly.md) - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [OneOfPrimitiveChild](doc/OneOfPrimitiveChild.md) - [Order](doc/Order.md) - [OuterComposite](doc/OuterComposite.md) - [OuterEnum](doc/OuterEnum.md) @@ -152,7 +212,11 @@ Class | Method | HTTP request | Description - [OuterEnumInteger](doc/OuterEnumInteger.md) - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Parent](doc/Parent.md) + - [Pasta](doc/Pasta.md) - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - [SpecialModelName](doc/SpecialModelName.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md new file mode 100644 index 000000000000..d8b9beee9f52 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md @@ -0,0 +1,16 @@ +# openapi.model.Addressable + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md new file mode 100644 index 000000000000..14d4a3415182 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md new file mode 100644 index 000000000000..0e7d4c990e48 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md new file mode 100644 index 000000000000..b49ab2f0fe8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md new file mode 100644 index 000000000000..41bb14fd764b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md new file mode 100644 index 000000000000..85eeb8a99eea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md new file mode 100644 index 000000000000..262c02ab50eb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md new file mode 100644 index 000000000000..82de5e6a492a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md @@ -0,0 +1,15 @@ +# openapi.model.AppleVariant1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md new file mode 100644 index 000000000000..cdae69466a61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md new file mode 100644 index 000000000000..668b2bf1af02 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md new file mode 100644 index 000000000000..8468888bf7e1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md new file mode 100644 index 000000000000..81bbb6cb54a6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md new file mode 100644 index 000000000000..951cc5839179 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md new file mode 100644 index 000000000000..574a3383916b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md new file mode 100644 index 000000000000..e0668151935d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md @@ -0,0 +1,22 @@ +# openapi.model.Bar + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md similarity index 55% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md index 6234ed44c660..16e6c66fcc10 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md @@ -1,4 +1,4 @@ -# openapi.api.DefaultApi +# openapi.api.BarApi ## Load the API package ```dart @@ -9,34 +9,38 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | +[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar -# **fooGet** -> FooGetDefaultResponse fooGet() - +# **createBar** +> Bar createBar(barCreate) +Create a Bar ### Example ```dart import 'package:openapi/openapi.dart'; -final api = Openapi().getDefaultApi(); +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | try { - final response = api.fooGet(); + final response = api.createBar(barCreate); print(response); } catch on DioError (e) { - print('Exception when calling DefaultApi->fooGet: $e\n'); + print('Exception when calling BarApi->createBar: $e\n'); } ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **barCreate** | [**BarCreate**](BarCreate.md)| | ### Return type -[**FooGetDefaultResponse**](FooGetDefaultResponse.md) +[**Bar**](Bar.md) ### Authorization @@ -44,7 +48,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md new file mode 100644 index 000000000000..bb0dbfd55790 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md @@ -0,0 +1,22 @@ +# openapi.model.BarCreate + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md index 05aa2b0bbc1c..b9eab1af1a9b 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md @@ -1,8 +1,8 @@ -# openapi.model.FooRefOrValueWithProperties +# openapi.model.BarRef ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md new file mode 100644 index 000000000000..fea6617a3c12 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md new file mode 100644 index 000000000000..4137cc1a0add --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..ab27d1c4473a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md new file mode 100644 index 000000000000..8c32b4c72b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..4f0fab65accc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md new file mode 100644 index 000000000000..bc60f26b183c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscRequiredInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md new file mode 100644 index 000000000000..0cdb9b880b9f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md new file mode 100644 index 000000000000..8000df558df6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md new file mode 100644 index 000000000000..8797cbaf624c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md @@ -0,0 +1,244 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/openapi.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooBasicGet**](DefaultApi.md#foobasicget) | **GET** /foo-basic | +[**list**](DefaultApi.md#list) | **GET** /oneof-primitive | +[**oneofGet**](DefaultApi.md#oneofget) | **GET** /oneof | +[**test**](DefaultApi.md#test) | **PUT** /variant1 | +[**variant1Get**](DefaultApi.md#variant1get) | **GET** /variant1 | +[**variant2Get**](DefaultApi.md#variant2get) | **GET** /variant2 | + + +# **fooBasicGet** +> FooBasicGetDefaultResponse fooBasicGet() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooBasicGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->fooBasicGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooBasicGetDefaultResponse**](FooBasicGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list** +> GigaOneOf list() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GigaOneOf**](GigaOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **oneofGet** +> Fruit oneofGet() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.oneofGet(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->oneofGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test** +> test(body) + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); +final Object body = ; // Object | + +try { + api.test(body); +} catch on DioError (e) { + print('Exception when calling DefaultApi->test: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant1Get** +> FruitVariant1 variant1Get() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant1Get(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->variant1Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitVariant1**](FruitVariant1.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant2Get** +> FruitAllOfDisc variant2Get() + + + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant2Get(); + print(response); +} catch on DioError (e) { + print('Exception when calling DefaultApi->variant2Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitAllOfDisc**](FruitAllOfDisc.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md new file mode 100644 index 000000000000..c38a5c2b5226 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.DiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..38601f552917 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..b6787edea47b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md new file mode 100644 index 000000000000..519a8e0333e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md new file mode 100644 index 000000000000..ccf43340ed10 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md @@ -0,0 +1,19 @@ +# openapi.model.Entity + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md new file mode 100644 index 000000000000..6fad4884910f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md @@ -0,0 +1,21 @@ +# openapi.model.EntityRef + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md new file mode 100644 index 000000000000..76e8c3340955 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md @@ -0,0 +1,17 @@ +# openapi.model.Extensible + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md new file mode 100644 index 000000000000..c03233a1b1df --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md @@ -0,0 +1,21 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md new file mode 100644 index 000000000000..7e072f6130a8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md @@ -0,0 +1,93 @@ +# openapi.api.FooApi + +## Load the API package +```dart +import 'package:openapi/openapi.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo +[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +# **createFoo** +> FooRefOrValue createFoo(foo) + +Create a Foo + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getFooApi(); +final Foo foo = ; // Foo | The Foo to be created + +try { + final response = api.createFoo(foo); + print(response); +} catch on DioError (e) { + print('Exception when calling FooApi->createFoo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] + +### Return type + +[**FooRefOrValue**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json;charset=utf-8 + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getAllFoos** +> List getAllFoos() + +GET all Foos + +### Example +```dart +import 'package:openapi/openapi.dart'; + +final api = Openapi().getFooApi(); + +try { + final response = api.getAllFoos(); + print(response); +} catch on DioError (e) { + print('Exception when calling FooApi->getAllFoos: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<FooRefOrValue>**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md index baf746b7dc5a..504630ea31a9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md @@ -1,4 +1,4 @@ -# openapi.model.FooGetDefaultResponse +# openapi.model.FooBasicGetDefaultResponse ## Load the model package ```dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md new file mode 100644 index 000000000000..d49ad9b8a84f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md new file mode 100644 index 000000000000..e79adafd24e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md new file mode 100644 index 000000000000..fd6be273d730 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md new file mode 100644 index 000000000000..f63fe99752c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAllOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md new file mode 100644 index 000000000000..c77b16556c53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md new file mode 100644 index 000000000000..ce9687bf5a6a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md new file mode 100644 index 000000000000..634614481813 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitInlineDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md new file mode 100644 index 000000000000..c842f7706c46 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md new file mode 100644 index 000000000000..2ab55f905a67 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md new file mode 100644 index 000000000000..a94f2de1f3bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md new file mode 100644 index 000000000000..511b8519164e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md new file mode 100644 index 000000000000..59d09becd314 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md new file mode 100644 index 000000000000..5267793720af --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDiscOneOfOneOf + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md new file mode 100644 index 000000000000..98c529e8c203 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitOneOfDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md new file mode 100644 index 000000000000..6ed06ec95a84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitReqDisc + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md new file mode 100644 index 000000000000..a5ac48ebfcef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md @@ -0,0 +1,15 @@ +# openapi.model.FruitType + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md new file mode 100644 index 000000000000..f56649903b0f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitVariant1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md index f35453bca5b0..c4148a9477f6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md @@ -1,4 +1,4 @@ -# openapi.model.Child +# openapi.model.GigaOneOf ## Load the model package ```dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md new file mode 100644 index 000000000000..ac6637c2a1c9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md @@ -0,0 +1,15 @@ +# openapi.model.GrapeVariant1 + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md index 14d075a0647c..4d793f522d22 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **uuid** | **String** | | [optional] **id** | **num** | | [optional] **deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | **List<String>** | | [optional] +**bars** | [**List<Bar>**](Bar.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md new file mode 100644 index 000000000000..cb1eec1c5b7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md @@ -0,0 +1,15 @@ +# openapi.model.OneOfPrimitiveChild + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md new file mode 100644 index 000000000000..cb343a1e4f5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md @@ -0,0 +1,15 @@ +# openapi.model.Parent + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md new file mode 100644 index 000000000000..027d4e96abe0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md @@ -0,0 +1,20 @@ +# openapi.model.Pasta + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md new file mode 100644 index 000000000000..a9a0163a18e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md @@ -0,0 +1,20 @@ +# openapi.model.Pizza + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..483cc83e301b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/openapi.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/apis.dart similarity index 81% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/apis.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/apis.dart index 21c64ae9bd39..4facc7ca3861 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/apis.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/apis.dart @@ -1,8 +1,10 @@ export 'package:openapi/src/api_client.dart'; export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/bar_api.dart'; export 'package:openapi/src/api/default_api.dart'; export 'package:openapi/src/api/fake_api.dart'; export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; export 'package:openapi/src/api/pet_api.dart'; export 'package:openapi/src/api/store_api.dart'; export 'package:openapi/src/api/user_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart new file mode 100644 index 000000000000..2916b476fde2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart @@ -0,0 +1,106 @@ +export 'package:openapi/src/repository_base.dart'; +export 'package:openapi/src/repository_impl.dart'; +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/apple_all_of_disc.dart'; +export 'package:openapi/src/model/apple_any_of_disc.dart'; +export 'package:openapi/src/model/apple_grandparent_disc.dart'; +export 'package:openapi/src/model/apple_one_of_disc.dart'; +export 'package:openapi/src/model/apple_req_disc.dart'; +export 'package:openapi/src/model/apple_variant1.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/banana_all_of_disc.dart'; +export 'package:openapi/src/model/banana_any_of_disc.dart'; +export 'package:openapi/src/model/banana_grandparent_disc.dart'; +export 'package:openapi/src/model/banana_one_of_disc.dart'; +export 'package:openapi/src/model/banana_req_disc.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/cat_all_of.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_correct.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/composed_disc_required_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_incorrect.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/disc_missing_from_properties.dart'; +export 'package:openapi/src/model/disc_optional_type_correct.dart'; +export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/disc_type_incorrect.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/dog_all_of.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_basic_get_default_response.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/fruit.dart'; +export 'package:openapi/src/model/fruit_all_of_disc.dart'; +export 'package:openapi/src/model/fruit_any_of_disc.dart'; +export 'package:openapi/src/model/fruit_grandparent_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +export 'package:openapi/src/model/fruit_one_of_disc.dart'; +export 'package:openapi/src/model/fruit_req_disc.dart'; +export 'package:openapi/src/model/fruit_type.dart'; +export 'package:openapi/src/model/fruit_variant1.dart'; +export 'package:openapi/src/model/giga_one_of.dart'; +export 'package:openapi/src/model/grape_variant1.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/one_of_primitive_child.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/parent.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart index 6c3dbb746aa8..1865b320d1b4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart @@ -2,7 +2,6 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart index 47ff15f3cfcc..e39fc0a1d7f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class AnotherFakeApi { - - final AnotherFakeApiRaw _rawApi; + final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; - const AnotherFakeApi(this._rawApi, this._repository); + const AnotherFakeApi(this.rawApi, this._repository); /// To test special tags /// To test special tags and operation ID starting with number @@ -29,7 +29,7 @@ class AnotherFakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -37,13 +37,11 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.call123testSpecialTags( - + final _response = await rawApi.call123testSpecialTags( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -52,16 +50,18 @@ class AnotherFakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -83,11 +83,9 @@ class AnotherFakeApi { extra: _response.extra, ); } - } class AnotherFakeApiRaw { - final Dio _dio; const AnotherFakeApiRaw(this._dio); @@ -106,10 +104,11 @@ class AnotherFakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -129,6 +128,7 @@ class AnotherFakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -141,7 +141,4 @@ class AnotherFakeApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart similarity index 74% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart index db921d6aa2f1..dff1f1dd4090 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart @@ -5,20 +5,22 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; -import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; -class DefaultApi { - - final DefaultApiRaw _rawApi; +class BarApi { + final BarApiRaw rawApi; final SerializationRepositoryBase _repository; - const DefaultApi(this._rawApi, this._repository); + const BarApi(this.rawApi, this._repository); - /// rootGet - /// + /// Create a Bar + /// /// /// Parameters: + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -26,36 +28,41 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioError] if API call or serialization fails - Future> rootGet({ + Future> createBar({ + required BarCreate barCreate, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.rootGet( - + }) async { + Object? _bodyData; + _bodyData = _repository.serialize(barCreate, const TypeInfo(BarCreate)); + final _response = await rawApi.createBar( + body: _bodyData, + requestContentType: 'application/json', cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); - Fruit? _responseData; + Bar? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Fruit), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Bar), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -66,7 +73,7 @@ class DefaultApi { ); } - return Response( + return Response( data: _responseData, headers: _response.headers, isRedirect: _response.isRedirect, @@ -77,19 +84,18 @@ class DefaultApi { extra: _response.extra, ); } - } -class DefaultApiRaw { - +class BarApiRaw { final Dio _dio; - const DefaultApiRaw(this._dio); + const BarApiRaw(this._dio); - /// rootGet - /// + /// Create a Bar + /// /// /// Parameters: + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -97,12 +103,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioError] if API call or serialization fails - Future> rootGet({ + Future> createBar({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -110,9 +117,9 @@ class DefaultApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/'; + final _path = r'/bar'; final _options = Options( - method: r'GET', + method: r'POST', headers: { if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, @@ -122,6 +129,7 @@ class DefaultApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -134,7 +142,4 @@ class DefaultApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart new file mode 100644 index 000000000000..ef47bea7024a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart @@ -0,0 +1,684 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; +import 'package:dio/dio.dart'; +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/model/foo_basic_get_default_response.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/fruit_all_of_disc.dart'; +import 'package:openapi/src/model/fruit_variant1.dart'; +import 'package:openapi/src/model/giga_one_of.dart'; + +class DefaultApi { + final DefaultApiRaw rawApi; + final SerializationRepositoryBase _repository; + + const DefaultApi(this.rawApi, this._repository); + + /// fooBasicGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> fooBasicGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.fooBasicGet( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooBasicGetDefaultResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FooBasicGetDefaultResponse), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data + /// Throws [DioError] if API call or serialization fails + Future> list({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.list( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + GigaOneOf? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(GigaOneOf), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// oneofGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioError] if API call or serialization fails + Future> oneofGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.oneofGet( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Fruit? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Fruit), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test + /// + /// + /// Parameters: + /// * [body] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> test({ + Object? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + Object? _bodyData; + _bodyData = body; + + final _response = await rawApi.test( + body: _bodyData, + requestContentType: 'application/json', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// variant1Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data + /// Throws [DioError] if API call or serialization fails + Future> variant1Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.variant1Get( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitVariant1? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FruitVariant1), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// variant2Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data + /// Throws [DioError] if API call or serialization fails + Future> variant2Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.variant2Get( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitAllOfDisc? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FruitAllOfDisc), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} + +class DefaultApiRaw { + final Dio _dio; + + const DefaultApiRaw(this._dio); + + /// fooBasicGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data + /// Throws [DioError] if API call or serialization fails + Future> fooBasicGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo-basic'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data + /// Throws [DioError] if API call or serialization fails + Future> list({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof-primitive'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// oneofGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioError] if API call or serialization fails + Future> oneofGet({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// test + /// + /// + /// Parameters: + /// * [body] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioError] if API call or serialization fails + Future> test({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'PUT', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// variant1Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data + /// Throws [DioError] if API call or serialization fails + Future> variant1Get({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// variant2Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data + /// Throws [DioError] if API call or serialization fails + Future> variant2Get({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant2'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart index b9d02a4ca3e7..1d163823885f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/file_schema_test_class.dart'; import 'package:openapi/src/model/health_check_result.dart'; @@ -16,14 +17,13 @@ import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; class FakeApi { - - final FakeApiRaw _rawApi; + final FakeApiRaw rawApi; final SerializationRepositoryBase _repository; - const FakeApi(this._rawApi, this._repository); + const FakeApi(this.rawApi, this._repository); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -35,34 +35,33 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.fakeHealthGet( - - + }) async { + final _response = await rawApi.fakeHealthGet( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(HealthCheckResult), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(HealthCheckResult), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -86,7 +85,7 @@ class FakeApi { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -101,7 +100,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ required Pet pet, String? query1, String? header1, @@ -111,15 +110,21 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.fakeHttpSignatureTest( - - query1: query1 == null ? null : _repository.encodeQueryParameter(query1, const TypeInfo(String)) , - header1: header1 == null ? null : _repository.encodeStringParameter(header1, const TypeInfo(String)) , + final _response = await rawApi.fakeHttpSignatureTest( + query1: query1 == null + ? null + : encodeQueryParameter( + _repository, + query1, + const TypeInfo(String), + ), + header1: header1 == null + ? null + : _repository.serialize(header1, const TypeInfo(String)).toString(), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -128,7 +133,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -147,7 +152,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ bool? body, CancelToken? cancelToken, Map? headers, @@ -155,13 +160,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterBooleanSerialize( - + final _response = await rawApi.fakeOuterBooleanSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -170,16 +173,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(bool), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(bool), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -216,7 +221,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ OuterComposite? outerComposite, CancelToken? cancelToken, Map? headers, @@ -224,13 +229,13 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = outerComposite == null ? null : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); + _bodyData = outerComposite == null + ? null + : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); - final _response = await _rawApi.fakeOuterCompositeSerialize( - + final _response = await rawApi.fakeOuterCompositeSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -239,16 +244,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(OuterComposite), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(OuterComposite), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -285,7 +292,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ num? body, CancelToken? cancelToken, Map? headers, @@ -293,13 +300,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterNumberSerialize( - + final _response = await rawApi.fakeOuterNumberSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -308,16 +313,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); num? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(num), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(num), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -354,7 +361,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ String? body, CancelToken? cancelToken, Map? headers, @@ -362,13 +369,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body; - final _response = await _rawApi.fakeOuterStringSerialize( - + final _response = await rawApi.fakeOuterStringSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -377,16 +382,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -423,7 +430,8 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + Future> + fakePropertyEnumIntegerSerialize({ required OuterObjectWithEnumProperty outerObjectWithEnumProperty, CancelToken? cancelToken, Map? headers, @@ -431,13 +439,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(outerObjectWithEnumProperty, const TypeInfo(OuterObjectWithEnumProperty)); + _bodyData = _repository.serialize(outerObjectWithEnumProperty, + const TypeInfo(OuterObjectWithEnumProperty)); - final _response = await _rawApi.fakePropertyEnumIntegerSerialize( - + final _response = await rawApi.fakePropertyEnumIntegerSerialize( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -446,16 +453,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterObjectWithEnumProperty? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(OuterObjectWithEnumProperty), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(OuterObjectWithEnumProperty), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -492,7 +501,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ MultipartFile? body, CancelToken? cancelToken, Map? headers, @@ -500,13 +509,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = body?.finalize(); - final _response = await _rawApi.testBodyWithBinary( - + final _response = await rawApi.testBodyWithBinary( body: _bodyData, requestContentType: 'image/png', cancelToken: cancelToken, @@ -515,7 +522,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -524,7 +531,7 @@ class FakeApi { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -534,7 +541,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ required FileSchemaTestClass fileSchemaTestClass, CancelToken? cancelToken, Map? headers, @@ -542,13 +549,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + _bodyData = _repository.serialize( + fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); - final _response = await _rawApi.testBodyWithFileSchema( - + final _response = await rawApi.testBodyWithFileSchema( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -557,17 +563,17 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -577,7 +583,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required String query, required User user, CancelToken? cancelToken, @@ -586,14 +592,16 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.testBodyWithQueryParams( - - query: _repository.encodeQueryParameter(query, const TypeInfo(String)) , + final _response = await rawApi.testBodyWithQueryParams( + query: encodeQueryParameter( + _repository, + query, + const TypeInfo(String), + ), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -602,7 +610,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -621,7 +629,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -629,13 +637,11 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.testClientModel( - + final _response = await rawApi.testClientModel( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -644,16 +650,18 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -676,8 +684,8 @@ class FakeApi { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -703,7 +711,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ required num number, required double double_, required String patternWithoutDelimiter, @@ -724,28 +732,46 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (integer != null) r'integer': _repository.encodeFormParameter(integer, const TypeInfo(int)), - if (int32 != null) r'int32': _repository.encodeFormParameter(int32, const TypeInfo(int)), - if (int64 != null) r'int64': _repository.encodeFormParameter(int64, const TypeInfo(int)), - r'number': _repository.encodeFormParameter(number, const TypeInfo(num)), - if (float != null) r'float': _repository.encodeFormParameter(float, const TypeInfo(double)), - r'double': _repository.encodeFormParameter(double_, const TypeInfo(double)), - if (string != null) r'string': _repository.encodeFormParameter(string, const TypeInfo(String)), - r'pattern_without_delimiter': _repository.encodeFormParameter(patternWithoutDelimiter, const TypeInfo(String)), - r'byte': _repository.encodeFormParameter(byte, const TypeInfo(String)), - if (binary != null) r'binary': _repository.encodeFormParameter(binary, const TypeInfo(MultipartFile)), - if (date != null) r'date': _repository.encodeFormParameter(date, const TypeInfo(DateTime)), - if (dateTime != null) r'dateTime': _repository.encodeFormParameter(dateTime, const TypeInfo(DateTime)), - if (password != null) r'password': _repository.encodeFormParameter(password, const TypeInfo(String)), - if (callback != null) r'callback': _repository.encodeFormParameter(callback, const TypeInfo(String)), + if (integer != null) + r'integer': + encodeFormParameter(_repository, integer, const TypeInfo(int)), + if (int32 != null) + r'int32': encodeFormParameter(_repository, int32, const TypeInfo(int)), + if (int64 != null) + r'int64': encodeFormParameter(_repository, int64, const TypeInfo(int)), + r'number': encodeFormParameter(_repository, number, const TypeInfo(num)), + if (float != null) + r'float': + encodeFormParameter(_repository, float, const TypeInfo(double)), + r'double': + encodeFormParameter(_repository, double_, const TypeInfo(double)), + if (string != null) + r'string': + encodeFormParameter(_repository, string, const TypeInfo(String)), + r'pattern_without_delimiter': encodeFormParameter( + _repository, patternWithoutDelimiter, const TypeInfo(String)), + r'byte': encodeFormParameter(_repository, byte, const TypeInfo(String)), + if (binary != null) + r'binary': encodeFormParameter( + _repository, binary, const TypeInfo(MultipartFile)), + if (date != null) + r'date': + encodeFormParameter(_repository, date, const TypeInfo(DateTime)), + if (dateTime != null) + r'dateTime': encodeFormParameter( + _repository, dateTime, const TypeInfo(DateTime)), + if (password != null) + r'password': + encodeFormParameter(_repository, password, const TypeInfo(String)), + if (callback != null) + r'callback': + encodeFormParameter(_repository, callback, const TypeInfo(String)), }; - final _response = await _rawApi.testEndpointParameters( - + final _response = await rawApi.testEndpointParameters( body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -754,7 +780,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -769,7 +795,7 @@ class FakeApi { /// * [enumQueryString] - Query parameter enum test (string) /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] + /// * [enumQueryModelArray] /// * [enumFormStringArray] - Form parameter enum test (string array) /// * [enumFormString] - Form parameter enum test (string) /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -781,7 +807,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ List? enumHeaderStringArray, String? enumHeaderString = '-efg', List? enumQueryStringArray, @@ -797,23 +823,68 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': _repository.encodeFormParameter(enumFormStringArray, const TypeInfo(String, [const TypeInfo(String)])), - if (enumFormString != null) r'enum_form_string': _repository.encodeFormParameter(enumFormString, const TypeInfo(String)), + if (enumFormStringArray != null) + r'enum_form_string_array': encodeFormParameter( + _repository, + enumFormStringArray, + const TypeInfo(String, [const TypeInfo(String)])), + if (enumFormString != null) + r'enum_form_string': encodeFormParameter( + _repository, enumFormString, const TypeInfo(String)), }; - final _response = await _rawApi.testEnumParameters( - - enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository.encodeStringParameter(enumHeaderStringArray, const TypeInfo(String, [const TypeInfo(String)])) , - enumHeaderString: enumHeaderString == null ? null : _repository.encodeStringParameter(enumHeaderString, const TypeInfo(String)) , - enumQueryStringArray: enumQueryStringArray == null ? null : _repository.encodeQueryParameter(enumQueryStringArray, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , - enumQueryString: enumQueryString == null ? null : _repository.encodeQueryParameter(enumQueryString, const TypeInfo(String)) , - enumQueryInteger: enumQueryInteger == null ? null : _repository.encodeQueryParameter(enumQueryInteger, const TypeInfo(int)) , - enumQueryDouble: enumQueryDouble == null ? null : _repository.encodeQueryParameter(enumQueryDouble, const TypeInfo(double)) , - enumQueryModelArray: enumQueryModelArray == null ? null : _repository.encodeQueryParameter(enumQueryModelArray, const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), context: ListFormat.multi) , + final _response = await rawApi.testEnumParameters( + enumHeaderStringArray: enumHeaderStringArray == null + ? null + : _repository + .serialize(enumHeaderStringArray, + const TypeInfo(String, [const TypeInfo(String)])) + .toString(), + enumHeaderString: enumHeaderString == null + ? null + : _repository + .serialize(enumHeaderString, const TypeInfo(String)) + .toString(), + enumQueryStringArray: enumQueryStringArray == null + ? null + : encodeQueryParameter( + _repository, + enumQueryStringArray, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.multi, + ), + enumQueryString: enumQueryString == null + ? null + : encodeQueryParameter( + _repository, + enumQueryString, + const TypeInfo(String), + ), + enumQueryInteger: enumQueryInteger == null + ? null + : encodeQueryParameter( + _repository, + enumQueryInteger, + const TypeInfo(int), + ), + enumQueryDouble: enumQueryDouble == null + ? null + : encodeQueryParameter( + _repository, + enumQueryDouble, + const TypeInfo(double), + ), + enumQueryModelArray: enumQueryModelArray == null + ? null + : encodeQueryParameter( + _repository, + enumQueryModelArray, + const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), + format: ListFormat.multi, + ), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -822,7 +893,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -846,7 +917,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required int requiredStringGroup, required bool requiredBooleanGroup, required int requiredInt64Group, @@ -859,30 +930,53 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.testGroupParameters( - - requiredStringGroup: _repository.encodeQueryParameter(requiredStringGroup, const TypeInfo(int)) , - requiredBooleanGroup: _repository.encodeStringParameter(requiredBooleanGroup, const TypeInfo(bool)) , - requiredInt64Group: _repository.encodeQueryParameter(requiredInt64Group, const TypeInfo(int)) , - stringGroup: stringGroup == null ? null : _repository.encodeQueryParameter(stringGroup, const TypeInfo(int)) , - booleanGroup: booleanGroup == null ? null : _repository.encodeStringParameter(booleanGroup, const TypeInfo(bool)) , - int64Group: int64Group == null ? null : _repository.encodeQueryParameter(int64Group, const TypeInfo(int)) , - + }) async { + final _response = await rawApi.testGroupParameters( + requiredStringGroup: encodeQueryParameter( + _repository, + requiredStringGroup, + const TypeInfo(int), + ), + requiredBooleanGroup: _repository + .serialize(requiredBooleanGroup, const TypeInfo(bool)) + .toString(), + requiredInt64Group: encodeQueryParameter( + _repository, + requiredInt64Group, + const TypeInfo(int), + ), + stringGroup: stringGroup == null + ? null + : encodeQueryParameter( + _repository, + stringGroup, + const TypeInfo(int), + ), + booleanGroup: booleanGroup == null + ? null + : _repository + .serialize(booleanGroup, const TypeInfo(bool)) + .toString(), + int64Group: int64Group == null + ? null + : encodeQueryParameter( + _repository, + int64Group, + const TypeInfo(int), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -895,7 +989,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ required Map requestBody, CancelToken? cancelToken, Map? headers, @@ -903,13 +997,12 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(requestBody, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + _bodyData = _repository.serialize(requestBody, + const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); - final _response = await _rawApi.testInlineAdditionalProperties( - + final _response = await rawApi.testInlineAdditionalProperties( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -918,13 +1011,13 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -938,7 +1031,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ required String param, required String param2, CancelToken? cancelToken, @@ -947,16 +1040,15 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - r'param': _repository.encodeFormParameter(param, const TypeInfo(String)), - r'param2': _repository.encodeFormParameter(param2, const TypeInfo(String)), + r'param': encodeFormParameter(_repository, param, const TypeInfo(String)), + r'param2': + encodeFormParameter(_repository, param2, const TypeInfo(String)), }; - final _response = await _rawApi.testJsonFormData( - + final _response = await rawApi.testJsonFormData( body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -965,7 +1057,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -974,13 +1066,13 @@ class FakeApi { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -990,7 +1082,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required List pipe, required List ioutil, required List http, @@ -1004,39 +1096,70 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.testQueryParameterCollectionFormat( - - pipe: _repository.encodeQueryParameter(pipe, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.pipes) , - ioutil: _repository.encodeQueryParameter(ioutil, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - http: _repository.encodeQueryParameter(http, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.ssv) , - url: _repository.encodeQueryParameter(url, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - context: _repository.encodeQueryParameter(context, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.multi) , - allowEmpty: _repository.encodeQueryParameter(allowEmpty, const TypeInfo(String)) , - language: language == null ? null : _repository.encodeQueryParameter(language, const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])) , - + }) async { + final _response = await rawApi.testQueryParameterCollectionFormat( + pipe: encodeQueryParameter( + _repository, + pipe, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.pipes, + ), + ioutil: encodeQueryParameter( + _repository, + ioutil, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), + http: encodeQueryParameter( + _repository, + http, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.ssv, + ), + url: encodeQueryParameter( + _repository, + url, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), + context: encodeQueryParameter( + _repository, + context, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.multi, + ), + allowEmpty: encodeQueryParameter( + _repository, + allowEmpty, + const TypeInfo(String), + ), + language: language == null + ? null + : encodeQueryParameter( + _repository, + language, + const TypeInfo( + String, [TypeInfo(String), const TypeInfo(String)]), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } - } class FakeApiRaw { - final Dio _dio; const FakeApiRaw(this._dio); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1048,10 +1171,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1071,6 +1195,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1085,7 +1210,7 @@ class FakeApiRaw { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -1100,12 +1225,13 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ Object? query1, String? header1, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1132,6 +1258,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1164,10 +1291,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1187,6 +1315,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1214,10 +1343,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1237,6 +1367,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1264,10 +1395,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1287,6 +1419,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1314,10 +1447,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1337,6 +1471,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1364,10 +1499,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + Future> fakePropertyEnumIntegerSerialize({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1387,6 +1523,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1414,10 +1551,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1437,6 +1575,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1454,7 +1593,7 @@ class FakeApiRaw { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1464,10 +1603,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1487,6 +1627,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1501,11 +1642,11 @@ class FakeApiRaw { } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1515,11 +1656,12 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required Object query, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1539,6 +1681,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1571,10 +1714,11 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1594,6 +1738,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1607,8 +1752,8 @@ class FakeApiRaw { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -1634,10 +1779,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1663,6 +1809,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1686,7 +1833,7 @@ class FakeApiRaw { /// * [enumQueryString] - Query parameter enum test (string) /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] + /// * [enumQueryModelArray] /// * [enumFormStringArray] - Form parameter enum test (string array) /// * [enumFormString] - Form parameter enum test (string) /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1698,7 +1845,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ String? enumHeaderStringArray, String? enumHeaderString, Object? enumQueryStringArray, @@ -1709,6 +1856,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1720,7 +1868,8 @@ class FakeApiRaw { final _options = Options( method: r'GET', headers: { - if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderStringArray != null) + r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, @@ -1730,15 +1879,18 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryStringArray != null) + r'enum_query_string_array': enumQueryStringArray, if (enumQueryString != null) r'enum_query_string': enumQueryString, if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, + if (enumQueryModelArray != null) + r'enum_query_model_array': enumQueryModelArray, }; return await _dio.request( @@ -1771,7 +1923,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required Object requiredStringGroup, required String requiredBooleanGroup, required Object requiredInt64Group, @@ -1781,6 +1933,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1808,6 +1961,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1830,7 +1984,7 @@ class FakeApiRaw { } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -1843,10 +1997,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1866,6 +2021,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1880,7 +2036,7 @@ class FakeApiRaw { } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -1894,10 +2050,11 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1917,6 +2074,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1934,13 +2092,13 @@ class FakeApiRaw { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1950,7 +2108,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required Object pipe, required Object ioutil, required Object http, @@ -1961,6 +2119,7 @@ class FakeApiRaw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1980,6 +2139,7 @@ class FakeApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -2003,7 +2163,4 @@ class FakeApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart index df883fef655f..48dcd4c0c139 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; class FakeClassnameTags123Api { - - final FakeClassnameTags123ApiRaw _rawApi; + final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; - const FakeClassnameTags123Api(this._rawApi, this._repository); + const FakeClassnameTags123Api(this.rawApi, this._repository); /// To test class name in snake case /// To test class name in snake case @@ -29,7 +29,7 @@ class FakeClassnameTags123Api { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -37,13 +37,11 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); - final _response = await _rawApi.testClassname( - + final _response = await rawApi.testClassname( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -52,16 +50,18 @@ class FakeClassnameTags123Api { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ModelClient), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -83,11 +83,9 @@ class FakeClassnameTags123Api { extra: _response.extra, ); } - } class FakeClassnameTags123ApiRaw { - final Dio _dio; const FakeClassnameTags123ApiRaw(this._dio); @@ -106,10 +104,11 @@ class FakeClassnameTags123ApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioError] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -136,6 +135,7 @@ class FakeClassnameTags123ApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -148,7 +148,4 @@ class FakeClassnameTags123ApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart new file mode 100644 index 000000000000..20314653dfe4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart @@ -0,0 +1,259 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; +import 'package:dio/dio.dart'; +import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/models.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; + +class FooApi { + final FooApiRaw rawApi; + final SerializationRepositoryBase _repository; + + const FooApi(this.rawApi, this._repository); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data + /// Throws [DioError] if API call or serialization fails + Future> createFoo({ + Foo? foo, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + Object? _bodyData; + _bodyData = + foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); + + final _response = await rawApi.createFoo( + body: _bodyData, + requestContentType: 'application/json;charset=utf-8', + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooRefOrValue? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(FooRefOrValue), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// GET all Foos + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioError] if API call or serialization fails + Future>> getAllFoos({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _response = await rawApi.getAllFoos( + cancelToken: cancelToken, + headers: headers, + extra: extra, + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(List, [const TypeInfo(FooRefOrValue)]), + ); + } catch (error, stackTrace) { + throw DioError( + requestOptions: _response.requestOptions, + response: _response, + type: DioErrorType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } +} + +class FooApiRaw { + final Dio _dio; + + const FooApiRaw(this._dio); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data + /// Throws [DioError] if API call or serialization fails + Future> createFoo({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + /// GET all Foos + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioError] if API call or serialization fails + Future> getAllFoos({ + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + ); + + return await _dio.request( + _path, + data: body, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart similarity index 86% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart index 3467f68be294..2df778c0a647 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart @@ -5,19 +5,19 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/api_response.dart'; import 'package:openapi/src/model/pet.dart'; class PetApi { - - final PetApiRaw _rawApi; + final PetApiRaw rawApi; final SerializationRepositoryBase _repository; - const PetApi(this._rawApi, this._repository); + const PetApi(this.rawApi, this._repository); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -30,7 +30,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> addPet({ + Future> addPet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -38,13 +38,11 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.addPet( - + final _response = await rawApi.addPet( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -53,17 +51,17 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -73,7 +71,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required int petId, String? apiKey, CancelToken? cancelToken, @@ -82,20 +80,19 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deletePet( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), - apiKey: apiKey == null ? null : _repository.encodeStringParameter(apiKey, const TypeInfo(String)) , - + }) async { + final _response = await rawApi.deletePet( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + apiKey: apiKey == null + ? null + : _repository.serialize(apiKey, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -114,7 +111,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ + Future>> findPetsByStatus({ @Deprecated('status is deprecated') required List status, CancelToken? cancelToken, Map? headers, @@ -122,28 +119,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.findPetsByStatus( - - status: _repository.encodeQueryParameter(status, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - + }) async { + final _response = await rawApi.findPetsByStatus( + status: encodeQueryParameter( + _repository, + status, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); List? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(List, [const TypeInfo(Pet)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(List, [const TypeInfo(Pet)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -181,7 +182,7 @@ class PetApi { /// Returns a [Future] containing a [Response] with a [Set] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ + Future>> findPetsByTags({ required Set tags, CancelToken? cancelToken, Map? headers, @@ -189,28 +190,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.findPetsByTags( - - tags: _repository.encodeQueryParameter(tags, const TypeInfo(String, [const TypeInfo(String)]), context: ListFormat.csv) , - + }) async { + final _response = await rawApi.findPetsByTags( + tags: encodeQueryParameter( + _repository, + tags, + const TypeInfo(String, [const TypeInfo(String)]), + format: ListFormat.csv, + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Set? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Set, [const TypeInfo(Pet)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Set, [const TypeInfo(Pet)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -247,7 +252,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required int petId, CancelToken? cancelToken, Map? headers, @@ -255,28 +260,27 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getPetById( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), - + }) async { + final _response = await rawApi.getPetById( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Pet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Pet), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Pet), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -300,7 +304,7 @@ class PetApi { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -313,7 +317,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -321,13 +325,11 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); - final _response = await _rawApi.updatePet( - + final _response = await rawApi.updatePet( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -336,13 +338,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -357,7 +359,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required int petId, String? name, String? status, @@ -367,17 +369,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = { - if (name != null) r'name': _repository.encodeFormParameter(name, const TypeInfo(String)), - if (status != null) r'status': _repository.encodeFormParameter(status, const TypeInfo(String)), + if (name != null) + r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), + if (status != null) + r'status': + encodeFormParameter(_repository, status, const TypeInfo(String)), }; - final _response = await _rawApi.updatePetWithForm( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.updatePetWithForm( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -386,13 +389,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -407,7 +410,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required int petId, String? additionalMetadata, MultipartFile? file, @@ -417,17 +420,17 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (additionalMetadata != null) + r'additionalMetadata': encodeFormParameter( + _repository, additionalMetadata, const TypeInfo(String)), if (file != null) r'file': file, }); - final _response = await _rawApi.uploadFile( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.uploadFile( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -436,16 +439,18 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -469,7 +474,7 @@ class PetApi { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -484,7 +489,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, String? additionalMetadata, @@ -494,17 +499,17 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': _repository.encodeFormParameter(additionalMetadata, const TypeInfo(String)), + if (additionalMetadata != null) + r'additionalMetadata': encodeFormParameter( + _repository, additionalMetadata, const TypeInfo(String)), r'requiredFile': requiredFile, }); - final _response = await _rawApi.uploadFileWithRequiredFile( - - petId: _repository.encodeStringParameter(petId, const TypeInfo(int)), + final _response = await rawApi.uploadFileWithRequiredFile( + petId: _repository.serialize(petId, const TypeInfo(int)).toString(), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -513,16 +518,18 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(ApiResponse), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -544,17 +551,15 @@ class PetApi { extra: _response.extra, ); } - } class PetApiRaw { - final Dio _dio; const PetApiRaw(this._dio); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -567,10 +572,11 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> addPet({ + Future> addPet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -595,6 +601,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -609,11 +616,11 @@ class PetApiRaw { } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -623,12 +630,13 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required String petId, String? apiKey, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -636,7 +644,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -654,6 +663,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -681,11 +691,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioError] if API call or serialization fails - Future> findPetsByStatus({ + Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -710,6 +721,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -743,11 +755,12 @@ class PetApiRaw { /// Returns a [Future] containing a [Response] with a [Set] as data /// Throws [DioError] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future> findPetsByTags({ + Future> findPetsByTags({ required Object tags, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -772,6 +785,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -804,11 +818,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioError] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -816,7 +831,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'GET', headers: { @@ -835,6 +851,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -849,7 +866,7 @@ class PetApiRaw { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -862,10 +879,11 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -890,6 +908,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -904,7 +923,7 @@ class PetApiRaw { } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -919,11 +938,12 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -931,7 +951,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = + r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -948,6 +969,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -962,7 +984,7 @@ class PetApiRaw { } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -977,11 +999,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -989,7 +1012,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}/uploadImage' + .replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1006,6 +1030,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1020,7 +1045,7 @@ class PetApiRaw { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1035,11 +1060,12 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1047,7 +1073,8 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/fake/{petId}/uploadImageWithRequiredFile' + .replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1064,6 +1091,7 @@ class PetApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -1076,7 +1104,4 @@ class PetApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart index 95822c260137..5c749f4f277a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/order.dart'; class StoreApi { - - final StoreApiRaw _rawApi; + final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; - const StoreApi(this._rawApi, this._repository); + const StoreApi(this.rawApi, this._repository); /// Delete purchase order by ID /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -29,7 +29,7 @@ class StoreApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, CancelToken? cancelToken, Map? headers, @@ -37,19 +37,17 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deleteOrder( - - orderId: _repository.encodeStringParameter(orderId, const TypeInfo(String)), - + }) async { + final _response = await rawApi.deleteOrder( + orderId: + _repository.serialize(orderId, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -67,34 +65,33 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Map] as data /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getInventory( - - + }) async { + final _response = await rawApi.getInventory( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Map? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Map, [TypeInfo(String), const TypeInfo(int)]), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Map, [TypeInfo(String), const TypeInfo(int)]), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -131,7 +128,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required int orderId, CancelToken? cancelToken, Map? headers, @@ -139,28 +136,27 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getOrderById( - - orderId: _repository.encodeStringParameter(orderId, const TypeInfo(int)), - + }) async { + final _response = await rawApi.getOrderById( + orderId: _repository.serialize(orderId, const TypeInfo(int)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -184,7 +180,7 @@ class StoreApi { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -197,7 +193,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ required Order order, CancelToken? cancelToken, Map? headers, @@ -205,13 +201,11 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(order, const TypeInfo(Order)); - final _response = await _rawApi.placeOrder( - + final _response = await rawApi.placeOrder( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -220,16 +214,18 @@ class StoreApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(Order), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -251,11 +247,9 @@ class StoreApi { extra: _response.extra, ); } - } class StoreApiRaw { - final Dio _dio; const StoreApiRaw(this._dio); @@ -274,11 +268,12 @@ class StoreApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -286,7 +281,8 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}' + .replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -298,6 +294,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -324,10 +321,11 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Map] as data /// Throws [DioError] if API call or serialization fails - Future> getInventory({ + Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -354,6 +352,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -381,11 +380,12 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -393,7 +393,8 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}' + .replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'GET', headers: { @@ -405,6 +406,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -419,7 +421,7 @@ class StoreApiRaw { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -432,10 +434,11 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -455,6 +458,7 @@ class StoreApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -467,7 +471,4 @@ class StoreApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart index aed55577c146..c5bd11a4ef64 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart @@ -5,15 +5,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:openapi/src/repository_base.dart'; +import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/user.dart'; class UserApi { - - final UserApiRaw _rawApi; + final UserApiRaw rawApi; final SerializationRepositoryBase _repository; - const UserApi(this._rawApi, this._repository); + const UserApi(this.rawApi, this._repository); /// Create user /// This can only be done by the logged in user. @@ -29,7 +29,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUser({ + Future> createUser({ required User user, CancelToken? cancelToken, Map? headers, @@ -37,13 +37,11 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.createUser( - + final _response = await rawApi.createUser( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -52,13 +50,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -71,7 +69,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ required List user, CancelToken? cancelToken, Map? headers, @@ -79,13 +77,12 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + _bodyData = _repository.serialize( + user, const TypeInfo(User, [const TypeInfo(User)])); - final _response = await _rawApi.createUsersWithArrayInput( - + final _response = await rawApi.createUsersWithArrayInput( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -94,13 +91,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -113,7 +110,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ required List user, CancelToken? cancelToken, Map? headers, @@ -121,13 +118,12 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User, [const TypeInfo(User)])); + _bodyData = _repository.serialize( + user, const TypeInfo(User, [const TypeInfo(User)])); - final _response = await _rawApi.createUsersWithListInput( - + final _response = await rawApi.createUsersWithListInput( body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -136,7 +132,7 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -155,7 +151,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, CancelToken? cancelToken, Map? headers, @@ -163,25 +159,23 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.deleteUser( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), - + }) async { + final _response = await rawApi.deleteUser( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -194,7 +188,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, CancelToken? cancelToken, Map? headers, @@ -202,28 +196,28 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.getUserByName( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), - + }) async { + final _response = await rawApi.getUserByName( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); User? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(User), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(User), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -247,7 +241,7 @@ class UserApi { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -261,7 +255,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required String username, required String password, CancelToken? cancelToken, @@ -270,29 +264,36 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.loginUser( - - username: _repository.encodeQueryParameter(username, const TypeInfo(String)) , - password: _repository.encodeQueryParameter(password, const TypeInfo(String)) , - + }) async { + final _response = await rawApi.loginUser( + username: encodeQueryParameter( + _repository, + username, + const TypeInfo(String), + ), + password: encodeQueryParameter( + _repository, + password, + const TypeInfo(String), + ), cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + _responseData = rawResponse == null + ? null + : _repository.deserialize( + rawResponse, + const TypeInfo(String), + ); } catch (error, stackTrace) { throw DioError( requestOptions: _response.requestOptions, @@ -316,7 +317,7 @@ class UserApi { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -328,25 +329,22 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.logoutUser( - - + }) async { + final _response = await rawApi.logoutUser( cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -366,7 +364,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, required User user, CancelToken? cancelToken, @@ -375,14 +373,13 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { - + }) async { Object? _bodyData; _bodyData = _repository.serialize(user, const TypeInfo(User)); - final _response = await _rawApi.updateUser( - - username: _repository.encodeStringParameter(username, const TypeInfo(String)), + final _response = await rawApi.updateUser( + username: + _repository.serialize(username, const TypeInfo(String)).toString(), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -391,15 +388,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } - } class UserApiRaw { - final Dio _dio; const UserApiRaw(this._dio); @@ -418,10 +413,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUser({ + Future> createUser({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -441,6 +437,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -455,7 +452,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -468,10 +465,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -491,6 +489,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -505,7 +504,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -518,10 +517,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -541,6 +541,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -568,11 +569,12 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -580,7 +582,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'DELETE', headers: { @@ -592,6 +595,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -606,7 +610,7 @@ class UserApiRaw { } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -619,11 +623,12 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -631,7 +636,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'GET', headers: { @@ -643,6 +649,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -657,7 +664,7 @@ class UserApiRaw { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -671,12 +678,13 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioError] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required Object username, required Object password, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -696,6 +704,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -716,7 +725,7 @@ class UserApiRaw { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -728,10 +737,11 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -751,6 +761,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -779,11 +790,12 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioError] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -791,7 +803,8 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}' + .replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'PUT', headers: { @@ -803,6 +816,7 @@ class UserApiRaw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, ); @@ -815,7 +829,4 @@ class UserApiRaw { onReceiveProgress: onReceiveProgress, ); } - } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_client.dart similarity index 74% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_client.dart index e766e712faec..0d86bd46b0bd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_client.dart @@ -15,7 +15,6 @@ class Openapi { final Dio dio; final SerializationRepositoryBase serializationRepository; - Openapi({ Dio? dio, SerializationRepositoryBase? serializationRepositoryOverride, @@ -26,7 +25,9 @@ class Openapi { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { + )), + this.serializationRepository = + serializationRepositoryOverride ?? JsonSerializableRepository() { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -41,25 +42,36 @@ class Openapi { void setOAuthToken(String name, String token) { if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) + as OAuthInterceptor) + .tokens[name] = token; } } void setBearerAuth(String name, String token) { if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) + as BearerAuthInterceptor) + .tokens[name] = token; } } void setBasicAuth(String name, String username, String password) { if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) + as BasicAuthInterceptor) + .authInfo[name] = BasicAuthInfo(username, password); } } void setApiKey(String name, String apiKey) { if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + (this + .dio + .interceptors + .firstWhere((element) => element is ApiKeyAuthInterceptor) + as ApiKeyAuthInterceptor) + .apiKeys[name] = apiKey; } } @@ -69,6 +81,12 @@ class Openapi { return AnotherFakeApi(AnotherFakeApiRaw(dio), serializationRepository); } + /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(BarApiRaw(dio), serializationRepository); + } + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed DefaultApi getDefaultApi() { @@ -84,7 +102,14 @@ class Openapi { /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); + return FakeClassnameTags123Api( + FakeClassnameTags123ApiRaw(dio), serializationRepository); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(FooApiRaw(dio), serializationRepository); } /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart new file mode 100644 index 000000000000..056ba3bcd8ec --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart @@ -0,0 +1,61 @@ +import 'package:dio/dio.dart'; +import 'dart:convert'; +import 'package:openapi/models.dart'; +import 'dart:typed_data'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +Object encodeFormParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +Object encodeQueryParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +ListParam encodeCollectionQueryParameter( + SerializationRepositoryBase repository, + Iterable value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = repository.serialize( + value, + type, + ); + if (serialized is Iterable) { + return ListParam(serialized.toList(), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/_exports.dart similarity index 83% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/_exports.dart index f038e92358ef..7219f2ecefa2 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/_exports.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/_exports.dart @@ -2,4 +2,4 @@ export 'api_key_auth.dart'; export 'basic_auth.dart'; export 'oauth.dart'; export 'bearer_auth.dart'; -export 'auth.dart'; \ No newline at end of file +export 'auth.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart index ee16e3f0f92f..312a5ad42602 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart @@ -2,7 +2,6 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - import 'package:dio/dio.dart'; import 'package:openapi/src/auth/auth.dart'; @@ -11,7 +10,8 @@ class ApiKeyAuthInterceptor extends AuthInterceptor { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + final authInfo = + getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); for (final info in authInfo) { final authName = info['name'] as String; final authKeyName = info['keyName'] as String; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart similarity index 80% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart index f7ae9bf3f11e..c6fcca595cb3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart @@ -8,7 +8,8 @@ abstract class AuthInterceptor extends Interceptor { /// Get auth information on given route for the given type. /// Can return an empty list if type is not present on auth data or /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + List> getAuthInfo( + RequestOptions route, bool Function(Map secure) handles) { if (route.extra.containsKey('secure')) { final auth = route.extra['secure'] as List>; return auth.where((secure) => handles(secure)).toList(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart similarity index 70% rename from samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart index b6e6dce04f9c..07b9efc0df0c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart @@ -22,12 +22,17 @@ class BasicAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + final metadataAuthInfo = getAuthInfo( + options, + (secure) => + (secure['type'] == 'http' && secure['scheme'] == 'basic') || + secure['type'] == 'basic'); for (final info in metadataAuthInfo) { final authName = info['name'] as String; final basicAuthInfo = authInfo[authName]; if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + final basicAuth = + 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; options.headers['Authorization'] = basicAuth; break; } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart index 1d4402b376c0..6723de5020d3 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart @@ -13,7 +13,8 @@ class BearerAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart similarity index 82% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart index 337cf762b0ce..44403e3358be 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart @@ -13,7 +13,8 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, + (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart similarity index 57% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart index a3d4df084be5..52aae4f3674b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'additional_properties_class.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,28 @@ part 'additional_properties_class.g.dart'; class AdditionalPropertiesClass { /// Returns a new [AdditionalPropertiesClass] instance. AdditionalPropertiesClass({ - - this.mapProperty, - - this.mapOfMapProperty, + this.mapProperty, + this.mapOfMapProperty, }); - @JsonKey( - - name: r'map_property', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'map_property', required: false, includeIfNull: false) final Map? mapProperty; - - - @JsonKey( - - name: r'map_of_map_property', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'map_of_map_property', required: false, includeIfNull: false) final Map>? mapOfMapProperty; - - @override - bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && - other.mapProperty == mapProperty && - other.mapOfMapProperty == mapOfMapProperty; + bool operator ==(Object other) => + identical(this, other) || + other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; @override - int get hashCode => - mapProperty.hashCode + - mapOfMapProperty.hashCode; + int get hashCode => mapProperty.hashCode + mapOfMapProperty.hashCode; - factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + factory AdditionalPropertiesClass.fromJson(Map json) => + _$AdditionalPropertiesClassFromJson(json); Map toJson() => _$AdditionalPropertiesClassToJson(this); @@ -65,6 +45,4 @@ class AdditionalPropertiesClass { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart new file mode 100644 index 000000000000..1558e6f5e9dc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'addressable.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Addressable { + /// Returns a new [Addressable] instance. + Addressable({ + this.href, + this.id, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Addressable && other.href == href && other.id == id; + + @override + int get hashCode => href.hashCode + id.hashCode; + + factory Addressable.fromJson(Map json) => + _$AddressableFromJson(json); + + Map toJson() => _$AddressableToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart similarity index 58% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart index b654a66733e9..9fec7e666068 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -8,7 +8,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'all_of_with_single_ref.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -18,47 +17,28 @@ part 'all_of_with_single_ref.g.dart'; class AllOfWithSingleRef { /// Returns a new [AllOfWithSingleRef] instance. AllOfWithSingleRef({ - - this.username, - - this.singleRefType, + this.username, + this.singleRefType, }); - @JsonKey( - - name: r'username', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'username', required: false, includeIfNull: false) final String? username; - - - @JsonKey( - - name: r'SingleRefType', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'SingleRefType', required: false, includeIfNull: false) final SingleRefType? singleRefType; - - @override - bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && - other.username == username && - other.singleRefType == singleRefType; + bool operator ==(Object other) => + identical(this, other) || + other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; @override - int get hashCode => - username.hashCode + - singleRefType.hashCode; + int get hashCode => username.hashCode + singleRefType.hashCode; - factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); + factory AllOfWithSingleRef.fromJson(Map json) => + _$AllOfWithSingleRefFromJson(json); Map toJson() => _$AllOfWithSingleRefToJson(this); @@ -66,6 +46,4 @@ class AllOfWithSingleRef { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart similarity index 58% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart index 22a196ce7d7f..464ac70be575 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'animal.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,45 +16,27 @@ part 'animal.g.dart'; class Animal { /// Returns a new [Animal] instance. Animal({ - - required this.className, - - this.color = 'red', + required this.className, + this.color = 'red', }); - @JsonKey( - - name: r'className', - required: true, - includeIfNull: false - ) - - + @JsonKey(name: r'className', required: true, includeIfNull: false) final String className; - - @JsonKey( - defaultValue: 'red', - name: r'color', - required: false, - includeIfNull: false - ) - - + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) final String? color; - - @override - bool operator ==(Object other) => identical(this, other) || other is Animal && - other.className == className && - other.color == color; + bool operator ==(Object other) => + identical(this, other) || + other is Animal && other.className == className && other.color == color; @override - int get hashCode => - className.hashCode + - color.hashCode; + int get hashCode => className.hashCode + color.hashCode; factory Animal.fromJson(Map json) => _$AnimalFromJson(json); @@ -65,6 +46,4 @@ class Animal { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..df7b51101d80 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,53 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + this.code, + this.type, + this.message, + }); + + @JsonKey(name: r'code', required: false, includeIfNull: false) + final int? code; + + @JsonKey(name: r'type', required: false, includeIfNull: false) + final String? type; + + @JsonKey(name: r'message', required: false, includeIfNull: false) + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => code.hashCode + type.hashCode + message.hashCode; + + factory ApiResponse.fromJson(Map json) => + _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart new file mode 100644 index 000000000000..81be695b9bba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Apple { + /// Returns a new [Apple] instance. + Apple({ + this.kind, + }); + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Apple && other.kind == kind; + + @override + int get hashCode => kind.hashCode; + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + Map toJson() => _$AppleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart new file mode 100644 index 000000000000..6be847e87750 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_all_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleAllOfDisc { + /// Returns a new [AppleAllOfDisc] instance. + AppleAllOfDisc({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppleAllOfDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory AppleAllOfDisc.fromJson(Map json) => + _$AppleAllOfDiscFromJson(json); + + Map toJson() => _$AppleAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart new file mode 100644 index 000000000000..f72bede8dd8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_any_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleAnyOfDisc { + /// Returns a new [AppleAnyOfDisc] instance. + AppleAnyOfDisc({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppleAnyOfDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory AppleAnyOfDisc.fromJson(Map json) => + _$AppleAnyOfDiscFromJson(json); + + Map toJson() => _$AppleAnyOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart new file mode 100644 index 000000000000..3793b2338e7a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_grandparent_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleGrandparentDisc { + /// Returns a new [AppleGrandparentDisc] instance. + AppleGrandparentDisc({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppleGrandparentDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory AppleGrandparentDisc.fromJson(Map json) => + _$AppleGrandparentDiscFromJson(json); + + Map toJson() => _$AppleGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart new file mode 100644 index 000000000000..4f9ee97f3529 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_one_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleOneOfDisc { + /// Returns a new [AppleOneOfDisc] instance. + AppleOneOfDisc({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppleOneOfDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory AppleOneOfDisc.fromJson(Map json) => + _$AppleOneOfDiscFromJson(json); + + Map toJson() => _$AppleOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart new file mode 100644 index 000000000000..47e4238aec8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_req_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleReqDisc { + /// Returns a new [AppleReqDisc] instance. + AppleReqDisc({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppleReqDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory AppleReqDisc.fromJson(Map json) => + _$AppleReqDiscFromJson(json); + + Map toJson() => _$AppleReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart new file mode 100644 index 000000000000..bf5f5208a0fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_variant1.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleVariant1 { + /// Returns a new [AppleVariant1] instance. + AppleVariant1({ + this.kind, + }); + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @override + bool operator ==(Object other) => + identical(this, other) || other is AppleVariant1 && other.kind == kind; + + @override + int get hashCode => kind.hashCode; + + factory AppleVariant1.fromJson(Map json) => + _$AppleVariant1FromJson(json); + + Map toJson() => _$AppleVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart similarity index 64% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart index 7372be1583f2..879bd5274b61 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'array_of_array_of_number_only.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,23 @@ part 'array_of_array_of_number_only.g.dart'; class ArrayOfArrayOfNumberOnly { /// Returns a new [ArrayOfArrayOfNumberOnly] instance. ArrayOfArrayOfNumberOnly({ - - this.arrayArrayNumber, + this.arrayArrayNumber, }); - @JsonKey( - - name: r'ArrayArrayNumber', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'ArrayArrayNumber', required: false, includeIfNull: false) final List>? arrayArrayNumber; - - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && - other.arrayArrayNumber == arrayArrayNumber; + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; @override - int get hashCode => - arrayArrayNumber.hashCode; + int get hashCode => arrayArrayNumber.hashCode; - factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfArrayOfNumberOnlyFromJson(json); Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); @@ -49,6 +40,4 @@ class ArrayOfArrayOfNumberOnly { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart similarity index 66% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart index d538bb312fde..a1dea32fe74d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'array_of_number_only.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,22 @@ part 'array_of_number_only.g.dart'; class ArrayOfNumberOnly { /// Returns a new [ArrayOfNumberOnly] instance. ArrayOfNumberOnly({ - - this.arrayNumber, + this.arrayNumber, }); - @JsonKey( - - name: r'ArrayNumber', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'ArrayNumber', required: false, includeIfNull: false) final List? arrayNumber; - - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && - other.arrayNumber == arrayNumber; + bool operator ==(Object other) => + identical(this, other) || + other is ArrayOfNumberOnly && other.arrayNumber == arrayNumber; @override - int get hashCode => - arrayNumber.hashCode; + int get hashCode => arrayNumber.hashCode; - factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + factory ArrayOfNumberOnly.fromJson(Map json) => + _$ArrayOfNumberOnlyFromJson(json); Map toJson() => _$ArrayOfNumberOnlyToJson(this); @@ -49,6 +39,4 @@ class ArrayOfNumberOnly { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..bc0f83a42051 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + this.arrayOfString, + this.arrayArrayOfInteger, + this.arrayArrayOfModel, + }); + + @JsonKey(name: r'array_of_string', required: false, includeIfNull: false) + final List? arrayOfString; + + @JsonKey( + name: r'array_array_of_integer', required: false, includeIfNull: false) + final List>? arrayArrayOfInteger; + + @JsonKey(name: r'array_array_of_model', required: false, includeIfNull: false) + final List>? arrayArrayOfModel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; + + factory ArrayTest.fromJson(Map json) => + _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart new file mode 100644 index 000000000000..41fbfb80acc1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Banana { + /// Returns a new [Banana] instance. + Banana({ + this.count, + }); + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Banana && other.count == count; + + @override + int get hashCode => count.hashCode; + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + Map toJson() => _$BananaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart new file mode 100644 index 000000000000..1ed8ad86f1f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_all_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaAllOfDisc { + /// Returns a new [BananaAllOfDisc] instance. + BananaAllOfDisc({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BananaAllOfDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory BananaAllOfDisc.fromJson(Map json) => + _$BananaAllOfDiscFromJson(json); + + Map toJson() => _$BananaAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart new file mode 100644 index 000000000000..6daf21610594 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_any_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaAnyOfDisc { + /// Returns a new [BananaAnyOfDisc] instance. + BananaAnyOfDisc({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BananaAnyOfDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory BananaAnyOfDisc.fromJson(Map json) => + _$BananaAnyOfDiscFromJson(json); + + Map toJson() => _$BananaAnyOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart new file mode 100644 index 000000000000..368fe57f6de7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_grandparent_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaGrandparentDisc { + /// Returns a new [BananaGrandparentDisc] instance. + BananaGrandparentDisc({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BananaGrandparentDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory BananaGrandparentDisc.fromJson(Map json) => + _$BananaGrandparentDiscFromJson(json); + + Map toJson() => _$BananaGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart new file mode 100644 index 000000000000..ab658900b312 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_one_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaOneOfDisc { + /// Returns a new [BananaOneOfDisc] instance. + BananaOneOfDisc({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BananaOneOfDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory BananaOneOfDisc.fromJson(Map json) => + _$BananaOneOfDiscFromJson(json); + + Map toJson() => _$BananaOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart new file mode 100644 index 000000000000..07c69a82b090 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_req_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaReqDisc { + /// Returns a new [BananaReqDisc] instance. + BananaReqDisc({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BananaReqDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory BananaReqDisc.fromJson(Map json) => + _$BananaReqDiscFromJson(json); + + Map toJson() => _$BananaReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart new file mode 100644 index 000000000000..39a28a166b7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Bar { + /// Returns a new [Bar] instance. + Bar({ + required this.id, + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Bar && + other.id == id && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + id.hashCode + + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + Map toJson() => _$BarToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..69f8c91e9158 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_create.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarCreate { + /// Returns a new [BarCreate] instance. + BarCreate({ + this.barPropA, + this.fooPropB, + this.foo, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'barPropA', required: false, includeIfNull: false) + final String? barPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + @JsonKey(name: r'foo', required: false, includeIfNull: false) + final FooRefOrValue? foo; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarCreate && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarCreate.fromJson(Map json) => + _$BarCreateFromJson(json); + + Map toJson() => _$BarCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..441f1475ed91 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRef { + /// Returns a new [BarRef] instance. + BarRef({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRef && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + Map toJson() => _$BarRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..2a31af86fb87 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRefOrValue { + /// Returns a new [BarRefOrValue] instance. + BarRefOrValue({ + this.href, + required this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: true, includeIfNull: false) + final String id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BarRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRefOrValue.fromJson(Map json) => + _$BarRefOrValueFromJson(json); + + Map toJson() => _$BarRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..dc4ed957e2a0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + this.smallCamel, + this.capitalCamel, + this.smallSnake, + this.capitalSnake, + this.sCAETHFlowPoints, + this.ATT_NAME, + }); + + @JsonKey(name: r'smallCamel', required: false, includeIfNull: false) + final String? smallCamel; + + @JsonKey(name: r'CapitalCamel', required: false, includeIfNull: false) + final String? capitalCamel; + + @JsonKey(name: r'small_Snake', required: false, includeIfNull: false) + final String? smallSnake; + + @JsonKey(name: r'Capital_Snake', required: false, includeIfNull: false) + final String? capitalSnake; + + @JsonKey(name: r'SCA_ETH_Flow_Points', required: false, includeIfNull: false) + final String? sCAETHFlowPoints; + + /// Name of the pet + @JsonKey(name: r'ATT_NAME', required: false, includeIfNull: false) + final String? ATT_NAME; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; + + factory Capitalization.fromJson(Map json) => + _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart similarity index 53% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart index 0b176faf313e..8e0612fb641a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart @@ -10,7 +10,6 @@ part 'cat.g.dart'; // ignore_for_file: unused_import - @JsonSerializable( checked: true, createToJson: true, @@ -20,61 +19,34 @@ part 'cat.g.dart'; class Cat { /// Returns a new [Cat] instance. Cat({ - - required this.className, - - this.color = 'red', - - this.declawed, + required this.className, + this.color = 'red', + this.declawed, }); - @JsonKey( - - name: r'className', - required: true, - includeIfNull: false - ) - - + @JsonKey(name: r'className', required: true, includeIfNull: false) final String className; - - @JsonKey( - defaultValue: 'red', - name: r'color', - required: false, - includeIfNull: false - ) - - + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) final String? color; - - - @JsonKey( - - name: r'declawed', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'declawed', required: false, includeIfNull: false) final bool? declawed; - - @override - bool operator ==(Object other) => identical(this, other) || other is Cat && - other.className == className && - other.color == color && - other.declawed == declawed; + bool operator ==(Object other) => + identical(this, other) || + other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; @override - int get hashCode => - className.hashCode + - color.hashCode + - declawed.hashCode; + int get hashCode => className.hashCode + color.hashCode + declawed.hashCode; factory Cat.fromJson(Map json) => _$CatFromJson(json); @@ -84,6 +56,4 @@ class Cat { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart index abb9dbc25e5f..af380b83994a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'cat_all_of.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,21 @@ part 'cat_all_of.g.dart'; class CatAllOf { /// Returns a new [CatAllOf] instance. CatAllOf({ - - this.declawed, + this.declawed, }); - @JsonKey( - - name: r'declawed', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'declawed', required: false, includeIfNull: false) final bool? declawed; - - @override - bool operator ==(Object other) => identical(this, other) || other is CatAllOf && - other.declawed == declawed; + bool operator ==(Object other) => + identical(this, other) || other is CatAllOf && other.declawed == declawed; @override - int get hashCode => - declawed.hashCode; + int get hashCode => declawed.hashCode; - factory CatAllOf.fromJson(Map json) => _$CatAllOfFromJson(json); + factory CatAllOf.fromJson(Map json) => + _$CatAllOfFromJson(json); Map toJson() => _$CatAllOfToJson(this); @@ -49,6 +38,4 @@ class CatAllOf { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart similarity index 52% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart index b94c61579909..9d95e6d6ef77 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'category.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,30 @@ part 'category.g.dart'; class Category { /// Returns a new [Category] instance. Category({ - - this.id, - - this.name = 'default-name', + this.id, + this.name = 'default-name', }); - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'id', required: false, includeIfNull: false) final int? id; - - @JsonKey( - defaultValue: 'default-name', - name: r'name', - required: true, - includeIfNull: false - ) - - + defaultValue: 'default-name', + name: r'name', + required: true, + includeIfNull: false) final String name; - - @override - bool operator ==(Object other) => identical(this, other) || other is Category && - other.id == id && - other.name == name; + bool operator ==(Object other) => + identical(this, other) || + other is Category && other.id == id && other.name == name; @override - int get hashCode => - id.hashCode + - name.hashCode; + int get hashCode => id.hashCode + name.hashCode; - factory Category.fromJson(Map json) => _$CategoryFromJson(json); + factory Category.fromJson(Map json) => + _$CategoryFromJson(json); Map toJson() => _$CategoryToJson(this); @@ -65,6 +47,4 @@ class Category { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart index 01837bfcca96..67d589a1edc0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'class_model.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,21 @@ part 'class_model.g.dart'; class ClassModel { /// Returns a new [ClassModel] instance. ClassModel({ - - this.class_, + this.class_, }); - @JsonKey( - - name: r'_class', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'_class', required: false, includeIfNull: false) final String? class_; - - @override - bool operator ==(Object other) => identical(this, other) || other is ClassModel && - other.class_ == class_; + bool operator ==(Object other) => + identical(this, other) || other is ClassModel && other.class_ == class_; @override - int get hashCode => - class_.hashCode; + int get hashCode => class_.hashCode; - factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + factory ClassModel.fromJson(Map json) => + _$ClassModelFromJson(json); Map toJson() => _$ClassModelToJson(this); @@ -49,6 +38,4 @@ class ClassModel { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart new file mode 100644 index 000000000000..08e1308faee9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_missing_from_properties.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_missing_from_properties.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscMissingFromProperties { + /// Returns a new [ComposedDiscMissingFromProperties] instance. + ComposedDiscMissingFromProperties({ + this.length, + }); + + @JsonKey(name: r'length', required: false, includeIfNull: false) + final int? length; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscMissingFromProperties && other.length == length; + + @override + int get hashCode => length.hashCode; + + factory ComposedDiscMissingFromProperties.fromJson( + Map json) => + _$ComposedDiscMissingFromPropertiesFromJson(json); + + Map toJson() => + _$ComposedDiscMissingFromPropertiesToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart new file mode 100644 index 000000000000..21f028fb862e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_correct.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeCorrect { + /// Returns a new [ComposedDiscOptionalTypeCorrect] instance. + ComposedDiscOptionalTypeCorrect({ + this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: false, includeIfNull: false) + final String? fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscOptionalTypeCorrect && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscOptionalTypeCorrect.fromJson(Map json) => + _$ComposedDiscOptionalTypeCorrectFromJson(json); + + Map toJson() => + _$ComposedDiscOptionalTypeCorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart new file mode 100644 index 000000000000..a4f6010c43c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_inconsistent.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeInconsistent { + /// Returns a new [ComposedDiscOptionalTypeInconsistent] instance. + ComposedDiscOptionalTypeInconsistent({ + this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: false, includeIfNull: false) + final String? fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscOptionalTypeInconsistent && + other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscOptionalTypeInconsistent.fromJson( + Map json) => + _$ComposedDiscOptionalTypeInconsistentFromJson(json); + + Map toJson() => + _$ComposedDiscOptionalTypeInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..48f2553073f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_incorrect.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeIncorrect { + /// Returns a new [ComposedDiscOptionalTypeIncorrect] instance. + ComposedDiscOptionalTypeIncorrect({ + this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: false, includeIfNull: false) + final int? fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscOptionalTypeIncorrect && + other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscOptionalTypeIncorrect.fromJson( + Map json) => + _$ComposedDiscOptionalTypeIncorrectFromJson(json); + + Map toJson() => + _$ComposedDiscOptionalTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart new file mode 100644 index 000000000000..f87716aa362b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_required_inconsistent.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscRequiredInconsistent { + /// Returns a new [ComposedDiscRequiredInconsistent] instance. + ComposedDiscRequiredInconsistent({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscRequiredInconsistent && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscRequiredInconsistent.fromJson( + Map json) => + _$ComposedDiscRequiredInconsistentFromJson(json); + + Map toJson() => + _$ComposedDiscRequiredInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart new file mode 100644 index 000000000000..5b440eba4b64 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_type_inconsistent.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscTypeInconsistent { + /// Returns a new [ComposedDiscTypeInconsistent] instance. + ComposedDiscTypeInconsistent({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscTypeInconsistent && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscTypeInconsistent.fromJson(Map json) => + _$ComposedDiscTypeInconsistentFromJson(json); + + Map toJson() => _$ComposedDiscTypeInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart new file mode 100644 index 000000000000..8a992123ac93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_type_incorrect.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscTypeIncorrect { + /// Returns a new [ComposedDiscTypeIncorrect] instance. + ComposedDiscTypeIncorrect({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final int fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ComposedDiscTypeIncorrect && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory ComposedDiscTypeIncorrect.fromJson(Map json) => + _$ComposedDiscTypeIncorrectFromJson(json); + + Map toJson() => _$ComposedDiscTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart similarity index 69% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart index 0151b72e23a1..f50ea7760763 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'deprecated_object.g.dart'; - @Deprecated('DeprecatedObject has been deprecated') @JsonSerializable( checked: true, @@ -18,31 +17,21 @@ part 'deprecated_object.g.dart'; class DeprecatedObject { /// Returns a new [DeprecatedObject] instance. DeprecatedObject({ - - this.name, + this.name, }); - @JsonKey( - - name: r'name', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'name', required: false, includeIfNull: false) final String? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && - other.name == name; + bool operator ==(Object other) => + identical(this, other) || other is DeprecatedObject && other.name == name; @override - int get hashCode => - name.hashCode; + int get hashCode => name.hashCode; - factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + factory DeprecatedObject.fromJson(Map json) => + _$DeprecatedObjectFromJson(json); Map toJson() => _$DeprecatedObjectToJson(this); @@ -50,6 +39,4 @@ class DeprecatedObject { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart new file mode 100644 index 000000000000..2f681cebf74d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_missing_from_properties.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscMissingFromProperties { + /// Returns a new [DiscMissingFromProperties] instance. + DiscMissingFromProperties({ + this.length, + }); + + @JsonKey(name: r'length', required: false, includeIfNull: false) + final int? length; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DiscMissingFromProperties && other.length == length; + + @override + int get hashCode => length.hashCode; + + factory DiscMissingFromProperties.fromJson(Map json) => + _$DiscMissingFromPropertiesFromJson(json); + + Map toJson() => _$DiscMissingFromPropertiesToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart new file mode 100644 index 000000000000..8f8a23825311 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_optional_type_correct.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscOptionalTypeCorrect { + /// Returns a new [DiscOptionalTypeCorrect] instance. + DiscOptionalTypeCorrect({ + this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: false, includeIfNull: false) + final String? fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DiscOptionalTypeCorrect && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory DiscOptionalTypeCorrect.fromJson(Map json) => + _$DiscOptionalTypeCorrectFromJson(json); + + Map toJson() => _$DiscOptionalTypeCorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..3a9fe6ccc87b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_optional_type_incorrect.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscOptionalTypeIncorrect { + /// Returns a new [DiscOptionalTypeIncorrect] instance. + DiscOptionalTypeIncorrect({ + this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: false, includeIfNull: false) + final int? fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DiscOptionalTypeIncorrect && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory DiscOptionalTypeIncorrect.fromJson(Map json) => + _$DiscOptionalTypeIncorrectFromJson(json); + + Map toJson() => _$DiscOptionalTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart new file mode 100644 index 000000000000..da5e8dbd17cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_type_incorrect.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscTypeIncorrect { + /// Returns a new [DiscTypeIncorrect] instance. + DiscTypeIncorrect({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final int fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DiscTypeIncorrect && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory DiscTypeIncorrect.fromJson(Map json) => + _$DiscTypeIncorrectFromJson(json); + + Map toJson() => _$DiscTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart similarity index 54% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart index a049d0479fb0..394340b11eb9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart @@ -10,7 +10,6 @@ part 'dog.g.dart'; // ignore_for_file: unused_import - @JsonSerializable( checked: true, createToJson: true, @@ -20,61 +19,34 @@ part 'dog.g.dart'; class Dog { /// Returns a new [Dog] instance. Dog({ - - required this.className, - - this.color = 'red', - - this.breed, + required this.className, + this.color = 'red', + this.breed, }); - @JsonKey( - - name: r'className', - required: true, - includeIfNull: false - ) - - + @JsonKey(name: r'className', required: true, includeIfNull: false) final String className; - - @JsonKey( - defaultValue: 'red', - name: r'color', - required: false, - includeIfNull: false - ) - - + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false) final String? color; - - - @JsonKey( - - name: r'breed', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'breed', required: false, includeIfNull: false) final String? breed; - - @override - bool operator ==(Object other) => identical(this, other) || other is Dog && - other.className == className && - other.color == color && - other.breed == breed; + bool operator ==(Object other) => + identical(this, other) || + other is Dog && + other.className == className && + other.color == color && + other.breed == breed; @override - int get hashCode => - className.hashCode + - color.hashCode + - breed.hashCode; + int get hashCode => className.hashCode + color.hashCode + breed.hashCode; factory Dog.fromJson(Map json) => _$DogFromJson(json); @@ -84,6 +56,4 @@ class Dog { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart index 19bd4c0267be..39065be80707 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'dog_all_of.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,21 @@ part 'dog_all_of.g.dart'; class DogAllOf { /// Returns a new [DogAllOf] instance. DogAllOf({ - - this.breed, + this.breed, }); - @JsonKey( - - name: r'breed', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'breed', required: false, includeIfNull: false) final String? breed; - - @override - bool operator ==(Object other) => identical(this, other) || other is DogAllOf && - other.breed == breed; + bool operator ==(Object other) => + identical(this, other) || other is DogAllOf && other.breed == breed; @override - int get hashCode => - breed.hashCode; + int get hashCode => breed.hashCode; - factory DogAllOf.fromJson(Map json) => _$DogAllOfFromJson(json); + factory DogAllOf.fromJson(Map json) => + _$DogAllOfFromJson(json); Map toJson() => _$DogAllOfToJson(this); @@ -49,6 +38,4 @@ class DogAllOf { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart new file mode 100644 index 000000000000..9bba5eff8b34 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Entity { + /// Returns a new [Entity] instance. + Entity({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Entity && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Entity.fromJson(Map json) => _$EntityFromJson(json); + + Map toJson() => _$EntityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..32901f43eaa9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity_ref.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EntityRef { + /// Returns a new [EntityRef] instance. + EntityRef({ + this.name, + this.atReferredType, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Name of the related entity. + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + /// The actual type of the target instance when needed for disambiguation. + @JsonKey(name: r'@referredType', required: false, includeIfNull: false) + final String? atReferredType; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EntityRef && + other.name == name && + other.atReferredType == atReferredType && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + name.hashCode + + atReferredType.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory EntityRef.fromJson(Map json) => + _$EntityRefFromJson(json); + + Map toJson() => _$EntityRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart similarity index 62% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart index a97d069a3d25..4a9ce1458928 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'enum_arrays.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,28 @@ part 'enum_arrays.g.dart'; class EnumArrays { /// Returns a new [EnumArrays] instance. EnumArrays({ - - this.justSymbol, - - this.arrayEnum, + this.justSymbol, + this.arrayEnum, }); - @JsonKey( - - name: r'just_symbol', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'just_symbol', required: false, includeIfNull: false) final EnumArraysJustSymbolEnum? justSymbol; - - - @JsonKey( - - name: r'array_enum', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'array_enum', required: false, includeIfNull: false) final List? arrayEnum; - - @override - bool operator ==(Object other) => identical(this, other) || other is EnumArrays && - other.justSymbol == justSymbol && - other.arrayEnum == arrayEnum; + bool operator ==(Object other) => + identical(this, other) || + other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; @override - int get hashCode => - justSymbol.hashCode + - arrayEnum.hashCode; + int get hashCode => justSymbol.hashCode + arrayEnum.hashCode; - factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + factory EnumArrays.fromJson(Map json) => + _$EnumArraysFromJson(json); Map toJson() => _$EnumArraysToJson(this); @@ -65,10 +45,8 @@ class EnumArrays { String toString() { return toJson().toString(); } - } - enum EnumArraysJustSymbolEnum { @JsonValue(r'>=') greaterThanEqual, @@ -78,8 +56,6 @@ enum EnumArraysJustSymbolEnum { unknownDefaultOpenApi, } - - enum EnumArraysArrayEnumEnum { @JsonValue(r'fish') fish, @@ -88,5 +64,3 @@ enum EnumArraysArrayEnumEnum { @JsonValue(r'unknown_default_open_api') unknownDefaultOpenApi, } - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart similarity index 50% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart index 80555c14d038..926b40e5977f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart @@ -11,7 +11,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'enum_test.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -21,143 +20,70 @@ part 'enum_test.g.dart'; class EnumTest { /// Returns a new [EnumTest] instance. EnumTest({ - - this.enumString, - - required this.enumStringRequired, - - this.enumInteger, - - this.enumNumber, - - this.outerEnum, - - this.outerEnumInteger, - - this.outerEnumDefaultValue, - - this.outerEnumIntegerDefaultValue, + this.enumString, + required this.enumStringRequired, + this.enumInteger, + this.enumNumber, + this.outerEnum, + this.outerEnumInteger, + this.outerEnumDefaultValue, + this.outerEnumIntegerDefaultValue, }); - @JsonKey( - - name: r'enum_string', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'enum_string', required: false, includeIfNull: false) final EnumTestEnumStringEnum? enumString; - - - @JsonKey( - - name: r'enum_string_required', - required: true, - includeIfNull: false - ) - - + @JsonKey(name: r'enum_string_required', required: true, includeIfNull: false) final EnumTestEnumStringRequiredEnum enumStringRequired; - - - @JsonKey( - - name: r'enum_integer', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'enum_integer', required: false, includeIfNull: false) final EnumTestEnumIntegerEnum? enumInteger; - - - @JsonKey( - - name: r'enum_number', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'enum_number', required: false, includeIfNull: false) final EnumTestEnumNumberEnum? enumNumber; - - - @JsonKey( - - name: r'outerEnum', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'outerEnum', required: false, includeIfNull: false) final OuterEnum? outerEnum; - - - @JsonKey( - - name: r'outerEnumInteger', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'outerEnumInteger', required: false, includeIfNull: false) final OuterEnumInteger? outerEnumInteger; - - @JsonKey( - - name: r'outerEnumDefaultValue', - required: false, - includeIfNull: false - ) - - + name: r'outerEnumDefaultValue', required: false, includeIfNull: false) final OuterEnumDefaultValue? outerEnumDefaultValue; - - @JsonKey( - - name: r'outerEnumIntegerDefaultValue', - required: false, - includeIfNull: false - ) - - + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false) final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; - - @override - bool operator ==(Object other) => identical(this, other) || other is EnumTest && - other.enumString == enumString && - other.enumStringRequired == enumStringRequired && - other.enumInteger == enumInteger && - other.enumNumber == enumNumber && - other.outerEnum == outerEnum && - other.outerEnumInteger == outerEnumInteger && - other.outerEnumDefaultValue == outerEnumDefaultValue && - other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + bool operator ==(Object other) => + identical(this, other) || + other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; @override int get hashCode => - enumString.hashCode + - enumStringRequired.hashCode + - enumInteger.hashCode + - enumNumber.hashCode + - (outerEnum == null ? 0 : outerEnum.hashCode) + - outerEnumInteger.hashCode + - outerEnumDefaultValue.hashCode + - outerEnumIntegerDefaultValue.hashCode; - - factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; + + factory EnumTest.fromJson(Map json) => + _$EnumTestFromJson(json); Map toJson() => _$EnumTestToJson(this); @@ -165,10 +91,8 @@ class EnumTest { String toString() { return toJson().toString(); } - } - enum EnumTestEnumStringEnum { @JsonValue(r'UPPER') UPPER, @@ -180,8 +104,6 @@ enum EnumTestEnumStringEnum { unknownDefaultOpenApi, } - - enum EnumTestEnumStringRequiredEnum { @JsonValue(r'UPPER') UPPER, @@ -193,8 +115,6 @@ enum EnumTestEnumStringRequiredEnum { unknownDefaultOpenApi, } - - enum EnumTestEnumIntegerEnum { @JsonValue(1) number1, @@ -204,8 +124,6 @@ enum EnumTestEnumIntegerEnum { unknownDefaultOpenApi, } - - enum EnumTestEnumNumberEnum { @JsonValue('1.1') number1Period1, @@ -214,5 +132,3 @@ enum EnumTestEnumNumberEnum { @JsonValue('11184809') unknownDefaultOpenApi, } - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart new file mode 100644 index 000000000000..bad2e3789836 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart @@ -0,0 +1,57 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'extensible.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Extensible { + /// Returns a new [Extensible] instance. + Extensible({ + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Extensible && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + atSchemaLocation.hashCode + atBaseType.hashCode + atType.hashCode; + + factory Extensible.fromJson(Map json) => + _$ExtensibleFromJson(json); + + Map toJson() => _$ExtensibleToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart similarity index 61% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart index bd2a9dc6f2fc..3da04204b0b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart @@ -8,7 +8,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'file_schema_test_class.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -18,47 +17,28 @@ part 'file_schema_test_class.g.dart'; class FileSchemaTestClass { /// Returns a new [FileSchemaTestClass] instance. FileSchemaTestClass({ - - this.file, - - this.files, + this.file, + this.files, }); - @JsonKey( - - name: r'file', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'file', required: false, includeIfNull: false) final ModelFile? file; - - - @JsonKey( - - name: r'files', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'files', required: false, includeIfNull: false) final List? files; - - @override - bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && - other.file == file && - other.files == files; + bool operator ==(Object other) => + identical(this, other) || + other is FileSchemaTestClass && + other.file == file && + other.files == files; @override - int get hashCode => - file.hashCode + - files.hashCode; + int get hashCode => file.hashCode + files.hashCode; - factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + factory FileSchemaTestClass.fromJson(Map json) => + _$FileSchemaTestClassFromJson(json); Map toJson() => _$FileSchemaTestClassToJson(this); @@ -66,6 +46,4 @@ class FileSchemaTestClass { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..5fbd0e3f800a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + this.fooPropA, + this.fooPropB, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'fooPropA', required: false, includeIfNull: false) + final String? fooPropA; + + @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) + final String? fooPropB; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Foo && + other.fooPropA == fooPropA && + other.fooPropB == fooPropB && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + fooPropA.hashCode + + fooPropB.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart new file mode 100644 index 000000000000..5a80aca5aeb1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_basic_get_default_response.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooBasicGetDefaultResponse { + /// Returns a new [FooBasicGetDefaultResponse] instance. + FooBasicGetDefaultResponse({ + this.string, + }); + + @JsonKey(name: r'string', required: false, includeIfNull: false) + final Foo? string; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooBasicGetDefaultResponse && other.string == string; + + @override + int get hashCode => string.hashCode; + + factory FooBasicGetDefaultResponse.fromJson(Map json) => + _$FooBasicGetDefaultResponseFromJson(json); + + Map toJson() => _$FooBasicGetDefaultResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1e0ec166fb66 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRef { + /// Returns a new [FooRef] instance. + FooRef({ + this.foorefPropA, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'foorefPropA', required: false, includeIfNull: false) + final String? foorefPropA; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRef && + other.foorefPropA == foorefPropA && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + foorefPropA.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + Map toJson() => _$FooRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..f71d4b51f73e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref_or_value.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRefOrValue { + /// Returns a new [FooRefOrValue] instance. + FooRefOrValue({ + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FooRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRefOrValue.fromJson(Map json) => + _$FooRefOrValueFromJson(json); + + Map toJson() => _$FooRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..f036a62c2df5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,150 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:dio/dio.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + this.integer, + this.int32, + this.int64, + required this.number, + this.float, + this.double_, + this.decimal, + this.string, + required this.byte, + this.binary, + required this.date, + this.dateTime, + this.uuid, + required this.password, + this.patternWithDigits, + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey(name: r'integer', required: false, includeIfNull: false) + final int? integer; + + // minimum: 20 + // maximum: 200 + @JsonKey(name: r'int32', required: false, includeIfNull: false) + final int? int32; + + @JsonKey(name: r'int64', required: false, includeIfNull: false) + final int? int64; + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey(name: r'number', required: true, includeIfNull: false) + final num number; + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey(name: r'float', required: false, includeIfNull: false) + final double? float; + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey(name: r'double', required: false, includeIfNull: false) + final double? double_; + + @JsonKey(name: r'decimal', required: false, includeIfNull: false) + final double? decimal; + + @JsonKey(name: r'string', required: false, includeIfNull: false) + final String? string; + + @JsonKey(name: r'byte', required: true, includeIfNull: false) + final String byte; + + @JsonKey(ignore: true) + final MultipartFile? binary; + + @JsonKey(name: r'date', required: true, includeIfNull: false) + final DateTime date; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'password', required: true, includeIfNull: false) + final String password; + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey(name: r'pattern_with_digits', required: false, includeIfNull: false) + final String? patternWithDigits; + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false) + final String? patternWithDigitsAndDelimiter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; + + factory FormatTest.fromJson(Map json) => + _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart new file mode 100644 index 000000000000..ecbad5014c05 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Fruit { + /// Returns a new [Fruit] instance. + Fruit({ + this.color, + this.kind, + this.count, + }); + + @JsonKey(name: r'color', required: false, includeIfNull: false) + final String? color; + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @JsonKey(name: r'count', required: false, includeIfNull: false) + final num? count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Fruit && + other.color == color && + other.kind == kind && + other.count == count; + + @override + int get hashCode => color.hashCode + kind.hashCode + count.hashCode; + + factory Fruit.fromJson(Map json) => _$FruitFromJson(json); + + Map toJson() => _$FruitToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart new file mode 100644 index 000000000000..1dfb20c86bdf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_all_of_disc.dart'; +import 'package:openapi/src/model/apple_all_of_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_all_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitAllOfDisc { + /// Returns a new [FruitAllOfDisc] instance. + FruitAllOfDisc({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitAllOfDisc && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitAllOfDisc.fromJson(Map json) => + _$FruitAllOfDiscFromJson(json); + + Map toJson() => _$FruitAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart new file mode 100644 index 000000000000..8f82703b5dc5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple_any_of_disc.dart'; +import 'package:openapi/src/model/banana_any_of_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_any_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitAnyOfDisc { + /// Returns a new [FruitAnyOfDisc] instance. + FruitAnyOfDisc({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitAnyOfDisc && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitAnyOfDisc.fromJson(Map json) => + _$FruitAnyOfDiscFromJson(json); + + Map toJson() => _$FruitAnyOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart new file mode 100644 index 000000000000..463288870973 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_grandparent_disc.dart'; +import 'package:openapi/src/model/apple_grandparent_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_grandparent_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitGrandparentDisc { + /// Returns a new [FruitGrandparentDisc] instance. + FruitGrandparentDisc({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitGrandparentDisc && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitGrandparentDisc.fromJson(Map json) => + _$FruitGrandparentDiscFromJson(json); + + Map toJson() => _$FruitGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart new file mode 100644 index 000000000000..df523bdbac52 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDisc { + /// Returns a new [FruitInlineDisc] instance. + FruitInlineDisc({ + required this.seeds, + required this.fruitType, + required this.length, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineDisc && + other.seeds == seeds && + other.fruitType == fruitType && + other.length == length; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode + length.hashCode; + + factory FruitInlineDisc.fromJson(Map json) => + _$FruitInlineDiscFromJson(json); + + Map toJson() => _$FruitInlineDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart new file mode 100644 index 000000000000..6b438ff6b6ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc_one_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDiscOneOf { + /// Returns a new [FruitInlineDiscOneOf] instance. + FruitInlineDiscOneOf({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineDiscOneOf && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory FruitInlineDiscOneOf.fromJson(Map json) => + _$FruitInlineDiscOneOfFromJson(json); + + Map toJson() => _$FruitInlineDiscOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart new file mode 100644 index 000000000000..757b16888d56 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc_one_of1.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDiscOneOf1 { + /// Returns a new [FruitInlineDiscOneOf1] instance. + FruitInlineDiscOneOf1({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineDiscOneOf1 && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory FruitInlineDiscOneOf1.fromJson(Map json) => + _$FruitInlineDiscOneOf1FromJson(json); + + Map toJson() => _$FruitInlineDiscOneOf1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart new file mode 100644 index 000000000000..f0b7a0a5752b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDisc { + /// Returns a new [FruitInlineInlineDisc] instance. + FruitInlineInlineDisc({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineInlineDisc && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitInlineInlineDisc.fromJson(Map json) => + _$FruitInlineInlineDiscFromJson(json); + + Map toJson() => _$FruitInlineInlineDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart new file mode 100644 index 000000000000..415d864f8102 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOf { + /// Returns a new [FruitInlineInlineDiscOneOf] instance. + FruitInlineInlineDiscOneOf({ + required this.seeds, + required this.fruitType, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineInlineDiscOneOf && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode; + + factory FruitInlineInlineDiscOneOf.fromJson(Map json) => + _$FruitInlineInlineDiscOneOfFromJson(json); + + Map toJson() => _$FruitInlineInlineDiscOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart new file mode 100644 index 000000000000..38d499a0028e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of1.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOf1 { + /// Returns a new [FruitInlineInlineDiscOneOf1] instance. + FruitInlineInlineDiscOneOf1({ + required this.length, + required this.fruitType, + }); + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineInlineDiscOneOf1 && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => length.hashCode + fruitType.hashCode; + + factory FruitInlineInlineDiscOneOf1.fromJson(Map json) => + _$FruitInlineInlineDiscOneOf1FromJson(json); + + Map toJson() => _$FruitInlineInlineDiscOneOf1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart new file mode 100644 index 000000000000..11d217bfaf39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart @@ -0,0 +1,43 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of_one_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOfOneOf { + /// Returns a new [FruitInlineInlineDiscOneOfOneOf] instance. + FruitInlineInlineDiscOneOfOneOf({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitInlineInlineDiscOneOfOneOf && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitInlineInlineDiscOneOfOneOf.fromJson(Map json) => + _$FruitInlineInlineDiscOneOfOneOfFromJson(json); + + Map toJson() => + _$FruitInlineInlineDiscOneOfOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart new file mode 100644 index 000000000000..fc23181223cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart @@ -0,0 +1,44 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_one_of_disc.dart'; +import 'package:openapi/src/model/apple_one_of_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_one_of_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitOneOfDisc { + /// Returns a new [FruitOneOfDisc] instance. + FruitOneOfDisc({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitOneOfDisc && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitOneOfDisc.fromJson(Map json) => + _$FruitOneOfDiscFromJson(json); + + Map toJson() => _$FruitOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart new file mode 100644 index 000000000000..f538751ea55d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_req_disc.dart'; +import 'package:openapi/src/model/apple_req_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_req_disc.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitReqDisc { + /// Returns a new [FruitReqDisc] instance. + FruitReqDisc({ + required this.seeds, + required this.fruitType, + required this.length, + }); + + @JsonKey(name: r'seeds', required: true, includeIfNull: false) + final int seeds; + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @JsonKey(name: r'length', required: true, includeIfNull: false) + final int length; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitReqDisc && + other.seeds == seeds && + other.fruitType == fruitType && + other.length == length; + + @override + int get hashCode => seeds.hashCode + fruitType.hashCode + length.hashCode; + + factory FruitReqDisc.fromJson(Map json) => + _$FruitReqDiscFromJson(json); + + Map toJson() => _$FruitReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart new file mode 100644 index 000000000000..eafe4ed0efbe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_type.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitType { + /// Returns a new [FruitType] instance. + FruitType({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitType && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory FruitType.fromJson(Map json) => + _$FruitTypeFromJson(json); + + Map toJson() => _$FruitTypeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart new file mode 100644 index 000000000000..4412252bd71e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple_variant1.dart'; +import 'package:openapi/src/model/grape_variant1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_variant1.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitVariant1 { + /// Returns a new [FruitVariant1] instance. + FruitVariant1({ + this.color, + this.kind, + }); + + @JsonKey(name: r'color', required: false, includeIfNull: false) + final String? color; + + @JsonKey(name: r'kind', required: false, includeIfNull: false) + final String? kind; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FruitVariant1 && other.color == color && other.kind == kind; + + @override + int get hashCode => color.hashCode + kind.hashCode; + + factory FruitVariant1.fromJson(Map json) => + _$FruitVariant1FromJson(json); + + Map toJson() => _$FruitVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart new file mode 100644 index 000000000000..5d823893c7ad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/one_of_primitive_child.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'giga_one_of.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GigaOneOf { + /// Returns a new [GigaOneOf] instance. + GigaOneOf({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is GigaOneOf && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory GigaOneOf.fromJson(Map json) => + _$GigaOneOfFromJson(json); + + Map toJson() => _$GigaOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart new file mode 100644 index 000000000000..6f8d7d97722b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'grape_variant1.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GrapeVariant1 { + /// Returns a new [GrapeVariant1] instance. + GrapeVariant1({ + this.color, + }); + + @JsonKey(name: r'color', required: false, includeIfNull: false) + final String? color; + + @override + bool operator ==(Object other) => + identical(this, other) || other is GrapeVariant1 && other.color == color; + + @override + int get hashCode => color.hashCode; + + factory GrapeVariant1.fromJson(Map json) => + _$GrapeVariant1FromJson(json); + + Map toJson() => _$GrapeVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart index 84c99fbc188c..ed6a55c59d03 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'has_only_read_only.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,26 @@ part 'has_only_read_only.g.dart'; class HasOnlyReadOnly { /// Returns a new [HasOnlyReadOnly] instance. HasOnlyReadOnly({ - - this.bar, - - this.foo, + this.bar, + this.foo, }); - @JsonKey( - - name: r'bar', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'bar', required: false, includeIfNull: false) final String? bar; - - - @JsonKey( - - name: r'foo', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'foo', required: false, includeIfNull: false) final String? foo; - - @override - bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && - other.bar == bar && - other.foo == foo; + bool operator ==(Object other) => + identical(this, other) || + other is HasOnlyReadOnly && other.bar == bar && other.foo == foo; @override - int get hashCode => - bar.hashCode + - foo.hashCode; + int get hashCode => bar.hashCode + foo.hashCode; - factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + factory HasOnlyReadOnly.fromJson(Map json) => + _$HasOnlyReadOnlyFromJson(json); Map toJson() => _$HasOnlyReadOnlyToJson(this); @@ -65,6 +43,4 @@ class HasOnlyReadOnly { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart similarity index 62% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart index fcb2973b7514..e14245b733fe 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'health_check_result.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,22 @@ part 'health_check_result.g.dart'; class HealthCheckResult { /// Returns a new [HealthCheckResult] instance. HealthCheckResult({ - - this.nullableMessage, + this.nullableMessage, }); - @JsonKey( - - name: r'NullableMessage', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'NullableMessage', required: false, includeIfNull: false) final String? nullableMessage; - - @override - bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && - other.nullableMessage == nullableMessage; + bool operator ==(Object other) => + identical(this, other) || + other is HealthCheckResult && other.nullableMessage == nullableMessage; @override - int get hashCode => - (nullableMessage == null ? 0 : nullableMessage.hashCode); + int get hashCode => (nullableMessage == null ? 0 : nullableMessage.hashCode); - factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + factory HealthCheckResult.fromJson(Map json) => + _$HealthCheckResultFromJson(json); Map toJson() => _$HealthCheckResultToJson(this); @@ -49,6 +39,4 @@ class HealthCheckResult { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..68f69e6ab300 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + this.mapMapOfString, + this.mapOfEnumString, + this.directMap, + this.indirectMap, + }); + + @JsonKey(name: r'map_map_of_string', required: false, includeIfNull: false) + final Map>? mapMapOfString; + + @JsonKey(name: r'map_of_enum_string', required: false, includeIfNull: false) + final Map? mapOfEnumString; + + @JsonKey(name: r'direct_map', required: false, includeIfNull: false) + final Map? directMap; + + @JsonKey(name: r'indirect_map', required: false, includeIfNull: false) + final Map? indirectMap; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; + + factory MapTest.fromJson(Map json) => + _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +enum MapTestMapOfEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..7045930e1616 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + this.uuid, + this.dateTime, + this.map, + }); + + @JsonKey(name: r'uuid', required: false, includeIfNull: false) + final String? uuid; + + @JsonKey(name: r'dateTime', required: false, includeIfNull: false) + final DateTime? dateTime; + + @JsonKey(name: r'map', required: false, includeIfNull: false) + final Map? map; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => uuid.hashCode + dateTime.hashCode + map.hashCode; + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson( + Map json) => + _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => + _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart similarity index 58% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart index 346f1257555f..31f363f60b96 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'model200_response.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,26 @@ part 'model200_response.g.dart'; class Model200Response { /// Returns a new [Model200Response] instance. Model200Response({ - - this.name, - - this.class_, + this.name, + this.class_, }); - @JsonKey( - - name: r'name', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'name', required: false, includeIfNull: false) final int? name; - - - @JsonKey( - - name: r'class', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'class', required: false, includeIfNull: false) final String? class_; - - @override - bool operator ==(Object other) => identical(this, other) || other is Model200Response && - other.name == name && - other.class_ == class_; + bool operator ==(Object other) => + identical(this, other) || + other is Model200Response && other.name == name && other.class_ == class_; @override - int get hashCode => - name.hashCode + - class_.hashCode; + int get hashCode => name.hashCode + class_.hashCode; - factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + factory Model200Response.fromJson(Map json) => + _$Model200ResponseFromJson(json); Map toJson() => _$Model200ResponseToJson(this); @@ -65,6 +43,4 @@ class Model200Response { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart index 14e22005a161..420ab5a1f4dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_client.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,21 @@ part 'model_client.g.dart'; class ModelClient { /// Returns a new [ModelClient] instance. ModelClient({ - - this.client, + this.client, }); - @JsonKey( - - name: r'client', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'client', required: false, includeIfNull: false) final String? client; - - @override - bool operator ==(Object other) => identical(this, other) || other is ModelClient && - other.client == client; + bool operator ==(Object other) => + identical(this, other) || other is ModelClient && other.client == client; @override - int get hashCode => - client.hashCode; + int get hashCode => client.hashCode; - factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + factory ModelClient.fromJson(Map json) => + _$ModelClientFromJson(json); Map toJson() => _$ModelClientToJson(this); @@ -49,6 +38,4 @@ class ModelClient { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart index 8abf107d98e6..67b79a2a5c9a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum ModelEnumClass { @JsonValue(r'_abc') abc, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart similarity index 57% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart index fe95e3ff0029..24ab5b777009 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_file.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,32 +16,23 @@ part 'model_file.g.dart'; class ModelFile { /// Returns a new [ModelFile] instance. ModelFile({ - - this.sourceURI, + this.sourceURI, }); - /// Test capitalization - @JsonKey( - - name: r'sourceURI', - required: false, - includeIfNull: false - ) - - + /// Test capitalization + @JsonKey(name: r'sourceURI', required: false, includeIfNull: false) final String? sourceURI; - - @override - bool operator ==(Object other) => identical(this, other) || other is ModelFile && - other.sourceURI == sourceURI; + bool operator ==(Object other) => + identical(this, other) || + other is ModelFile && other.sourceURI == sourceURI; @override - int get hashCode => - sourceURI.hashCode; + int get hashCode => sourceURI.hashCode; - factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + factory ModelFile.fromJson(Map json) => + _$ModelFileFromJson(json); Map toJson() => _$ModelFileToJson(this); @@ -50,6 +40,4 @@ class ModelFile { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart index 543b79ac9f13..b2d3f190af9e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_list.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,22 @@ part 'model_list.g.dart'; class ModelList { /// Returns a new [ModelList] instance. ModelList({ - - this.n123list, + this.n123list, }); - @JsonKey( - - name: r'123-list', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'123-list', required: false, includeIfNull: false) final String? n123list; - - @override - bool operator ==(Object other) => identical(this, other) || other is ModelList && - other.n123list == n123list; + bool operator ==(Object other) => + identical(this, other) || + other is ModelList && other.n123list == n123list; @override - int get hashCode => - n123list.hashCode; + int get hashCode => n123list.hashCode; - factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + factory ModelList.fromJson(Map json) => + _$ModelListFromJson(json); Map toJson() => _$ModelListToJson(this); @@ -49,6 +39,4 @@ class ModelList { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart index 192b134d8fc6..1d2547c95628 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'model_return.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,22 @@ part 'model_return.g.dart'; class ModelReturn { /// Returns a new [ModelReturn] instance. ModelReturn({ - - this.return_, + this.return_, }); - @JsonKey( - - name: r'return', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'return', required: false, includeIfNull: false) final int? return_; - - @override - bool operator ==(Object other) => identical(this, other) || other is ModelReturn && - other.return_ == return_; + bool operator ==(Object other) => + identical(this, other) || + other is ModelReturn && other.return_ == return_; @override - int get hashCode => - return_.hashCode; + int get hashCode => return_.hashCode; - factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + factory ModelReturn.fromJson(Map json) => + _$ModelReturnFromJson(json); Map toJson() => _$ModelReturnToJson(this); @@ -49,6 +39,4 @@ class ModelReturn { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..0aad5dcc0480 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + required this.name, + this.snakeCase, + this.property, + this.n123number, + }); + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final int name; + + @JsonKey(name: r'snake_case', required: false, includeIfNull: false) + final int? snakeCase; + + @JsonKey(name: r'property', required: false, includeIfNull: false) + final String? property; + + @JsonKey(name: r'123Number', required: false, includeIfNull: false) + final int? n123number; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..66e3f84395b6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,121 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + this.integerProp, + this.numberProp, + this.booleanProp, + this.stringProp, + this.dateProp, + this.datetimeProp, + this.arrayNullableProp, + this.arrayAndItemsNullableProp, + this.arrayItemsNullable, + this.objectNullableProp, + this.objectAndItemsNullableProp, + this.objectItemsNullable, + }); + + @JsonKey(name: r'integer_prop', required: false, includeIfNull: false) + final int? integerProp; + + @JsonKey(name: r'number_prop', required: false, includeIfNull: false) + final num? numberProp; + + @JsonKey(name: r'boolean_prop', required: false, includeIfNull: false) + final bool? booleanProp; + + @JsonKey(name: r'string_prop', required: false, includeIfNull: false) + final String? stringProp; + + @JsonKey(name: r'date_prop', required: false, includeIfNull: false) + final DateTime? dateProp; + + @JsonKey(name: r'datetime_prop', required: false, includeIfNull: false) + final DateTime? datetimeProp; + + @JsonKey(name: r'array_nullable_prop', required: false, includeIfNull: false) + final List? arrayNullableProp; + + @JsonKey( + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false) + final List? arrayAndItemsNullableProp; + + @JsonKey(name: r'array_items_nullable', required: false, includeIfNull: false) + final List? arrayItemsNullable; + + @JsonKey(name: r'object_nullable_prop', required: false, includeIfNull: false) + final Map? objectNullableProp; + + @JsonKey( + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false) + final Map? objectAndItemsNullableProp; + + @JsonKey( + name: r'object_items_nullable', required: false, includeIfNull: false) + final Map? objectItemsNullable; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null + ? 0 + : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null + ? 0 + : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; + + factory NullableClass.fromJson(Map json) => + _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart similarity index 59% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart index 3ca6bf704b59..75022ee68437 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'number_only.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,22 @@ part 'number_only.g.dart'; class NumberOnly { /// Returns a new [NumberOnly] instance. NumberOnly({ - - this.justNumber, + this.justNumber, }); - @JsonKey( - - name: r'JustNumber', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'JustNumber', required: false, includeIfNull: false) final num? justNumber; - - @override - bool operator ==(Object other) => identical(this, other) || other is NumberOnly && - other.justNumber == justNumber; + bool operator ==(Object other) => + identical(this, other) || + other is NumberOnly && other.justNumber == justNumber; @override - int get hashCode => - justNumber.hashCode; + int get hashCode => justNumber.hashCode; - factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + factory NumberOnly.fromJson(Map json) => + _$NumberOnlyFromJson(json); Map toJson() => _$NumberOnlyToJson(this); @@ -49,6 +39,4 @@ class NumberOnly { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart similarity index 53% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart index e4eb52631133..fc0b71e6fe86 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -4,11 +4,11 @@ // ignore_for_file: unused_element import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; import 'package:json_annotation/json_annotation.dart'; part 'object_with_deprecated_fields.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -18,82 +18,42 @@ part 'object_with_deprecated_fields.g.dart'; class ObjectWithDeprecatedFields { /// Returns a new [ObjectWithDeprecatedFields] instance. ObjectWithDeprecatedFields({ - - this.uuid, - - this.id, - - this.deprecatedRef, - - this.bars, + this.uuid, + this.id, + this.deprecatedRef, + this.bars, }); - @JsonKey( - - name: r'uuid', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'uuid', required: false, includeIfNull: false) final String? uuid; - - @Deprecated('id has been deprecated') - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'id', required: false, includeIfNull: false) final num? id; - - @Deprecated('deprecatedRef has been deprecated') - @JsonKey( - - name: r'deprecatedRef', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'deprecatedRef', required: false, includeIfNull: false) final DeprecatedObject? deprecatedRef; - - @Deprecated('bars has been deprecated') - @JsonKey( - - name: r'bars', - required: false, - includeIfNull: false - ) - - - final List? bars; - - + @JsonKey(name: r'bars', required: false, includeIfNull: false) + final List? bars; @override - bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && - other.uuid == uuid && - other.id == id && - other.deprecatedRef == deprecatedRef && - other.bars == bars; + bool operator ==(Object other) => + identical(this, other) || + other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; @override int get hashCode => - uuid.hashCode + - id.hashCode + - deprecatedRef.hashCode + - bars.hashCode; + uuid.hashCode + id.hashCode + deprecatedRef.hashCode + bars.hashCode; - factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + factory ObjectWithDeprecatedFields.fromJson(Map json) => + _$ObjectWithDeprecatedFieldsFromJson(json); Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); @@ -101,6 +61,4 @@ class ObjectWithDeprecatedFields { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart new file mode 100644 index 000000000000..f468d2d44086 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'one_of_primitive_child.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OneOfPrimitiveChild { + /// Returns a new [OneOfPrimitiveChild] instance. + OneOfPrimitiveChild({ + this.name, + }); + + @JsonKey(name: r'name', required: false, includeIfNull: false) + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OneOfPrimitiveChild && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory OneOfPrimitiveChild.fromJson(Map json) => + _$OneOfPrimitiveChildFromJson(json); + + Map toJson() => _$OneOfPrimitiveChildToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..e5bcbae3225e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + this.id, + this.petId, + this.quantity, + this.shipDate, + this.status, + this.complete = false, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'petId', required: false, includeIfNull: false) + final int? petId; + + @JsonKey(name: r'quantity', required: false, includeIfNull: false) + final int? quantity; + + @JsonKey(name: r'shipDate', required: false, includeIfNull: false) + final DateTime? shipDate; + + /// Order Status + @JsonKey(name: r'status', required: false, includeIfNull: false) + final OrderStatusEnum? status; + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false) + final bool? complete; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..df6d371f533f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + this.myNumber, + this.myString, + this.myBoolean, + }); + + @JsonKey(name: r'my_number', required: false, includeIfNull: false) + final num? myNumber; + + @JsonKey(name: r'my_string', required: false, includeIfNull: false) + final String? myString; + + @JsonKey(name: r'my_boolean', required: false, includeIfNull: false) + final bool? myBoolean; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + myString.hashCode + myBoolean.hashCode; + + factory OuterComposite.fromJson(Map json) => + _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart index 514507968c66..2d1326c259bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum OuterEnum { @JsonValue(r'placed') placed, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart index 0c8116edea96..45919f099158 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum OuterEnumDefaultValue { @JsonValue(r'placed') placed, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart index 34268d0e9c53..b91ca3455678 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum OuterEnumInteger { @JsonValue(0) number0, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart index 97b325938828..799321b37c85 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum OuterEnumIntegerDefaultValue { @JsonValue(0) number0, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart similarity index 69% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart index 76d18676a110..7620543d1f4a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -8,7 +8,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'outer_object_with_enum_property.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -18,31 +17,22 @@ part 'outer_object_with_enum_property.g.dart'; class OuterObjectWithEnumProperty { /// Returns a new [OuterObjectWithEnumProperty] instance. OuterObjectWithEnumProperty({ - - required this.value, + required this.value, }); - @JsonKey( - - name: r'value', - required: true, - includeIfNull: false - ) - - + @JsonKey(name: r'value', required: true, includeIfNull: false) final OuterEnumInteger value; - - @override - bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && - other.value == value; + bool operator ==(Object other) => + identical(this, other) || + other is OuterObjectWithEnumProperty && other.value == value; @override - int get hashCode => - value.hashCode; + int get hashCode => value.hashCode; - factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + factory OuterObjectWithEnumProperty.fromJson(Map json) => + _$OuterObjectWithEnumPropertyFromJson(json); Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); @@ -50,6 +40,4 @@ class OuterObjectWithEnumProperty { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart new file mode 100644 index 000000000000..72f8126a7929 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'parent.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Parent { + /// Returns a new [Parent] instance. + Parent({ + required this.fruitType, + }); + + @JsonKey(name: r'fruitType', required: true, includeIfNull: false) + final String fruitType; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Parent && other.fruitType == fruitType; + + @override + int get hashCode => fruitType.hashCode; + + factory Parent.fromJson(Map json) => _$ParentFromJson(json); + + Map toJson() => _$ParentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart new file mode 100644 index 000000000000..816d59814caf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pasta.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pasta { + /// Returns a new [Pasta] instance. + Pasta({ + this.vendor, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'vendor', required: false, includeIfNull: false) + final String? vendor; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pasta && + other.vendor == vendor && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + vendor.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + Map toJson() => _$PastaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..c3c4b5b6e009 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + this.id, + this.category, + required this.name, + required this.photoUrls, + this.tags, + this.status, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'category', required: false, includeIfNull: false) + final Category? category; + + @JsonKey(name: r'name', required: true, includeIfNull: false) + final String name; + + @JsonKey(name: r'photoUrls', required: true, includeIfNull: false) + final Set photoUrls; + + @JsonKey(name: r'tags', required: false, includeIfNull: false) + final List? tags; + + /// pet status in the store + @JsonKey(name: r'status', required: false, includeIfNull: false) + final PetStatusEnum? status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart new file mode 100644 index 000000000000..32d80d992a50 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart @@ -0,0 +1,81 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pizza { + /// Returns a new [Pizza] instance. + Pizza({ + this.pizzaSize, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'pizzaSize', required: false, includeIfNull: false) + final num? pizzaSize; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pizza && + other.pizzaSize == pizzaSize && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + pizzaSize.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + Map toJson() => _$PizzaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..07d031e8c289 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza_speziale.g.dart'; + +// ignore_for_file: unused_import + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PizzaSpeziale { + /// Returns a new [PizzaSpeziale] instance. + PizzaSpeziale({ + this.toppings, + this.href, + this.id, + this.atSchemaLocation, + this.atBaseType, + required this.atType, + }); + + @JsonKey(name: r'toppings', required: false, includeIfNull: false) + final String? toppings; + + /// Hyperlink reference + @JsonKey(name: r'href', required: false, includeIfNull: false) + final String? href; + + /// unique identifier + @JsonKey(name: r'id', required: false, includeIfNull: false) + final String? id; + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) + final String? atSchemaLocation; + + /// When sub-classing, this defines the super-class + @JsonKey(name: r'@baseType', required: false, includeIfNull: false) + final String? atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey(name: r'@type', required: true, includeIfNull: false) + final String atType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PizzaSpeziale && + other.toppings == toppings && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + toppings.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory PizzaSpeziale.fromJson(Map json) => + _$PizzaSpezialeFromJson(json); + + Map toJson() => _$PizzaSpezialeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart similarity index 53% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart index c71c088f1381..38c57afbafd8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'read_only_first.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,47 +16,26 @@ part 'read_only_first.g.dart'; class ReadOnlyFirst { /// Returns a new [ReadOnlyFirst] instance. ReadOnlyFirst({ - - this.bar, - - this.baz, + this.bar, + this.baz, }); - @JsonKey( - - name: r'bar', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'bar', required: false, includeIfNull: false) final String? bar; - - - @JsonKey( - - name: r'baz', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'baz', required: false, includeIfNull: false) final String? baz; - - @override - bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && - other.bar == bar && - other.baz == baz; + bool operator ==(Object other) => + identical(this, other) || + other is ReadOnlyFirst && other.bar == bar && other.baz == baz; @override - int get hashCode => - bar.hashCode + - baz.hashCode; + int get hashCode => bar.hashCode + baz.hashCode; - factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + factory ReadOnlyFirst.fromJson(Map json) => + _$ReadOnlyFirstFromJson(json); Map toJson() => _$ReadOnlyFirstToJson(this); @@ -65,6 +43,4 @@ class ReadOnlyFirst { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart index ca56d9841a5a..783d766acc82 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart @@ -5,7 +5,6 @@ // ignore_for_file: unused_element import 'package:json_annotation/json_annotation.dart'; - enum SingleRefType { @JsonValue(r'admin') admin, diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart similarity index 56% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart index acd3ba099576..fe1029818a7f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'special_model_name.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,31 +16,27 @@ part 'special_model_name.g.dart'; class SpecialModelName { /// Returns a new [SpecialModelName] instance. SpecialModelName({ - - this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, }); @JsonKey( - - name: r'$special[property.name]', - required: false, - includeIfNull: false - ) - - + name: r'$special[property.name]', required: false, includeIfNull: false) final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && - other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + bool operator ==(Object other) => + identical(this, other) || + other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; @override int get hashCode => - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + .hashCode; - factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + factory SpecialModelName.fromJson(Map json) => + _$SpecialModelNameFromJson(json); Map toJson() => _$SpecialModelNameToJson(this); @@ -49,6 +44,4 @@ class SpecialModelName { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart index d8a87eec1820..e1c5a2c8cc1c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart @@ -7,7 +7,6 @@ import 'package:json_annotation/json_annotation.dart'; part 'tag.g.dart'; - @JsonSerializable( checked: true, createToJson: true, @@ -17,45 +16,23 @@ part 'tag.g.dart'; class Tag { /// Returns a new [Tag] instance. Tag({ - - this.id, - - this.name, + this.id, + this.name, }); - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'id', required: false, includeIfNull: false) final int? id; - - - @JsonKey( - - name: r'name', - required: false, - includeIfNull: false - ) - - + @JsonKey(name: r'name', required: false, includeIfNull: false) final String? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is Tag && - other.id == id && - other.name == name; + bool operator ==(Object other) => + identical(this, other) || + other is Tag && other.id == id && other.name == name; @override - int get hashCode => - id.hashCode + - name.hashCode; + int get hashCode => id.hashCode + name.hashCode; factory Tag.fromJson(Map json) => _$TagFromJson(json); @@ -65,6 +42,4 @@ class Tag { String toString() { return toJson().toString(); } - } - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..f1da4cd38cab --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + this.id, + this.username, + this.firstName, + this.lastName, + this.email, + this.password, + this.phone, + this.userStatus, + }); + + @JsonKey(name: r'id', required: false, includeIfNull: false) + final int? id; + + @JsonKey(name: r'username', required: false, includeIfNull: false) + final String? username; + + @JsonKey(name: r'firstName', required: false, includeIfNull: false) + final String? firstName; + + @JsonKey(name: r'lastName', required: false, includeIfNull: false) + final String? lastName; + + @JsonKey(name: r'email', required: false, includeIfNull: false) + final String? email; + + @JsonKey(name: r'password', required: false, includeIfNull: false) + final String? password; + + @JsonKey(name: r'phone', required: false, includeIfNull: false) + final String? phone; + + /// User Status + @JsonKey(name: r'userStatus', required: false, includeIfNull: false) + final int? userStatus; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart similarity index 66% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart index fcfc669d1d66..c9630c637573 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/json_repository_base.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart @@ -1,3 +1,25 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// It doesn't have to be json, +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + Object serialize( + T src, + TypeInfo inputTypeInfo, { + Object? context, + }); + T deserialize( + Object value, + TypeInfo targetTypeInfo, { + Object? context, + }); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) class TypeInfo { final Type root; final bool nullable; @@ -43,13 +65,3 @@ class TypeInfo { return genericsStart == -1 ? name : name.substring(0, genericsStart); } } - -abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, - {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart new file mode 100644 index 000000000000..8ce925e5a603 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart @@ -0,0 +1,325 @@ +import 'dart:convert'; +import 'dart:typed_data'; +import 'repository_base.dart'; +import 'package:openapi/models.dart'; + +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + + @override + Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + return jsonEncode(src); + } + + @override + T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + Object valueParsed; + if (context == 'decodedJson') { + //if we are deserializing a decoded json, don't decode it again. + valueParsed = value; + } else { + valueParsed = jsonDecode(value.toString()) as Object; + } + switch (targetTypeInfo.root) { + case String: + return valueParsed as T; + case int: + return (valueParsed is num + ? valueParsed.toInt() + : int.parse(valueParsed.toString())) as T; + case bool: + if (valueParsed is bool) { + return valueParsed as T; + } + final valueString = valueParsed.toString().toLowerCase(); + return (valueString == 'true' || valueString == '1') as T; + case double: + return (valueParsed is num + ? valueParsed.toDouble() + : double.parse(valueParsed.toString())) as T; + //TODO: add support for DateTime? + case AdditionalPropertiesClass: + return AdditionalPropertiesClass.fromJson( + valueParsed as Map) as T; + case Addressable: + return Addressable.fromJson(valueParsed as Map) as T; + case AllOfWithSingleRef: + return AllOfWithSingleRef.fromJson(valueParsed as Map) + as T; + case Animal: + return Animal.fromJson(valueParsed as Map) as T; + case ApiResponse: + return ApiResponse.fromJson(valueParsed as Map) as T; + case Apple: + return Apple.fromJson(valueParsed as Map) as T; + case AppleAllOfDisc: + return AppleAllOfDisc.fromJson(valueParsed as Map) + as T; + case AppleAnyOfDisc: + return AppleAnyOfDisc.fromJson(valueParsed as Map) + as T; + case AppleGrandparentDisc: + return AppleGrandparentDisc.fromJson( + valueParsed as Map) as T; + case AppleOneOfDisc: + return AppleOneOfDisc.fromJson(valueParsed as Map) + as T; + case AppleReqDisc: + return AppleReqDisc.fromJson(valueParsed as Map) as T; + case AppleVariant1: + return AppleVariant1.fromJson(valueParsed as Map) as T; + case ArrayOfArrayOfNumberOnly: + return ArrayOfArrayOfNumberOnly.fromJson( + valueParsed as Map) as T; + case ArrayOfNumberOnly: + return ArrayOfNumberOnly.fromJson(valueParsed as Map) + as T; + case ArrayTest: + return ArrayTest.fromJson(valueParsed as Map) as T; + case Banana: + return Banana.fromJson(valueParsed as Map) as T; + case BananaAllOfDisc: + return BananaAllOfDisc.fromJson(valueParsed as Map) + as T; + case BananaAnyOfDisc: + return BananaAnyOfDisc.fromJson(valueParsed as Map) + as T; + case BananaGrandparentDisc: + return BananaGrandparentDisc.fromJson( + valueParsed as Map) as T; + case BananaOneOfDisc: + return BananaOneOfDisc.fromJson(valueParsed as Map) + as T; + case BananaReqDisc: + return BananaReqDisc.fromJson(valueParsed as Map) as T; + case Bar: + return Bar.fromJson(valueParsed as Map) as T; + case BarCreate: + return BarCreate.fromJson(valueParsed as Map) as T; + case BarRef: + return BarRef.fromJson(valueParsed as Map) as T; + case BarRefOrValue: + return BarRefOrValue.fromJson(valueParsed as Map) as T; + case Capitalization: + return Capitalization.fromJson(valueParsed as Map) + as T; + case Cat: + return Cat.fromJson(valueParsed as Map) as T; + case CatAllOf: + return CatAllOf.fromJson(valueParsed as Map) as T; + case Category: + return Category.fromJson(valueParsed as Map) as T; + case ClassModel: + return ClassModel.fromJson(valueParsed as Map) as T; + case ComposedDiscMissingFromProperties: + return ComposedDiscMissingFromProperties.fromJson( + valueParsed as Map) as T; + case ComposedDiscOptionalTypeCorrect: + return ComposedDiscOptionalTypeCorrect.fromJson( + valueParsed as Map) as T; + case ComposedDiscOptionalTypeInconsistent: + return ComposedDiscOptionalTypeInconsistent.fromJson( + valueParsed as Map) as T; + case ComposedDiscOptionalTypeIncorrect: + return ComposedDiscOptionalTypeIncorrect.fromJson( + valueParsed as Map) as T; + case ComposedDiscRequiredInconsistent: + return ComposedDiscRequiredInconsistent.fromJson( + valueParsed as Map) as T; + case ComposedDiscTypeInconsistent: + return ComposedDiscTypeInconsistent.fromJson( + valueParsed as Map) as T; + case ComposedDiscTypeIncorrect: + return ComposedDiscTypeIncorrect.fromJson( + valueParsed as Map) as T; + case DeprecatedObject: + return DeprecatedObject.fromJson(valueParsed as Map) + as T; + case DiscMissingFromProperties: + return DiscMissingFromProperties.fromJson( + valueParsed as Map) as T; + case DiscOptionalTypeCorrect: + return DiscOptionalTypeCorrect.fromJson( + valueParsed as Map) as T; + case DiscOptionalTypeIncorrect: + return DiscOptionalTypeIncorrect.fromJson( + valueParsed as Map) as T; + case DiscTypeIncorrect: + return DiscTypeIncorrect.fromJson(valueParsed as Map) + as T; + case Dog: + return Dog.fromJson(valueParsed as Map) as T; + case DogAllOf: + return DogAllOf.fromJson(valueParsed as Map) as T; + case Entity: + return Entity.fromJson(valueParsed as Map) as T; + case EntityRef: + return EntityRef.fromJson(valueParsed as Map) as T; + case EnumArrays: + return EnumArrays.fromJson(valueParsed as Map) as T; + case EnumTest: + return EnumTest.fromJson(valueParsed as Map) as T; + case Extensible: + return Extensible.fromJson(valueParsed as Map) as T; + case FileSchemaTestClass: + return FileSchemaTestClass.fromJson(valueParsed as Map) + as T; + case Foo: + return Foo.fromJson(valueParsed as Map) as T; + case FooBasicGetDefaultResponse: + return FooBasicGetDefaultResponse.fromJson( + valueParsed as Map) as T; + case FooRef: + return FooRef.fromJson(valueParsed as Map) as T; + case FooRefOrValue: + return FooRefOrValue.fromJson(valueParsed as Map) as T; + case FormatTest: + return FormatTest.fromJson(valueParsed as Map) as T; + case Fruit: + return Fruit.fromJson(valueParsed as Map) as T; + case FruitAllOfDisc: + return FruitAllOfDisc.fromJson(valueParsed as Map) + as T; + case FruitAnyOfDisc: + return FruitAnyOfDisc.fromJson(valueParsed as Map) + as T; + case FruitGrandparentDisc: + return FruitGrandparentDisc.fromJson( + valueParsed as Map) as T; + case FruitInlineDisc: + return FruitInlineDisc.fromJson(valueParsed as Map) + as T; + case FruitInlineDiscOneOf: + return FruitInlineDiscOneOf.fromJson( + valueParsed as Map) as T; + case FruitInlineDiscOneOf1: + return FruitInlineDiscOneOf1.fromJson( + valueParsed as Map) as T; + case FruitInlineInlineDisc: + return FruitInlineInlineDisc.fromJson( + valueParsed as Map) as T; + case FruitInlineInlineDiscOneOf: + return FruitInlineInlineDiscOneOf.fromJson( + valueParsed as Map) as T; + case FruitInlineInlineDiscOneOf1: + return FruitInlineInlineDiscOneOf1.fromJson( + valueParsed as Map) as T; + case FruitInlineInlineDiscOneOfOneOf: + return FruitInlineInlineDiscOneOfOneOf.fromJson( + valueParsed as Map) as T; + case FruitOneOfDisc: + return FruitOneOfDisc.fromJson(valueParsed as Map) + as T; + case FruitReqDisc: + return FruitReqDisc.fromJson(valueParsed as Map) as T; + case FruitType: + return FruitType.fromJson(valueParsed as Map) as T; + case FruitVariant1: + return FruitVariant1.fromJson(valueParsed as Map) as T; + case GigaOneOf: + return GigaOneOf.fromJson(valueParsed as Map) as T; + case GrapeVariant1: + return GrapeVariant1.fromJson(valueParsed as Map) as T; + case HasOnlyReadOnly: + return HasOnlyReadOnly.fromJson(valueParsed as Map) + as T; + case HealthCheckResult: + return HealthCheckResult.fromJson(valueParsed as Map) + as T; + case MapTest: + return MapTest.fromJson(valueParsed as Map) as T; + case MixedPropertiesAndAdditionalPropertiesClass: + return MixedPropertiesAndAdditionalPropertiesClass.fromJson( + valueParsed as Map) as T; + case Model200Response: + return Model200Response.fromJson(valueParsed as Map) + as T; + case ModelClient: + return ModelClient.fromJson(valueParsed as Map) as T; + case ModelEnumClass: + case ModelFile: + return ModelFile.fromJson(valueParsed as Map) as T; + case ModelList: + return ModelList.fromJson(valueParsed as Map) as T; + case ModelReturn: + return ModelReturn.fromJson(valueParsed as Map) as T; + case Name: + return Name.fromJson(valueParsed as Map) as T; + case NullableClass: + return NullableClass.fromJson(valueParsed as Map) as T; + case NumberOnly: + return NumberOnly.fromJson(valueParsed as Map) as T; + case ObjectWithDeprecatedFields: + return ObjectWithDeprecatedFields.fromJson( + valueParsed as Map) as T; + case OneOfPrimitiveChild: + return OneOfPrimitiveChild.fromJson(valueParsed as Map) + as T; + case Order: + return Order.fromJson(valueParsed as Map) as T; + case OuterComposite: + return OuterComposite.fromJson(valueParsed as Map) + as T; + case OuterEnum: + case OuterEnumDefaultValue: + case OuterEnumInteger: + case OuterEnumIntegerDefaultValue: + case OuterObjectWithEnumProperty: + return OuterObjectWithEnumProperty.fromJson( + valueParsed as Map) as T; + case Parent: + return Parent.fromJson(valueParsed as Map) as T; + case Pasta: + return Pasta.fromJson(valueParsed as Map) as T; + case Pet: + return Pet.fromJson(valueParsed as Map) as T; + case Pizza: + return Pizza.fromJson(valueParsed as Map) as T; + case PizzaSpeziale: + return PizzaSpeziale.fromJson(valueParsed as Map) as T; + case ReadOnlyFirst: + return ReadOnlyFirst.fromJson(valueParsed as Map) as T; + case SingleRefType: + case SpecialModelName: + return SpecialModelName.fromJson(valueParsed as Map) + as T; + case Tag: + return Tag.fromJson(valueParsed as Map) as T; + case User: + return User.fromJson(valueParsed as Map) as T; + default: + RegExpMatch? match; + + if (valueParsed is List && + (match = _regList.firstMatch(targetTypeInfo)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return valueParsed + .map((dynamic v) => deserialize( + v, targetTypeInfo, + growable: growable)) + .toList(growable: growable) as T; + } + if (valueParsed is Set && + (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return valueParsed + .map((dynamic v) => deserialize( + v, targetTypeInfo, + growable: growable)) + .toSet() as T; + } + if (valueParsed is Map && + (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + valueParsed.keys, + valueParsed.values.map((dynamic v) => + deserialize(v, targetTypeInfo, + growable: growable)), + ) as T; + } + break; + } + throw Exception('Cannot deserialize'); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pom.xml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart new file mode 100644 index 000000000000..00e1b6eba940 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart @@ -0,0 +1,22 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + final Addressable? instance = /* Addressable(...) */ null; + // TODO add properties to the entity + + group(Addressable, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart new file mode 100644 index 000000000000..9e64326664e2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleAllOfDisc +void main() { + final AppleAllOfDisc? instance = /* AppleAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(AppleAllOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart new file mode 100644 index 000000000000..424d1cde60db --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleAnyOfDisc +void main() { + final AppleAnyOfDisc? instance = /* AppleAnyOfDisc(...) */ null; + // TODO add properties to the entity + + group(AppleAnyOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart new file mode 100644 index 000000000000..a437c94d611e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleGrandparentDisc +void main() { + final AppleGrandparentDisc? instance = /* AppleGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(AppleGrandparentDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart new file mode 100644 index 000000000000..dbc28e30ab3d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleOneOfDisc +void main() { + final AppleOneOfDisc? instance = /* AppleOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(AppleOneOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart new file mode 100644 index 000000000000..69765cacefe9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleReqDisc +void main() { + final AppleReqDisc? instance = /* AppleReqDisc(...) */ null; + // TODO add properties to the entity + + group(AppleReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart new file mode 100644 index 000000000000..1c2c2037cd06 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart new file mode 100644 index 000000000000..1d64a9b164ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleVariant1 +void main() { + final AppleVariant1? instance = /* AppleVariant1(...) */ null; + // TODO add properties to the entity + + group(AppleVariant1, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart new file mode 100644 index 000000000000..0978ebebbc30 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaAllOfDisc +void main() { + final BananaAllOfDisc? instance = /* BananaAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(BananaAllOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart new file mode 100644 index 000000000000..91ed142d7b41 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaAnyOfDisc +void main() { + final BananaAnyOfDisc? instance = /* BananaAnyOfDisc(...) */ null; + // TODO add properties to the entity + + group(BananaAnyOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart new file mode 100644 index 000000000000..895c6d7a399e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaGrandparentDisc +void main() { + final BananaGrandparentDisc? instance = /* BananaGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(BananaGrandparentDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart new file mode 100644 index 000000000000..a073a587149e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaOneOfDisc +void main() { + final BananaOneOfDisc? instance = /* BananaOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(BananaOneOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart new file mode 100644 index 000000000000..b3d7ce7a00aa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaReqDisc +void main() { + final BananaReqDisc? instance = /* BananaReqDisc(...) */ null; + // TODO add properties to the entity + + group(BananaReqDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart new file mode 100644 index 000000000000..d5b0a6def843 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart new file mode 100644 index 000000000000..4c2cb1de1f98 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for BarApi +void main() { + final instance = Openapi().getBarApi(); + + group(BarApi, () { + // Create a Bar + // + //Future createBar(BarCreate barCreate) async + test('test createBar', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart new file mode 100644 index 000000000000..0833036690d6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarCreate +void main() { + final BarCreate? instance = /* BarCreate(...) */ null; + // TODO add properties to the entity + + group(BarCreate, () { + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..3088b2f6cd4e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart @@ -0,0 +1,40 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; + // TODO add properties to the entity + + group(BarRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart new file mode 100644 index 000000000000..080a462d0be6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart @@ -0,0 +1,40 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final BarRef? instance = /* BarRef(...) */ null; + // TODO add properties to the entity + + group(BarRef, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart new file mode 100644 index 000000000000..80bcd0c8227c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart @@ -0,0 +1,54 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final Bar? instance = /* Bar(...) */ null; + // TODO add properties to the entity + + group(Bar, () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_all_of_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..61a0d0f85e4b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscMissingFromProperties +void main() { + final ComposedDiscMissingFromProperties? + instance = /* ComposedDiscMissingFromProperties(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..916749ab6e9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeCorrect +void main() { + final ComposedDiscOptionalTypeCorrect? + instance = /* ComposedDiscOptionalTypeCorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart new file mode 100644 index 000000000000..694477afe9a4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeInconsistent +void main() { + final ComposedDiscOptionalTypeInconsistent? + instance = /* ComposedDiscOptionalTypeInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..d8eb42867727 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeIncorrect +void main() { + final ComposedDiscOptionalTypeIncorrect? + instance = /* ComposedDiscOptionalTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart new file mode 100644 index 000000000000..46235de826bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscRequiredInconsistent +void main() { + final ComposedDiscRequiredInconsistent? + instance = /* ComposedDiscRequiredInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscRequiredInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart new file mode 100644 index 000000000000..29b9afae253e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeInconsistent +void main() { + final ComposedDiscTypeInconsistent? + instance = /* ComposedDiscTypeInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart new file mode 100644 index 000000000000..957bb2d3d038 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeIncorrect +void main() { + final ComposedDiscTypeIncorrect? + instance = /* ComposedDiscTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart new file mode 100644 index 000000000000..b8f7033a61e9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart @@ -0,0 +1,39 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooBasicGet() async + test('test fooBasicGet', () async { + // TODO + }); + + //Future list() async + test('test list', () async { + // TODO + }); + + //Future oneofGet() async + test('test oneofGet', () async { + // TODO + }); + + //Future test({ Object body }) async + test('test test', () async { + // TODO + }); + + //Future variant1Get() async + test('test variant1Get', () async { + // TODO + }); + + //Future variant2Get() async + test('test variant2Get', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..c705f439e738 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscMissingFromProperties +void main() { + final DiscMissingFromProperties? + instance = /* DiscMissingFromProperties(...) */ null; + // TODO add properties to the entity + + group(DiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..63603e6df6bc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeCorrect +void main() { + final DiscOptionalTypeCorrect? instance = /* DiscOptionalTypeCorrect(...) */ + null; + // TODO add properties to the entity + + group(DiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..ad51a6519df6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeIncorrect +void main() { + final DiscOptionalTypeIncorrect? + instance = /* DiscOptionalTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(DiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart new file mode 100644 index 000000000000..909584dbb482 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscTypeIncorrect +void main() { + final DiscTypeIncorrect? instance = /* DiscTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(DiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_all_of_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart new file mode 100644 index 000000000000..6f3bf3393abc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EntityRef +void main() { + final EntityRef? instance = /* EntityRef(...) */ null; + // TODO add properties to the entity + + group(EntityRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart new file mode 100644 index 000000000000..72563a81a3e5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart @@ -0,0 +1,40 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + final Entity? instance = /* Entity(...) */ null; + // TODO add properties to the entity + + group(Entity, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart new file mode 100644 index 000000000000..821bd1b142fa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart @@ -0,0 +1,28 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + final Extensible? instance = /* Extensible(...) */ null; + // TODO add properties to the entity + + group(Extensible, () { + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart new file mode 100644 index 000000000000..010cf1d167e5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +/// tests for FooApi +void main() { + final instance = Openapi().getFooApi(); + + group(FooApi, () { + // Create a Foo + // + //Future createFoo({ Foo foo }) async + test('test createFoo', () async { + // TODO + }); + + // GET all Foos + // + //Future> getAllFoos() async + test('test getAllFoos', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart similarity index 56% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart index b1b1a3028e21..8c9fc046dc25 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart @@ -1,12 +1,13 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; -// tests for FooGetDefaultResponse +// tests for FooBasicGetDefaultResponse void main() { - final FooGetDefaultResponse? instance = /* FooGetDefaultResponse(...) */ null; + final FooBasicGetDefaultResponse? + instance = /* FooBasicGetDefaultResponse(...) */ null; // TODO add properties to the entity - group(FooGetDefaultResponse, () { + group(FooBasicGetDefaultResponse, () { // Foo string test('to test the property `string`', () async { // TODO diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..e5c101940aa0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart @@ -0,0 +1,40 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; + // TODO add properties to the entity + + group(FooRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart new file mode 100644 index 000000000000..fe14a0965722 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart @@ -0,0 +1,45 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final FooRef? instance = /* FooRef(...) */ null; + // TODO add properties to the entity + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..42b4149f85b6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart @@ -0,0 +1,50 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart new file mode 100644 index 000000000000..9c65d0622f84 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAllOfDisc +void main() { + final FruitAllOfDisc? instance = /* FruitAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitAllOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart new file mode 100644 index 000000000000..ea6dd1079ea2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAnyOfDisc +void main() { + final FruitAnyOfDisc? instance = /* FruitAnyOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitAnyOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart new file mode 100644 index 000000000000..90642e3028c8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitGrandparentDisc +void main() { + final FruitGrandparentDisc? instance = /* FruitGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(FruitGrandparentDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..604d536ed6eb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf1 +void main() { + final FruitInlineDiscOneOf1? instance = /* FruitInlineDiscOneOf1(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..c5ce025e0ee5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf +void main() { + final FruitInlineDiscOneOf? instance = /* FruitInlineDiscOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart new file mode 100644 index 000000000000..09e2ef323ee5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDisc +void main() { + final FruitInlineDisc? instance = /* FruitInlineDisc(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..a484f3a06494 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf1 +void main() { + final FruitInlineInlineDiscOneOf1? + instance = /* FruitInlineInlineDiscOneOf1(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart new file mode 100644 index 000000000000..b7205794a8dc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOfOneOf +void main() { + final FruitInlineInlineDiscOneOfOneOf? + instance = /* FruitInlineInlineDiscOneOfOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOfOneOf, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..6346211501dc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf +void main() { + final FruitInlineInlineDiscOneOf? + instance = /* FruitInlineInlineDiscOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart new file mode 100644 index 000000000000..5aa2ce2a79fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDisc +void main() { + final FruitInlineInlineDisc? instance = /* FruitInlineInlineDisc(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart new file mode 100644 index 000000000000..fd5e785603fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitOneOfDisc +void main() { + final FruitOneOfDisc? instance = /* FruitOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitOneOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart new file mode 100644 index 000000000000..a96143f06dc7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitReqDisc +void main() { + final FruitReqDisc? instance = /* FruitReqDisc(...) */ null; + // TODO add properties to the entity + + group(FruitReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart new file mode 100644 index 000000000000..e376b1d49990 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // num count + test('to test the property `count`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart new file mode 100644 index 000000000000..4d1a0822c652 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitType +void main() { + final FruitType? instance = /* FruitType(...) */ null; + // TODO add properties to the entity + + group(FruitType, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart new file mode 100644 index 000000000000..1e7401d7f787 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitVariant1 +void main() { + final FruitVariant1? instance = /* FruitVariant1(...) */ null; + // TODO add properties to the entity + + group(FruitVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart new file mode 100644 index 000000000000..d9a2a5e015da --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for GigaOneOf +void main() { + final GigaOneOf? instance = /* GigaOneOf(...) */ null; + // TODO add properties to the entity + + group(GigaOneOf, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart new file mode 100644 index 000000000000..f9ddc8a6f4ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for GrapeVariant1 +void main() { + final GrapeVariant1? instance = /* GrapeVariant1(...) */ null; + // TODO add properties to the entity + + group(GrapeVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart index dabb6bc2701c..dd0c27df02a3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart @@ -23,7 +23,7 @@ void main() { // TODO }); - // List bars + // List bars test('to test the property `bars`', () async { // TODO }); diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart new file mode 100644 index 000000000000..58ad197020ad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OneOfPrimitiveChild +void main() { + final OneOfPrimitiveChild? instance = /* OneOfPrimitiveChild(...) */ null; + // TODO add properties to the entity + + group(OneOfPrimitiveChild, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart new file mode 100644 index 000000000000..ac18a4a2c3a9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart @@ -0,0 +1,15 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Parent +void main() { + final Parent? instance = /* Parent(...) */ null; + // TODO add properties to the entity + + group(Parent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart new file mode 100644 index 000000000000..98ba6325ac09 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart @@ -0,0 +1,45 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final Pasta? instance = /* Pasta(...) */ null; + // TODO add properties to the entity + + group(Pasta, () { + // String vendor + test('to test the property `vendor`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..002deb101bfc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart @@ -0,0 +1,45 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; + // TODO add properties to the entity + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart new file mode 100644 index 000000000000..ea886dcc3a49 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart @@ -0,0 +1,45 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + final Pizza? instance = /* Pizza(...) */ null; + // TODO add properties to the entity + + group(Pizza, () { + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart rename to samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES deleted file mode 100644 index ac3648acb3f6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES +++ /dev/null @@ -1,27 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/Apple.md -doc/Banana.md -doc/DefaultApi.md -doc/Fruit.md -lib/apis.dart -lib/models.dart -lib/openapi.dart -lib/src/api/default_api.dart -lib/src/api_client.dart -lib/src/auth/_exports.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/apple.dart -lib/src/model/banana.dart -lib/src/model/date.dart -lib/src/model/fruit.dart -lib/src/repository_base.dart -lib/src/repository_impl.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/oneof/README.md deleted file mode 100644 index c87637a4d23b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# openapi (EXPERIMENTAL) -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 0.0.1 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getDefaultApi(); - -try { - final response = await api.rootGet(); - print(response); -} catch on DioError (e) { - print("Exception when calling DefaultApi->rootGet: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*DefaultApi*](doc/DefaultApi.md) | [**rootGet**](doc/DefaultApi.md#rootget) | **GET** / | - - -## Documentation For Models - - - [Apple](doc/Apple.md) - - [Banana](doc/Banana.md) - - [Fruit](doc/Fruit.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md deleted file mode 100644 index 217c29a3f567..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/openapi.dart'; -``` - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**rootGet**](DefaultApi.md#rootget) | **GET** / | - - -# **rootGet** -> Fruit rootGet() - - - -### Example -```dart -import 'package:openapi/openapi.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.rootGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling DefaultApi->rootGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Fruit**](Fruit.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart deleted file mode 100644 index 61386591c491..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/api.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart deleted file mode 100644 index 61386591c491..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/apis.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart deleted file mode 100644 index 9ecf2b9ff39b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/models.dart +++ /dev/null @@ -1,8 +0,0 @@ -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/date_serializer.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/repository_base.dart'; -export 'package:openapi/src/repository_impl.dart'; -export 'package:openapi/src/model/apple.dart'; -export 'package:openapi/src/model/banana.dart'; -export 'package:openapi/src/model/fruit.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart deleted file mode 100644 index 0c261cedc362..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_client.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'repository_impl.dart'; -import 'package:openapi/apis.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/auth/_exports.dart'; - -class Openapi { - static const String basePath = r'http://localhost'; - - final Dio dio; - final SerializationRepositoryBase serializationRepository; - - - Openapi({ - Dio? dio, - SerializationRepositoryBase? serializationRepositoryOverride, - String? basePathOverride, - List? interceptors, - }) : this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - DefaultApi getDefaultApi() { - return DefaultApi(DefaultApiRaw(dio), serializationRepository); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart deleted file mode 100644 index 06e023d91be5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart deleted file mode 100644 index 6b618e77ca4e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/json_repository_base.dart +++ /dev/null @@ -1,52 +0,0 @@ -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} - -abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart deleted file mode 100644 index 0efdf678482a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_base.dart +++ /dev/null @@ -1,61 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// It doesn't have to be json, -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart deleted file mode 100644 index 4ad5bcf06143..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/repository_impl.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'serializers.dart'; - -/// Converts our `TypeInfo` to `built_value`'s `FullType` -FullType typeInfoToFullType(TypeInfo info) { - if (info.nullable) { - return FullType.nullable( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } else { - return FullType( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } -} - -class BuiltValueJsonRepository extends SerializationRepositoryBase { - final Serializers serializers; - const BuiltValueJsonRepository(this.serializers); - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - return serializers.deserialize( - value, - specifiedType: typeInfoToFullType(targetTypeInfo), - ) as T; - } - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return serializers.serialize( - src, - specifiedType: typeInfoToFullType(inputTypeInfo), - ) as Object; - } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - -} - -/* -old api_util.dart for reference - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart deleted file mode 100644 index d771d346fed0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; - -import 'package:openapi/models.dart'; -part 'serializers.g.dart'; - -@SerializersFor([ - Apple, - Banana, - Fruit, -]) -Serializers serializers = (_$serializers.toBuilder() - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml deleted file mode 100644 index 810c7d48d77f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOf - pom - 1.0.0-SNAPSHOT - DartDio OneOf - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart deleted file mode 100644 index 07d256d2e554..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future rootGet() async - test('test rootGet', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES deleted file mode 100644 index bae526994583..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES +++ /dev/null @@ -1,51 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/Addressable.md -doc/Bar.md -doc/BarApi.md -doc/BarCreate.md -doc/BarRef.md -doc/BarRefOrValue.md -doc/Entity.md -doc/EntityRef.md -doc/Extensible.md -doc/Foo.md -doc/FooApi.md -doc/FooRef.md -doc/FooRefOrValue.md -doc/Pasta.md -doc/Pizza.md -doc/PizzaSpeziale.md -lib/apis.dart -lib/models.dart -lib/openapi.dart -lib/src/api/bar_api.dart -lib/src/api/foo_api.dart -lib/src/api_client.dart -lib/src/auth/_exports.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/addressable.dart -lib/src/model/bar.dart -lib/src/model/bar_create.dart -lib/src/model/bar_ref.dart -lib/src/model/bar_ref_or_value.dart -lib/src/model/date.dart -lib/src/model/entity.dart -lib/src/model/entity_ref.dart -lib/src/model/extensible.dart -lib/src/model/foo.dart -lib/src/model/foo_ref.dart -lib/src/model/foo_ref_or_value.dart -lib/src/model/pasta.dart -lib/src/model/pizza.dart -lib/src/model/pizza_speziale.dart -lib/src/repository_base.dart -lib/src/repository_impl.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md deleted file mode 100644 index 03ab1d62cb01..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# openapi (EXPERIMENTAL) -This tests for a oneOf interface representation - - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 0.0.1 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getBarApi(); -final BarCreate barCreate = ; // BarCreate | - -try { - final response = await api.createBar(barCreate); - print(response); -} catch on DioError (e) { - print("Exception when calling BarApi->createBar: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost:8080* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar -[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo -[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos - - -## Documentation For Models - - - [Addressable](doc/Addressable.md) - - [Bar](doc/Bar.md) - - [BarCreate](doc/BarCreate.md) - - [BarRef](doc/BarRef.md) - - [BarRefOrValue](doc/BarRefOrValue.md) - - [Entity](doc/Entity.md) - - [EntityRef](doc/EntityRef.md) - - [Extensible](doc/Extensible.md) - - [Foo](doc/Foo.md) - - [FooRef](doc/FooRef.md) - - [FooRefOrValue](doc/FooRefOrValue.md) - - [Pasta](doc/Pasta.md) - - [Pizza](doc/Pizza.md) - - [PizzaSpeziale](doc/PizzaSpeziale.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml deleted file mode 100644 index 139ad7abf559..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart deleted file mode 100644 index f615498164ba..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/api.dart +++ /dev/null @@ -1,3 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart deleted file mode 100644 index f615498164ba..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/apis.dart +++ /dev/null @@ -1,3 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart deleted file mode 100644 index 3843a3c6aa4e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/models.dart +++ /dev/null @@ -1,19 +0,0 @@ -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/date_serializer.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/repository_base.dart'; -export 'package:openapi/src/repository_impl.dart'; -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -export 'package:openapi/src/model/foo_ref_or_value.dart'; -export 'package:openapi/src/model/pasta.dart'; -export 'package:openapi/src/model/pizza.dart'; -export 'package:openapi/src/model/pizza_speziale.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart deleted file mode 100644 index 6257a3ba3709..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_client.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'repository_impl.dart'; -import 'package:openapi/apis.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/auth/_exports.dart'; - -class Openapi { - static const String basePath = r'http://localhost:8080'; - - final Dio dio; - final SerializationRepositoryBase serializationRepository; - - - Openapi({ - Dio? dio, - SerializationRepositoryBase? serializationRepositoryOverride, - String? basePathOverride, - List? interceptors, - }) : this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - BarApi getBarApi() { - return BarApi(BarApiRaw(dio), serializationRepository); - } - - /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FooApi getFooApi() { - return FooApi(FooApiRaw(dio), serializationRepository); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart deleted file mode 100644 index 6b618e77ca4e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/json_repository_base.dart +++ /dev/null @@ -1,52 +0,0 @@ -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} - -abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart deleted file mode 100644 index 0efdf678482a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_base.dart +++ /dev/null @@ -1,61 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// It doesn't have to be json, -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart deleted file mode 100644 index 4ad5bcf06143..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/repository_impl.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'serializers.dart'; - -/// Converts our `TypeInfo` to `built_value`'s `FullType` -FullType typeInfoToFullType(TypeInfo info) { - if (info.nullable) { - return FullType.nullable( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } else { - return FullType( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } -} - -class BuiltValueJsonRepository extends SerializationRepositoryBase { - final Serializers serializers; - const BuiltValueJsonRepository(this.serializers); - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - return serializers.deserialize( - value, - specifiedType: typeInfoToFullType(targetTypeInfo), - ) as T; - } - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return serializers.serialize( - src, - specifiedType: typeInfoToFullType(inputTypeInfo), - ) as Object; - } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - -} - -/* -old api_util.dart for reference - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart deleted file mode 100644 index b9393c569811..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart +++ /dev/null @@ -1,51 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; - -import 'package:openapi/models.dart'; -part 'serializers.g.dart'; - -@SerializersFor([ - Addressable,$Addressable, - Bar, - BarCreate, - BarRef, - BarRefOrValue, - Entity,$Entity, - EntityRef,$EntityRef, - Extensible,$Extensible, - Foo, - FooRef, - FooRefOrValue, - Pasta, - Pizza,$Pizza, - PizzaSpeziale, -]) -Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltList, [FullType(FooRefOrValue)]), - () => ListBuilder(), - ) - ..add(Addressable.serializer) - ..add(Entity.serializer) - ..add(EntityRef.serializer) - ..add(Extensible.serializer) - ..add(Pizza.serializer) - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml deleted file mode 100644 index 50f62b7f8dae..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOfPolymorphismAndInheritance - pom - 1.0.0-SNAPSHOT - DartDio OneOf Polymorphism and Inheritance - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml deleted file mode 100644 index 3cc6bce70ed9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.15.0 <3.0.0' - -dependencies: - dio: '^5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES deleted file mode 100644 index 992ec85d9873..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES +++ /dev/null @@ -1,25 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/Child.md -doc/DefaultApi.md -doc/Example.md -lib/apis.dart -lib/models.dart -lib/openapi.dart -lib/src/api/default_api.dart -lib/src/api_client.dart -lib/src/auth/_exports.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/child.dart -lib/src/model/date.dart -lib/src/model/example.dart -lib/src/repository_base.dart -lib/src/repository_impl.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md deleted file mode 100644 index f4134dc61db1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# openapi (EXPERIMENTAL) -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getDefaultApi(); - -try { - final response = await api.list(); - print(response); -} catch on DioError (e) { - print("Exception when calling DefaultApi->list: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://api.example.xyz/v1* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /example | - - -## Documentation For Models - - - [Child](doc/Child.md) - - [Example](doc/Example.md) - - -## Documentation For Authorization - -Endpoints do not require authorization. - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml deleted file mode 100644 index 139ad7abf559..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md deleted file mode 100644 index eeceb6e0b5c7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/openapi.dart'; -``` - -All URIs are relative to *http://api.example.xyz/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**list**](DefaultApi.md#list) | **GET** /example | - - -# **list** -> Example list() - - - -### Example -```dart -import 'package:openapi/openapi.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.list(); - print(response); -} catch on DioError (e) { - print('Exception when calling DefaultApi->list: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Example**](Example.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart deleted file mode 100644 index 61386591c491..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/api.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart deleted file mode 100644 index 61386591c491..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/apis.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'package:openapi/src/api_client.dart'; -export 'package:openapi/src/api/default_api.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart deleted file mode 100644 index 3065efede3e2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/models.dart +++ /dev/null @@ -1,7 +0,0 @@ -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/date_serializer.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/repository_base.dart'; -export 'package:openapi/src/repository_impl.dart'; -export 'package:openapi/src/model/child.dart'; -export 'package:openapi/src/model/example.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart deleted file mode 100644 index 6c3dbb746aa8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart +++ /dev/null @@ -1,8 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -export 'apis.dart'; -export 'models.dart'; -export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart deleted file mode 100644 index 4ba2efc25328..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart +++ /dev/null @@ -1,140 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; -import 'package:dio/dio.dart'; -import 'package:openapi/src/repository_base.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/model/example.dart'; - -class DefaultApi { - - final DefaultApiRaw _rawApi; - final SerializationRepositoryBase _repository; - - const DefaultApi(this._rawApi, this._repository); - - /// list - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Example] as data - /// Throws [DioError] if API call or serialization fails - Future> list({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.list( - - - cancelToken: cancelToken, - headers: headers, - extra: extra, - validateStatus: validateStatus, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Example? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(Example), - ); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} - -class DefaultApiRaw { - - final Dio _dio; - - const DefaultApiRaw(this._dio); - - /// list - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Example] as data - /// Throws [DioError] if API call or serialization fails - Future> list({ - Object? body, - String? requestContentType, - String? acceptContentType, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/example'; - final _options = Options( - method: r'GET', - headers: { - if (acceptContentType != null) 'Accept': acceptContentType, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: requestContentType, - validateStatus: validateStatus, - ); - - return await _dio.request( - _path, - data: body, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - } - -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart deleted file mode 100644 index 566dd6d9e1a6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_client.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'repository_impl.dart'; -import 'package:openapi/apis.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/auth/_exports.dart'; - -class Openapi { - static const String basePath = r'http://api.example.xyz/v1'; - - final Dio dio; - final SerializationRepositoryBase serializationRepository; - - - Openapi({ - Dio? dio, - SerializationRepositoryBase? serializationRepositoryOverride, - String? basePathOverride, - List? interceptors, - }) : this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: const Duration(milliseconds: 5000), - receiveTimeout: const Duration(milliseconds: 3000), - )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - DefaultApi getDefaultApi() { - return DefaultApi(DefaultApiRaw(dio), serializationRepository); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart deleted file mode 100644 index ed3bb12f25b8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart +++ /dev/null @@ -1,77 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart deleted file mode 100644 index f038e92358ef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/_exports.dart +++ /dev/null @@ -1,5 +0,0 @@ -export 'api_key_auth.dart'; -export 'basic_auth.dart'; -export 'oauth.dart'; -export 'bearer_auth.dart'; -export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart deleted file mode 100644 index 06e023d91be5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart deleted file mode 100644 index 6b618e77ca4e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/json_repository_base.dart +++ /dev/null @@ -1,52 +0,0 @@ -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} - -abstract class SerializationRepositoryBase { - Object serialize(T src, TypeInfo parsedType, {Object? context}); - T deserialize(Object value, TypeInfo parsedType, {Object? context}); - - String encodeStringParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeFormParameter(T src, TypeInfo parsedType, {Object? context}); - Object encodeQueryParameter(T src, TypeInfo parsedType, {Object? context}); -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart deleted file mode 100644 index 799b77e4e178..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/child.dart'; -import 'dart:core'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'example.g.dart'; - -/// Example -/// -/// Properties: -/// * [name] -@BuiltValue() -abstract class Example implements Built { - /// One Of [Child], [int] - OneOf get oneOf; - - Example._(); - - factory Example([void updates(ExampleBuilder b)]) = _$Example; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ExampleBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ExampleSerializer(); -} - -class _$ExampleSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [Example, _$Example]; - - @override - final String wireName = r'Example'; - - Iterable _serializeProperties( - Serializers serializers, - Example object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - } - - @override - Object serialize( - Serializers serializers, - Example object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; - } - - @override - Example deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = ExampleBuilder(); - Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); - oneOfDataSrc = serialized; - result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart deleted file mode 100644 index 0efdf678482a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_base.dart +++ /dev/null @@ -1,61 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// It doesn't have to be json, -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart deleted file mode 100644 index 4ad5bcf06143..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/repository_impl.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'serializers.dart'; - -/// Converts our `TypeInfo` to `built_value`'s `FullType` -FullType typeInfoToFullType(TypeInfo info) { - if (info.nullable) { - return FullType.nullable( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } else { - return FullType( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } -} - -class BuiltValueJsonRepository extends SerializationRepositoryBase { - final Serializers serializers; - const BuiltValueJsonRepository(this.serializers); - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - return serializers.deserialize( - value, - specifiedType: typeInfoToFullType(targetTypeInfo), - ) as T; - } - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return serializers.serialize( - src, - specifiedType: typeInfoToFullType(inputTypeInfo), - ) as Object; - } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - -} - -/* -old api_util.dart for reference - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart deleted file mode 100644 index da3ec43a5abf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:one_of_serializer/any_of_serializer.dart'; -import 'package:one_of_serializer/one_of_serializer.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; - -import 'package:openapi/models.dart'; -part 'serializers.g.dart'; - -@SerializersFor([ - Child, - Example, -]) -Serializers serializers = (_$serializers.toBuilder() - ..add(const OneOfSerializer()) - ..add(const AnyOfSerializer()) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml deleted file mode 100644 index cceaebd895f6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioOneOfPrimitive - pom - 1.0.0-SNAPSHOT - DartDio OneOf Primitive - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml deleted file mode 100644 index 3cc6bce70ed9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.15.0 <3.0.0' - -dependencies: - dio: '^5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart deleted file mode 100644 index e4ec57077946..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future list() async - test('test list', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES deleted file mode 100644 index a022a4174113..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ /dev/null @@ -1,127 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -build.yaml -doc/AdditionalPropertiesClass.md -doc/AllOfWithSingleRef.md -doc/Animal.md -doc/AnotherFakeApi.md -doc/ApiResponse.md -doc/ArrayOfArrayOfNumberOnly.md -doc/ArrayOfNumberOnly.md -doc/ArrayTest.md -doc/Capitalization.md -doc/Cat.md -doc/CatAllOf.md -doc/Category.md -doc/ClassModel.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/Dog.md -doc/DogAllOf.md -doc/EnumArrays.md -doc/EnumTest.md -doc/FakeApi.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FooGetDefaultResponse.md -doc/FormatTest.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.md -doc/MapTest.md -doc/MixedPropertiesAndAdditionalPropertiesClass.md -doc/Model200Response.md -doc/ModelClient.md -doc/ModelEnumClass.md -doc/ModelFile.md -doc/ModelList.md -doc/ModelReturn.md -doc/Name.md -doc/NullableClass.md -doc/NumberOnly.md -doc/ObjectWithDeprecatedFields.md -doc/Order.md -doc/OuterComposite.md -doc/OuterEnum.md -doc/OuterEnumDefaultValue.md -doc/OuterEnumInteger.md -doc/OuterEnumIntegerDefaultValue.md -doc/OuterObjectWithEnumProperty.md -doc/Pet.md -doc/PetApi.md -doc/ReadOnlyFirst.md -doc/SingleRefType.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/User.md -doc/UserApi.md -lib/apis.dart -lib/models.dart -lib/openapi.dart -lib/src/api/another_fake_api.dart -lib/src/api/default_api.dart -lib/src/api/fake_api.dart -lib/src/api/fake_classname_tags123_api.dart -lib/src/api/pet_api.dart -lib/src/api/store_api.dart -lib/src/api/user_api.dart -lib/src/api_client.dart -lib/src/auth/_exports.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/model/additional_properties_class.dart -lib/src/model/all_of_with_single_ref.dart -lib/src/model/animal.dart -lib/src/model/api_response.dart -lib/src/model/array_of_array_of_number_only.dart -lib/src/model/array_of_number_only.dart -lib/src/model/array_test.dart -lib/src/model/capitalization.dart -lib/src/model/cat.dart -lib/src/model/cat_all_of.dart -lib/src/model/category.dart -lib/src/model/class_model.dart -lib/src/model/deprecated_object.dart -lib/src/model/dog.dart -lib/src/model/dog_all_of.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/foo_get_default_response.dart -lib/src/model/format_test.dart -lib/src/model/has_only_read_only.dart -lib/src/model/health_check_result.dart -lib/src/model/map_test.dart -lib/src/model/mixed_properties_and_additional_properties_class.dart -lib/src/model/model200_response.dart -lib/src/model/model_client.dart -lib/src/model/model_enum_class.dart -lib/src/model/model_file.dart -lib/src/model/model_list.dart -lib/src/model/model_return.dart -lib/src/model/name.dart -lib/src/model/nullable_class.dart -lib/src/model/number_only.dart -lib/src/model/object_with_deprecated_fields.dart -lib/src/model/order.dart -lib/src/model/outer_composite.dart -lib/src/model/outer_enum.dart -lib/src/model/outer_enum_default_value.dart -lib/src/model/outer_enum_integer.dart -lib/src/model/outer_enum_integer_default_value.dart -lib/src/model/outer_object_with_enum_property.dart -lib/src/model/pet.dart -lib/src/model/read_only_first.dart -lib/src/model/single_ref_type.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/user.dart -lib/src/repository_base.dart -lib/src/repository_impl.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md deleted file mode 100644 index 6234ed44c660..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/openapi.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | - - -# **fooGet** -> FooGetDefaultResponse fooGet() - - - -### Example -```dart -import 'package:openapi/openapi.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.fooGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling DefaultApi->fooGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FooGetDefaultResponse**](FooGetDefaultResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart deleted file mode 100644 index 72645bacac4c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/models.dart +++ /dev/null @@ -1,51 +0,0 @@ - -export 'package:openapi/src/repository_base.dart'; -export 'package:openapi/src/repository_impl.dart'; -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart deleted file mode 100644 index 6c3dbb746aa8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ /dev/null @@ -1,8 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -export 'apis.dart'; -export 'models.dart'; -export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart deleted file mode 100644 index 7e3981b9a72f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart +++ /dev/null @@ -1,140 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; -import 'package:dio/dio.dart'; -import 'package:openapi/src/repository_base.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/model/foo_get_default_response.dart'; - -class DefaultApi { - - final DefaultApiRaw _rawApi; - final SerializationRepositoryBase _repository; - - const DefaultApi(this._rawApi, this._repository); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.fooGet( - - - cancelToken: cancelToken, - headers: headers, - extra: extra, - validateStatus: validateStatus, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooGetDefaultResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(FooGetDefaultResponse), - ); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} - -class DefaultApiRaw { - - final Dio _dio; - - const DefaultApiRaw(this._dio); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - Object? body, - String? requestContentType, - String? acceptContentType, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - if (acceptContentType != null) 'Accept': acceptContentType, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: requestContentType, - validateStatus: validateStatus, - ); - - return await _dio.request( - _path, - data: body, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - } - -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart deleted file mode 100644 index f038e92358ef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/_exports.dart +++ /dev/null @@ -1,5 +0,0 @@ -export 'api_key_auth.dart'; -export 'basic_auth.dart'; -export 'oauth.dart'; -export 'bearer_auth.dart'; -export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart deleted file mode 100644 index d4a3f2ce1834..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ /dev/null @@ -1,202 +0,0 @@ -import 'package:openapi/src/model/additional_properties_class.dart'; -import 'package:openapi/src/model/all_of_with_single_ref.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/array_of_array_of_number_only.dart'; -import 'package:openapi/src/model/array_of_number_only.dart'; -import 'package:openapi/src/model/array_test.dart'; -import 'package:openapi/src/model/capitalization.dart'; -import 'package:openapi/src/model/cat.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/class_model.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:openapi/src/model/dog.dart'; -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/enum_arrays.dart'; -import 'package:openapi/src/model/enum_test.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_get_default_response.dart'; -import 'package:openapi/src/model/format_test.dart'; -import 'package:openapi/src/model/has_only_read_only.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/map_test.dart'; -import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -import 'package:openapi/src/model/model200_response.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:openapi/src/model/model_list.dart'; -import 'package:openapi/src/model/model_return.dart'; -import 'package:openapi/src/model/name.dart'; -import 'package:openapi/src/model/nullable_class.dart'; -import 'package:openapi/src/model/number_only.dart'; -import 'package:openapi/src/model/object_with_deprecated_fields.dart'; -import 'package:openapi/src/model/order.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/special_model_name.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:openapi/src/model/user.dart'; - -final _regList = RegExp(r'^List<(.*)>$'); -final _regSet = RegExp(r'^Set<(.*)>$'); -final _regMap = RegExp(r'^Map$'); - -ReturnType deserialize(dynamic value, String targetType, - {bool growable = true}) { - switch (targetType) { - case 'String': - return '$value' as ReturnType; - case 'int': - return (value is int ? value : int.parse('$value')) as ReturnType; - case 'bool': - if (value is bool) { - return value as ReturnType; - } - final valueString = '$value'.toLowerCase(); - return (valueString == 'true' || valueString == '1') as ReturnType; - case 'double': - return (value is double ? value : double.parse('$value')) as ReturnType; - case 'AdditionalPropertiesClass': - return AdditionalPropertiesClass.fromJson(value as Map) - as ReturnType; - case 'AllOfWithSingleRef': - return AllOfWithSingleRef.fromJson(value as Map) - as ReturnType; - case 'Animal': - return Animal.fromJson(value as Map) as ReturnType; - case 'ApiResponse': - return ApiResponse.fromJson(value as Map) as ReturnType; - case 'ArrayOfArrayOfNumberOnly': - return ArrayOfArrayOfNumberOnly.fromJson(value as Map) - as ReturnType; - case 'ArrayOfNumberOnly': - return ArrayOfNumberOnly.fromJson(value as Map) - as ReturnType; - case 'ArrayTest': - return ArrayTest.fromJson(value as Map) as ReturnType; - case 'Capitalization': - return Capitalization.fromJson(value as Map) - as ReturnType; - case 'Cat': - return Cat.fromJson(value as Map) as ReturnType; - case 'CatAllOf': - return CatAllOf.fromJson(value as Map) as ReturnType; - case 'Category': - return Category.fromJson(value as Map) as ReturnType; - case 'ClassModel': - return ClassModel.fromJson(value as Map) as ReturnType; - case 'DeprecatedObject': - return DeprecatedObject.fromJson(value as Map) - as ReturnType; - case 'Dog': - return Dog.fromJson(value as Map) as ReturnType; - case 'DogAllOf': - return DogAllOf.fromJson(value as Map) as ReturnType; - case 'EnumArrays': - return EnumArrays.fromJson(value as Map) as ReturnType; - case 'EnumTest': - return EnumTest.fromJson(value as Map) as ReturnType; - case 'FileSchemaTestClass': - return FileSchemaTestClass.fromJson(value as Map) - as ReturnType; - case 'Foo': - return Foo.fromJson(value as Map) as ReturnType; - case 'FooGetDefaultResponse': - return FooGetDefaultResponse.fromJson(value as Map) - as ReturnType; - case 'FormatTest': - return FormatTest.fromJson(value as Map) as ReturnType; - case 'HasOnlyReadOnly': - return HasOnlyReadOnly.fromJson(value as Map) - as ReturnType; - case 'HealthCheckResult': - return HealthCheckResult.fromJson(value as Map) - as ReturnType; - case 'MapTest': - return MapTest.fromJson(value as Map) as ReturnType; - case 'MixedPropertiesAndAdditionalPropertiesClass': - return MixedPropertiesAndAdditionalPropertiesClass.fromJson( - value as Map) as ReturnType; - case 'Model200Response': - return Model200Response.fromJson(value as Map) - as ReturnType; - case 'ModelClient': - return ModelClient.fromJson(value as Map) as ReturnType; - case 'ModelEnumClass': - case 'ModelFile': - return ModelFile.fromJson(value as Map) as ReturnType; - case 'ModelList': - return ModelList.fromJson(value as Map) as ReturnType; - case 'ModelReturn': - return ModelReturn.fromJson(value as Map) as ReturnType; - case 'Name': - return Name.fromJson(value as Map) as ReturnType; - case 'NullableClass': - return NullableClass.fromJson(value as Map) - as ReturnType; - case 'NumberOnly': - return NumberOnly.fromJson(value as Map) as ReturnType; - case 'ObjectWithDeprecatedFields': - return ObjectWithDeprecatedFields.fromJson(value as Map) - as ReturnType; - case 'Order': - return Order.fromJson(value as Map) as ReturnType; - case 'OuterComposite': - return OuterComposite.fromJson(value as Map) - as ReturnType; - case 'OuterEnum': - case 'OuterEnumDefaultValue': - case 'OuterEnumInteger': - case 'OuterEnumIntegerDefaultValue': - case 'OuterObjectWithEnumProperty': - return OuterObjectWithEnumProperty.fromJson(value as Map) - as ReturnType; - case 'Pet': - return Pet.fromJson(value as Map) as ReturnType; - case 'ReadOnlyFirst': - return ReadOnlyFirst.fromJson(value as Map) - as ReturnType; - case 'SingleRefType': - case 'SpecialModelName': - return SpecialModelName.fromJson(value as Map) - as ReturnType; - case 'Tag': - return Tag.fromJson(value as Map) as ReturnType; - case 'User': - return User.fromJson(value as Map) as ReturnType; - default: - RegExpMatch? match; - - if (value is List && (match = _regList.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize( - v, targetType, - growable: growable)) - .toList(growable: growable) as ReturnType; - } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize( - v, targetType, - growable: growable)) - .toSet() as ReturnType; - } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - value.keys, - value.values.map((dynamic v) => deserialize( - v, targetType, - growable: growable)), - ) as ReturnType; - } - break; - } - throw Exception('Cannot deserialize'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart deleted file mode 100644 index c6700e2d39ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'api_response.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ApiResponse { - /// Returns a new [ApiResponse] instance. - ApiResponse({ - - this.code, - - this.type, - - this.message, - }); - - @JsonKey( - - name: r'code', - required: false, - includeIfNull: false - ) - - - final int? code; - - - - @JsonKey( - - name: r'type', - required: false, - includeIfNull: false - ) - - - final String? type; - - - - @JsonKey( - - name: r'message', - required: false, - includeIfNull: false - ) - - - final String? message; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is ApiResponse && - other.code == code && - other.type == type && - other.message == message; - - @override - int get hashCode => - code.hashCode + - type.hashCode + - message.hashCode; - - factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); - - Map toJson() => _$ApiResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart deleted file mode 100644 index 30a6ec8a8b72..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'array_test.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ArrayTest { - /// Returns a new [ArrayTest] instance. - ArrayTest({ - - this.arrayOfString, - - this.arrayArrayOfInteger, - - this.arrayArrayOfModel, - }); - - @JsonKey( - - name: r'array_of_string', - required: false, - includeIfNull: false - ) - - - final List? arrayOfString; - - - - @JsonKey( - - name: r'array_array_of_integer', - required: false, - includeIfNull: false - ) - - - final List>? arrayArrayOfInteger; - - - - @JsonKey( - - name: r'array_array_of_model', - required: false, - includeIfNull: false - ) - - - final List>? arrayArrayOfModel; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayTest && - other.arrayOfString == arrayOfString && - other.arrayArrayOfInteger == arrayArrayOfInteger && - other.arrayArrayOfModel == arrayArrayOfModel; - - @override - int get hashCode => - arrayOfString.hashCode + - arrayArrayOfInteger.hashCode + - arrayArrayOfModel.hashCode; - - factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); - - Map toJson() => _$ArrayTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart deleted file mode 100644 index 707cb05a040f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart +++ /dev/null @@ -1,135 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'capitalization.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Capitalization { - /// Returns a new [Capitalization] instance. - Capitalization({ - - this.smallCamel, - - this.capitalCamel, - - this.smallSnake, - - this.capitalSnake, - - this.sCAETHFlowPoints, - - this.ATT_NAME, - }); - - @JsonKey( - - name: r'smallCamel', - required: false, - includeIfNull: false - ) - - - final String? smallCamel; - - - - @JsonKey( - - name: r'CapitalCamel', - required: false, - includeIfNull: false - ) - - - final String? capitalCamel; - - - - @JsonKey( - - name: r'small_Snake', - required: false, - includeIfNull: false - ) - - - final String? smallSnake; - - - - @JsonKey( - - name: r'Capital_Snake', - required: false, - includeIfNull: false - ) - - - final String? capitalSnake; - - - - @JsonKey( - - name: r'SCA_ETH_Flow_Points', - required: false, - includeIfNull: false - ) - - - final String? sCAETHFlowPoints; - - - - /// Name of the pet - @JsonKey( - - name: r'ATT_NAME', - required: false, - includeIfNull: false - ) - - - final String? ATT_NAME; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is Capitalization && - other.smallCamel == smallCamel && - other.capitalCamel == capitalCamel && - other.smallSnake == smallSnake && - other.capitalSnake == capitalSnake && - other.sCAETHFlowPoints == sCAETHFlowPoints && - other.ATT_NAME == ATT_NAME; - - @override - int get hashCode => - smallCamel.hashCode + - capitalCamel.hashCode + - smallSnake.hashCode + - capitalSnake.hashCode + - sCAETHFlowPoints.hashCode + - ATT_NAME.hashCode; - - factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); - - Map toJson() => _$CapitalizationToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart deleted file mode 100644 index b43572d222cb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'foo.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Foo { - /// Returns a new [Foo] instance. - Foo({ - - this.bar = 'bar', - }); - - @JsonKey( - defaultValue: 'bar', - name: r'bar', - required: false, - includeIfNull: false - ) - - - final String? bar; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is Foo && - other.bar == bar; - - @override - int get hashCode => - bar.hashCode; - - factory Foo.fromJson(Map json) => _$FooFromJson(json); - - Map toJson() => _$FooToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart deleted file mode 100644 index acc1c60e4353..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart +++ /dev/null @@ -1,55 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'foo_get_default_response.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FooGetDefaultResponse { - /// Returns a new [FooGetDefaultResponse] instance. - FooGetDefaultResponse({ - - this.string, - }); - - @JsonKey( - - name: r'string', - required: false, - includeIfNull: false - ) - - - final Foo? string; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && - other.string == string; - - @override - int get hashCode => - string.hashCode; - - factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); - - Map toJson() => _$FooGetDefaultResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart deleted file mode 100644 index 91b35595a34d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart +++ /dev/null @@ -1,302 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:dio/dio.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'format_test.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FormatTest { - /// Returns a new [FormatTest] instance. - FormatTest({ - - this.integer, - - this.int32, - - this.int64, - - required this.number, - - this.float, - - this.double_, - - this.decimal, - - this.string, - - required this.byte, - - this.binary, - - required this.date, - - this.dateTime, - - this.uuid, - - required this.password, - - this.patternWithDigits, - - this.patternWithDigitsAndDelimiter, - }); - - // minimum: 10 - // maximum: 100 - @JsonKey( - - name: r'integer', - required: false, - includeIfNull: false - ) - - - final int? integer; - - - - // minimum: 20 - // maximum: 200 - @JsonKey( - - name: r'int32', - required: false, - includeIfNull: false - ) - - - final int? int32; - - - - @JsonKey( - - name: r'int64', - required: false, - includeIfNull: false - ) - - - final int? int64; - - - - // minimum: 32.1 - // maximum: 543.2 - @JsonKey( - - name: r'number', - required: true, - includeIfNull: false - ) - - - final num number; - - - - // minimum: 54.3 - // maximum: 987.6 - @JsonKey( - - name: r'float', - required: false, - includeIfNull: false - ) - - - final double? float; - - - - // minimum: 67.8 - // maximum: 123.4 - @JsonKey( - - name: r'double', - required: false, - includeIfNull: false - ) - - - final double? double_; - - - - @JsonKey( - - name: r'decimal', - required: false, - includeIfNull: false - ) - - - final double? decimal; - - - - @JsonKey( - - name: r'string', - required: false, - includeIfNull: false - ) - - - final String? string; - - - - @JsonKey( - - name: r'byte', - required: true, - includeIfNull: false - ) - - - final String byte; - - - - @JsonKey(ignore: true) - - - final MultipartFile? binary; - - - - @JsonKey( - - name: r'date', - required: true, - includeIfNull: false - ) - - - final DateTime date; - - - - @JsonKey( - - name: r'dateTime', - required: false, - includeIfNull: false - ) - - - final DateTime? dateTime; - - - - @JsonKey( - - name: r'uuid', - required: false, - includeIfNull: false - ) - - - final String? uuid; - - - - @JsonKey( - - name: r'password', - required: true, - includeIfNull: false - ) - - - final String password; - - - - /// A string that is a 10 digit number. Can have leading zeros. - @JsonKey( - - name: r'pattern_with_digits', - required: false, - includeIfNull: false - ) - - - final String? patternWithDigits; - - - - /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - @JsonKey( - - name: r'pattern_with_digits_and_delimiter', - required: false, - includeIfNull: false - ) - - - final String? patternWithDigitsAndDelimiter; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is FormatTest && - other.integer == integer && - other.int32 == int32 && - other.int64 == int64 && - other.number == number && - other.float == float && - other.double_ == double_ && - other.decimal == decimal && - other.string == string && - other.byte == byte && - other.binary == binary && - other.date == date && - other.dateTime == dateTime && - other.uuid == uuid && - other.password == password && - other.patternWithDigits == patternWithDigits && - other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; - - @override - int get hashCode => - integer.hashCode + - int32.hashCode + - int64.hashCode + - number.hashCode + - float.hashCode + - double_.hashCode + - decimal.hashCode + - string.hashCode + - byte.hashCode + - binary.hashCode + - date.hashCode + - dateTime.hashCode + - uuid.hashCode + - password.hashCode + - patternWithDigits.hashCode + - patternWithDigitsAndDelimiter.hashCode; - - factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); - - Map toJson() => _$FormatTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart deleted file mode 100644 index 7ab19eabd5cd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart +++ /dev/null @@ -1,113 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'map_test.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class MapTest { - /// Returns a new [MapTest] instance. - MapTest({ - - this.mapMapOfString, - - this.mapOfEnumString, - - this.directMap, - - this.indirectMap, - }); - - @JsonKey( - - name: r'map_map_of_string', - required: false, - includeIfNull: false - ) - - - final Map>? mapMapOfString; - - - - @JsonKey( - - name: r'map_of_enum_string', - required: false, - includeIfNull: false - ) - - - final Map? mapOfEnumString; - - - - @JsonKey( - - name: r'direct_map', - required: false, - includeIfNull: false - ) - - - final Map? directMap; - - - - @JsonKey( - - name: r'indirect_map', - required: false, - includeIfNull: false - ) - - - final Map? indirectMap; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is MapTest && - other.mapMapOfString == mapMapOfString && - other.mapOfEnumString == mapOfEnumString && - other.directMap == directMap && - other.indirectMap == indirectMap; - - @override - int get hashCode => - mapMapOfString.hashCode + - mapOfEnumString.hashCode + - directMap.hashCode + - indirectMap.hashCode; - - factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); - - Map toJson() => _$MapTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - - -enum MapTestMapOfEnumStringEnum { - @JsonValue(r'UPPER') - UPPER, - @JsonValue(r'lower') - lower, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart deleted file mode 100644 index e2e3cd0b857a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/animal.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'mixed_properties_and_additional_properties_class.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class MixedPropertiesAndAdditionalPropertiesClass { - /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. - MixedPropertiesAndAdditionalPropertiesClass({ - - this.uuid, - - this.dateTime, - - this.map, - }); - - @JsonKey( - - name: r'uuid', - required: false, - includeIfNull: false - ) - - - final String? uuid; - - - - @JsonKey( - - name: r'dateTime', - required: false, - includeIfNull: false - ) - - - final DateTime? dateTime; - - - - @JsonKey( - - name: r'map', - required: false, - includeIfNull: false - ) - - - final Map? map; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && - other.uuid == uuid && - other.dateTime == dateTime && - other.map == map; - - @override - int get hashCode => - uuid.hashCode + - dateTime.hashCode + - map.hashCode; - - factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); - - Map toJson() => _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart deleted file mode 100644 index 6613fa3afc8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart +++ /dev/null @@ -1,102 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'name.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Name { - /// Returns a new [Name] instance. - Name({ - - required this.name, - - this.snakeCase, - - this.property, - - this.n123number, - }); - - @JsonKey( - - name: r'name', - required: true, - includeIfNull: false - ) - - - final int name; - - - - @JsonKey( - - name: r'snake_case', - required: false, - includeIfNull: false - ) - - - final int? snakeCase; - - - - @JsonKey( - - name: r'property', - required: false, - includeIfNull: false - ) - - - final String? property; - - - - @JsonKey( - - name: r'123Number', - required: false, - includeIfNull: false - ) - - - final int? n123number; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is Name && - other.name == name && - other.snakeCase == snakeCase && - other.property == property && - other.n123number == n123number; - - @override - int get hashCode => - name.hashCode + - snakeCase.hashCode + - property.hashCode + - n123number.hashCode; - - factory Name.fromJson(Map json) => _$NameFromJson(json); - - Map toJson() => _$NameToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart deleted file mode 100644 index 897d489ba450..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart +++ /dev/null @@ -1,230 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'nullable_class.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class NullableClass { - /// Returns a new [NullableClass] instance. - NullableClass({ - - this.integerProp, - - this.numberProp, - - this.booleanProp, - - this.stringProp, - - this.dateProp, - - this.datetimeProp, - - this.arrayNullableProp, - - this.arrayAndItemsNullableProp, - - this.arrayItemsNullable, - - this.objectNullableProp, - - this.objectAndItemsNullableProp, - - this.objectItemsNullable, - }); - - @JsonKey( - - name: r'integer_prop', - required: false, - includeIfNull: false - ) - - - final int? integerProp; - - - - @JsonKey( - - name: r'number_prop', - required: false, - includeIfNull: false - ) - - - final num? numberProp; - - - - @JsonKey( - - name: r'boolean_prop', - required: false, - includeIfNull: false - ) - - - final bool? booleanProp; - - - - @JsonKey( - - name: r'string_prop', - required: false, - includeIfNull: false - ) - - - final String? stringProp; - - - - @JsonKey( - - name: r'date_prop', - required: false, - includeIfNull: false - ) - - - final DateTime? dateProp; - - - - @JsonKey( - - name: r'datetime_prop', - required: false, - includeIfNull: false - ) - - - final DateTime? datetimeProp; - - - - @JsonKey( - - name: r'array_nullable_prop', - required: false, - includeIfNull: false - ) - - - final List? arrayNullableProp; - - - - @JsonKey( - - name: r'array_and_items_nullable_prop', - required: false, - includeIfNull: false - ) - - - final List? arrayAndItemsNullableProp; - - - - @JsonKey( - - name: r'array_items_nullable', - required: false, - includeIfNull: false - ) - - - final List? arrayItemsNullable; - - - - @JsonKey( - - name: r'object_nullable_prop', - required: false, - includeIfNull: false - ) - - - final Map? objectNullableProp; - - - - @JsonKey( - - name: r'object_and_items_nullable_prop', - required: false, - includeIfNull: false - ) - - - final Map? objectAndItemsNullableProp; - - - - @JsonKey( - - name: r'object_items_nullable', - required: false, - includeIfNull: false - ) - - - final Map? objectItemsNullable; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is NullableClass && - other.integerProp == integerProp && - other.numberProp == numberProp && - other.booleanProp == booleanProp && - other.stringProp == stringProp && - other.dateProp == dateProp && - other.datetimeProp == datetimeProp && - other.arrayNullableProp == arrayNullableProp && - other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && - other.arrayItemsNullable == arrayItemsNullable && - other.objectNullableProp == objectNullableProp && - other.objectAndItemsNullableProp == objectAndItemsNullableProp && - other.objectItemsNullable == objectItemsNullable; - - @override - int get hashCode => - (integerProp == null ? 0 : integerProp.hashCode) + - (numberProp == null ? 0 : numberProp.hashCode) + - (booleanProp == null ? 0 : booleanProp.hashCode) + - (stringProp == null ? 0 : stringProp.hashCode) + - (dateProp == null ? 0 : dateProp.hashCode) + - (datetimeProp == null ? 0 : datetimeProp.hashCode) + - (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + - (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + - arrayItemsNullable.hashCode + - (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + - (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + - objectItemsNullable.hashCode; - - factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); - - Map toJson() => _$NullableClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart deleted file mode 100644 index 54134b511316..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart +++ /dev/null @@ -1,148 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'order.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Order { - /// Returns a new [Order] instance. - Order({ - - this.id, - - this.petId, - - this.quantity, - - this.shipDate, - - this.status, - - this.complete = false, - }); - - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - - final int? id; - - - - @JsonKey( - - name: r'petId', - required: false, - includeIfNull: false - ) - - - final int? petId; - - - - @JsonKey( - - name: r'quantity', - required: false, - includeIfNull: false - ) - - - final int? quantity; - - - - @JsonKey( - - name: r'shipDate', - required: false, - includeIfNull: false - ) - - - final DateTime? shipDate; - - - - /// Order Status - @JsonKey( - - name: r'status', - required: false, - includeIfNull: false - ) - - - final OrderStatusEnum? status; - - - - @JsonKey( - defaultValue: false, - name: r'complete', - required: false, - includeIfNull: false - ) - - - final bool? complete; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is Order && - other.id == id && - other.petId == petId && - other.quantity == quantity && - other.shipDate == shipDate && - other.status == status && - other.complete == complete; - - @override - int get hashCode => - id.hashCode + - petId.hashCode + - quantity.hashCode + - shipDate.hashCode + - status.hashCode + - complete.hashCode; - - factory Order.fromJson(Map json) => _$OrderFromJson(json); - - Map toJson() => _$OrderToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - -/// Order Status -enum OrderStatusEnum { - @JsonValue(r'placed') - placed, - @JsonValue(r'approved') - approved, - @JsonValue(r'delivered') - delivered, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart deleted file mode 100644 index f2509cb99213..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'outer_composite.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class OuterComposite { - /// Returns a new [OuterComposite] instance. - OuterComposite({ - - this.myNumber, - - this.myString, - - this.myBoolean, - }); - - @JsonKey( - - name: r'my_number', - required: false, - includeIfNull: false - ) - - - final num? myNumber; - - - - @JsonKey( - - name: r'my_string', - required: false, - includeIfNull: false - ) - - - final String? myString; - - - - @JsonKey( - - name: r'my_boolean', - required: false, - includeIfNull: false - ) - - - final bool? myBoolean; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is OuterComposite && - other.myNumber == myNumber && - other.myString == myString && - other.myBoolean == myBoolean; - - @override - int get hashCode => - myNumber.hashCode + - myString.hashCode + - myBoolean.hashCode; - - factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); - - Map toJson() => _$OuterCompositeToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart deleted file mode 100644 index 28d6294bae59..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart +++ /dev/null @@ -1,150 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'pet.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Pet { - /// Returns a new [Pet] instance. - Pet({ - - this.id, - - this.category, - - required this.name, - - required this.photoUrls, - - this.tags, - - this.status, - }); - - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - - final int? id; - - - - @JsonKey( - - name: r'category', - required: false, - includeIfNull: false - ) - - - final Category? category; - - - - @JsonKey( - - name: r'name', - required: true, - includeIfNull: false - ) - - - final String name; - - - - @JsonKey( - - name: r'photoUrls', - required: true, - includeIfNull: false - ) - - - final Set photoUrls; - - - - @JsonKey( - - name: r'tags', - required: false, - includeIfNull: false - ) - - - final List? tags; - - - - /// pet status in the store - @JsonKey( - - name: r'status', - required: false, - includeIfNull: false - ) - - - final PetStatusEnum? status; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is Pet && - other.id == id && - other.category == category && - other.name == name && - other.photoUrls == photoUrls && - other.tags == tags && - other.status == status; - - @override - int get hashCode => - id.hashCode + - category.hashCode + - name.hashCode + - photoUrls.hashCode + - tags.hashCode + - status.hashCode; - - factory Pet.fromJson(Map json) => _$PetFromJson(json); - - Map toJson() => _$PetToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - -/// pet status in the store -enum PetStatusEnum { - @JsonValue(r'available') - available, - @JsonValue(r'pending') - pending, - @JsonValue(r'sold') - sold, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart deleted file mode 100644 index 62f132ce776d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart +++ /dev/null @@ -1,167 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'user.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class User { - /// Returns a new [User] instance. - User({ - - this.id, - - this.username, - - this.firstName, - - this.lastName, - - this.email, - - this.password, - - this.phone, - - this.userStatus, - }); - - @JsonKey( - - name: r'id', - required: false, - includeIfNull: false - ) - - - final int? id; - - - - @JsonKey( - - name: r'username', - required: false, - includeIfNull: false - ) - - - final String? username; - - - - @JsonKey( - - name: r'firstName', - required: false, - includeIfNull: false - ) - - - final String? firstName; - - - - @JsonKey( - - name: r'lastName', - required: false, - includeIfNull: false - ) - - - final String? lastName; - - - - @JsonKey( - - name: r'email', - required: false, - includeIfNull: false - ) - - - final String? email; - - - - @JsonKey( - - name: r'password', - required: false, - includeIfNull: false - ) - - - final String? password; - - - - @JsonKey( - - name: r'phone', - required: false, - includeIfNull: false - ) - - - final String? phone; - - - - /// User Status - @JsonKey( - - name: r'userStatus', - required: false, - includeIfNull: false - ) - - - final int? userStatus; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is User && - other.id == id && - other.username == username && - other.firstName == firstName && - other.lastName == lastName && - other.email == email && - other.password == password && - other.phone == phone && - other.userStatus == userStatus; - - @override - int get hashCode => - id.hashCode + - username.hashCode + - firstName.hashCode + - lastName.hashCode + - email.hashCode + - password.hashCode + - phone.hashCode + - userStatus.hashCode; - - factory User.fromJson(Map json) => _$UserFromJson(json); - - Map toJson() => _$UserToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart deleted file mode 100644 index 0efdf678482a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_base.dart +++ /dev/null @@ -1,61 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// It doesn't have to be json, -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart deleted file mode 100644 index 3f92a1523e19..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/repository_impl.dart +++ /dev/null @@ -1,184 +0,0 @@ -import 'dart:convert'; -import 'dart:typed_data'; -import 'repository_base.dart'; -import 'package:openapi/models.dart'; - -class JsonSerializableRepository extends SerializationRepositoryBase { - JsonSerializableRepository(); - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return jsonEncode(src); - } - - /* ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { }*/ - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - //Dio automatically calls jsonDecode if the value is a string - if (value is String) { - value = jsonDecode(value); - } - switch (targetTypeInfo.root) { - case String: - return valueString as T; - case int: - return (value is num ? value.toInt() : int.parse(value.toString())) as T; - case bool: - if (value is bool) { - return value as T; - } - final valueString = value.toString().toLowerCase(); - return (valueString == 'true' || valueString == '1') as T; - case double: - return (value is num ? value.toDouble() : double.parse(value.toString())) as T; - //TODO: add support for DateTime? - case AdditionalPropertiesClass: - return AdditionalPropertiesClass.fromJson(value as Map) as T; - case AllOfWithSingleRef: - return AllOfWithSingleRef.fromJson(value as Map) as T; - case Animal: - return Animal.fromJson(value as Map) as T; - case ApiResponse: - return ApiResponse.fromJson(value as Map) as T; - case ArrayOfArrayOfNumberOnly: - return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as T; - case ArrayOfNumberOnly: - return ArrayOfNumberOnly.fromJson(value as Map) as T; - case ArrayTest: - return ArrayTest.fromJson(value as Map) as T; - case Capitalization: - return Capitalization.fromJson(value as Map) as T; - case Cat: - return Cat.fromJson(value as Map) as T; - case CatAllOf: - return CatAllOf.fromJson(value as Map) as T; - case Category: - return Category.fromJson(value as Map) as T; - case ClassModel: - return ClassModel.fromJson(value as Map) as T; - case DeprecatedObject: - return DeprecatedObject.fromJson(value as Map) as T; - case Dog: - return Dog.fromJson(value as Map) as T; - case DogAllOf: - return DogAllOf.fromJson(value as Map) as T; - case EnumArrays: - return EnumArrays.fromJson(value as Map) as T; - case EnumTest: - return EnumTest.fromJson(value as Map) as T; - case FileSchemaTestClass: - return FileSchemaTestClass.fromJson(value as Map) as T; - case Foo: - return Foo.fromJson(value as Map) as T; - case FooGetDefaultResponse: - return FooGetDefaultResponse.fromJson(value as Map) as T; - case FormatTest: - return FormatTest.fromJson(value as Map) as T; - case HasOnlyReadOnly: - return HasOnlyReadOnly.fromJson(value as Map) as T; - case HealthCheckResult: - return HealthCheckResult.fromJson(value as Map) as T; - case MapTest: - return MapTest.fromJson(value as Map) as T; - case MixedPropertiesAndAdditionalPropertiesClass: - return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as T; - case Model200Response: - return Model200Response.fromJson(value as Map) as T; - case ModelClient: - return ModelClient.fromJson(value as Map) as T; - case ModelEnumClass: - - - case ModelFile: - return ModelFile.fromJson(value as Map) as T; - case ModelList: - return ModelList.fromJson(value as Map) as T; - case ModelReturn: - return ModelReturn.fromJson(value as Map) as T; - case Name: - return Name.fromJson(value as Map) as T; - case NullableClass: - return NullableClass.fromJson(value as Map) as T; - case NumberOnly: - return NumberOnly.fromJson(value as Map) as T; - case ObjectWithDeprecatedFields: - return ObjectWithDeprecatedFields.fromJson(value as Map) as T; - case Order: - return Order.fromJson(value as Map) as T; - case OuterComposite: - return OuterComposite.fromJson(value as Map) as T; - case OuterEnum: - - - case OuterEnumDefaultValue: - - - case OuterEnumInteger: - - - case OuterEnumIntegerDefaultValue: - - - case OuterObjectWithEnumProperty: - return OuterObjectWithEnumProperty.fromJson(value as Map) as T; - case Pet: - return Pet.fromJson(value as Map) as T; - case ReadOnlyFirst: - return ReadOnlyFirst.fromJson(value as Map) as T; - case SingleRefType: - - - case SpecialModelName: - return SpecialModelName.fromJson(value as Map) as T; - case Tag: - return Tag.fromJson(value as Map) as T; - case User: - return User.fromJson(value as Map) as T; - default: - RegExpMatch? match; - - if (value is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) - .toList(growable: growable) as T; - } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return value - .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) - .toSet() as T; - } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - value.keys, - value.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), - ) as T; - } - break; - } - throw Exception('Cannot deserialize'); - } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context}) { - return src; - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, { - Object? context, - }) { - return src; - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, { - Object? context, - }) { - return src.toString(); - } - - -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart deleted file mode 100644 index 9147e96e4ea8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future fooGet() async - test('test fooGet', () async { - // TODO - }); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart deleted file mode 100644 index 8e95e7503e41..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final Foo? instance = /* Foo(...) */ null; - // TODO add properties to the entity - - group(Foo, () { - // String bar (default value: 'bar') - test('to test the property `bar`', () async { - // TODO - }); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES deleted file mode 100644 index 70622c842298..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ /dev/null @@ -1,129 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/AdditionalPropertiesClass.md -doc/AllOfWithSingleRef.md -doc/Animal.md -doc/AnotherFakeApi.md -doc/ApiResponse.md -doc/ArrayOfArrayOfNumberOnly.md -doc/ArrayOfNumberOnly.md -doc/ArrayTest.md -doc/Capitalization.md -doc/Cat.md -doc/CatAllOf.md -doc/Category.md -doc/ClassModel.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/Dog.md -doc/DogAllOf.md -doc/EnumArrays.md -doc/EnumTest.md -doc/FakeApi.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FooGetDefaultResponse.md -doc/FormatTest.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.md -doc/MapTest.md -doc/MixedPropertiesAndAdditionalPropertiesClass.md -doc/Model200Response.md -doc/ModelClient.md -doc/ModelEnumClass.md -doc/ModelFile.md -doc/ModelList.md -doc/ModelReturn.md -doc/Name.md -doc/NullableClass.md -doc/NumberOnly.md -doc/ObjectWithDeprecatedFields.md -doc/Order.md -doc/OuterComposite.md -doc/OuterEnum.md -doc/OuterEnumDefaultValue.md -doc/OuterEnumInteger.md -doc/OuterEnumIntegerDefaultValue.md -doc/OuterObjectWithEnumProperty.md -doc/Pet.md -doc/PetApi.md -doc/ReadOnlyFirst.md -doc/SingleRefType.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/User.md -doc/UserApi.md -lib/apis.dart -lib/models.dart -lib/openapi.dart -lib/src/api/another_fake_api.dart -lib/src/api/default_api.dart -lib/src/api/fake_api.dart -lib/src/api/fake_classname_tags123_api.dart -lib/src/api/pet_api.dart -lib/src/api/store_api.dart -lib/src/api/user_api.dart -lib/src/api_client.dart -lib/src/auth/_exports.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/additional_properties_class.dart -lib/src/model/all_of_with_single_ref.dart -lib/src/model/animal.dart -lib/src/model/api_response.dart -lib/src/model/array_of_array_of_number_only.dart -lib/src/model/array_of_number_only.dart -lib/src/model/array_test.dart -lib/src/model/capitalization.dart -lib/src/model/cat.dart -lib/src/model/cat_all_of.dart -lib/src/model/category.dart -lib/src/model/class_model.dart -lib/src/model/date.dart -lib/src/model/deprecated_object.dart -lib/src/model/dog.dart -lib/src/model/dog_all_of.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/foo_get_default_response.dart -lib/src/model/format_test.dart -lib/src/model/has_only_read_only.dart -lib/src/model/health_check_result.dart -lib/src/model/map_test.dart -lib/src/model/mixed_properties_and_additional_properties_class.dart -lib/src/model/model200_response.dart -lib/src/model/model_client.dart -lib/src/model/model_enum_class.dart -lib/src/model/model_file.dart -lib/src/model/model_list.dart -lib/src/model/model_return.dart -lib/src/model/name.dart -lib/src/model/nullable_class.dart -lib/src/model/number_only.dart -lib/src/model/object_with_deprecated_fields.dart -lib/src/model/order.dart -lib/src/model/outer_composite.dart -lib/src/model/outer_enum.dart -lib/src/model/outer_enum_default_value.dart -lib/src/model/outer_enum_integer.dart -lib/src/model/outer_enum_integer_default_value.dart -lib/src/model/outer_object_with_enum_property.dart -lib/src/model/pet.dart -lib/src/model/read_only_first.dart -lib/src/model/single_ref_type.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/user.dart -lib/src/repository_base.dart -lib/src/repository_impl.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml deleted file mode 100644 index 139ad7abf559..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart deleted file mode 100644 index 513b9edd08c8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/models.dart +++ /dev/null @@ -1,53 +0,0 @@ -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/date_serializer.dart'; -export 'package:openapi/src/model/date.dart'; -export 'package:openapi/src/repository_base.dart'; -export 'package:openapi/src/repository_impl.dart'; -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_get_default_response.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart deleted file mode 100644 index 6c3dbb746aa8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ /dev/null @@ -1,8 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -export 'apis.dart'; -export 'models.dart'; -export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart deleted file mode 100644 index 7e3981b9a72f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart +++ /dev/null @@ -1,140 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; -import 'package:dio/dio.dart'; -import 'package:openapi/src/repository_base.dart'; -import 'package:openapi/models.dart'; -import 'package:openapi/src/model/foo_get_default_response.dart'; - -class DefaultApi { - - final DefaultApiRaw _rawApi; - final SerializationRepositoryBase _repository; - - const DefaultApi(this._rawApi, this._repository); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - - final _response = await _rawApi.fooGet( - - - cancelToken: cancelToken, - headers: headers, - extra: extra, - validateStatus: validateStatus, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooGetDefaultResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - const TypeInfo(FooGetDefaultResponse), - ); - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} - -class DefaultApiRaw { - - final Dio _dio; - - const DefaultApiRaw(this._dio); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - Object? body, - String? requestContentType, - String? acceptContentType, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - if (acceptContentType != null) 'Accept': acceptContentType, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: requestContentType, - validateStatus: validateStatus, - ); - - return await _dio.request( - _path, - data: body, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - } - -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart deleted file mode 100644 index 7a2534bcfe7c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart +++ /dev/null @@ -1,78 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter( - Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart deleted file mode 100644 index f038e92358ef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/_exports.dart +++ /dev/null @@ -1,5 +0,0 @@ -export 'api_key_auth.dart'; -export 'basic_auth.dart'; -export 'oauth.dart'; -export 'bearer_auth.dart'; -export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ee16e3f0f92f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart deleted file mode 100644 index f7ae9bf3f11e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart deleted file mode 100644 index b6e6dce04f9c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 1d4402b376c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart deleted file mode 100644 index 337cf762b0ce..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart deleted file mode 100644 index 06e023d91be5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart deleted file mode 100644 index 0efdf678482a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_base.dart +++ /dev/null @@ -1,61 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// It doesn't have to be json, -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart deleted file mode 100644 index 4ad5bcf06143..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/repository_impl.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio/dio.dart'; -import 'repository_base.dart'; -import 'serializers.dart'; - -/// Converts our `TypeInfo` to `built_value`'s `FullType` -FullType typeInfoToFullType(TypeInfo info) { - if (info.nullable) { - return FullType.nullable( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } else { - return FullType( - info.root, info.parameters.map(typeInfoToFullType).toList(),); - } -} - -class BuiltValueJsonRepository extends SerializationRepositoryBase { - final Serializers serializers; - const BuiltValueJsonRepository(this.serializers); - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - return serializers.deserialize( - value, - specifiedType: typeInfoToFullType(targetTypeInfo), - ) as T; - } - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return serializers.serialize( - src, - specifiedType: typeInfoToFullType(inputTypeInfo), - ) as Object; - } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - -} - -/* -old api_util.dart for reference - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -*/ \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml deleted file mode 100644 index 3cc6bce70ed9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.15.0 <3.0.0' - -dependencies: - dio: '^5.0.0' - one_of: '>=1.5.0 <2.0.0' - one_of_serializer: '>=1.5.0 <2.0.0' - built_value: '>=8.4.0 <9.0.0' - built_collection: '>=5.1.1 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.4.0 <9.0.0' - build_runner: any - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart deleted file mode 100644 index 9147e96e4ea8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future fooGet() async - test('test fooGet', () async { - // TODO - }); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart deleted file mode 100644 index f840bcda0d17..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final instance = FooBuilder(); - // TODO add properties to the builder and call build() - - group(Foo, () { - // String bar (default value: 'bar') - test('to test the property `bar`', () async { - // TODO - }); - }); -} From 72bd9d4691e90f6c95843acdc77ac80c7dcedc19 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:03:05 +0200 Subject: [PATCH 08/31] merge test schema --- .../src/test/resources/3_0/dart/v3.0.0.yaml | 2503 +++++++++++++++++ 1 file changed, 2503 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml diff --git a/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml new file mode 100644 index 000000000000..79e2ec2ebe1d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml @@ -0,0 +1,2503 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: "https://www.apache.org/licenses/LICENSE-2.0.html" +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user + - name: Foo + - name: Bar +paths: + /foo: + get: + tags: + - Foo + summary: GET all Foos + operationId: getAllFoos + responses: + "200": + $ref: "#/components/responses/200FooArray" + post: + tags: + - Foo + summary: Create a Foo + operationId: createFoo + requestBody: + $ref: "#/components/requestBodies/Foo" + responses: + "201": + $ref: "#/components/responses/201Foo" + /bar: + post: + tags: + - Bar + summary: Create a Bar + operationId: createBar + requestBody: + required: true + content: + "application/json": + schema: + $ref: "#/components/schemas/Bar_Create" + responses: + 200: + description: Bar created + content: + "application/json": + schema: + $ref: "#/components/schemas/Bar" + + /foo-basic: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: "#/components/schemas/Foo" + /pet: + servers: + - url: "http://petstore.swagger.io/v2" + - url: "http://path-server-test.petstore.local/v2" + - url: "http://{server}.swagger.io:{port}/v2" + description: test server with variables + variables: + server: + description: target server + enum: + - "petstore" + - "qa-petstore" + - "dev-petstore" + default: "petstore" + port: + enum: + - "80" + - "8080" + default: "80" + post: + tags: + - pet + summary: Add a new pet to the store + description: "" + operationId: addPet + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - "write:pets" + - "read:pets" + requestBody: + $ref: "#/components/requestBodies/Pet" + put: + tags: + - pet + summary: Update an existing pet + description: "" + operationId: updatePet + x-webclient-blocking: true + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - "write:pets" + - "read:pets" + requestBody: + $ref: "#/components/requestBodies/Pet" + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + x-webclient-blocking: true + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + "200": + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + "400": + description: Invalid status value + security: + - petstore_auth: + - "write:pets" + - "read:pets" + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + x-webclient-blocking: true + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + uniqueItems: true + responses: + "200": + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + uniqueItems: true + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Pet" + uniqueItems: true + "400": + description: Invalid tag value + security: + - petstore_auth: + - "write:pets" + - "read:pets" + deprecated: true + "/pet/{petId}": + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + x-webclient-blocking: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: "" + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - "write:pets" + - "read:pets" + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: "" + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - "write:pets" + - "read:pets" + "/pet/{petId}/uploadImage": + post: + tags: + - pet + summary: uploads an image + description: "" + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + x-webclient-blocking: false + responses: + "200": + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: "" + operationId: placeOrder + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + "400": + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Order" + description: order placed for purchasing the pet + required: true + "/store/order/{order_id}": + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + "400": + description: Invalid ID supplied + "404": + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: "" + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: "#/components/requestBodies/UserArray" + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: "" + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: "#/components/requestBodies/UserArray" + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: "" + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + "200": + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + "400": + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + "/user/{username}": + get: + tags: + - user + summary: Get user by user name + description: "" + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" + "400": + description: Invalid username supplied + "404": + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + /fake_classname_test: + patch: + tags: + - "fake_classname_tags 123#$%^" + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + security: + - api_key_query: [] + requestBody: + $ref: "#/components/requestBodies/Client" + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + requestBody: + $ref: "#/components/requestBodies/Client" + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - "-efg" + - (xyz) + default: "-efg" + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - "-efg" + - (xyz) + default: "-efg" + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + - name: enum_query_model_array + in: query + schema: + type: array + items: + $ref: "#/components/schemas/EnumClass" + responses: + "400": + description: Invalid request + "404": + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - "-efg" + - (xyz) + default: "-efg" + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: "/[a-z]/i" + pattern_without_delimiter: + description: None + type: string + pattern: "^[A-Z].*" + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + "400": + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + "200": + description: Output number + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterNumber" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + /fake/property/enum-int: + post: + tags: + - fake + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + responses: + "200": + description: Output enum (int) + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterObjectWithEnumProperty" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OuterObjectWithEnumProperty" + description: Input enum (int) as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + "200": + description: Output string + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterString" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + "200": + description: Output boolean + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterBoolean" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + "200": + description: Output composite + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterComposite" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: "" + operationId: testJsonFormData + responses: + "200": + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: "" + operationId: testInlineAdditionalProperties + responses: + "200": + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + "200": + description: Success + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: "123_test_@#$%_special_tags" + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + requestBody: + $ref: "#/components/requestBodies/Client" + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request must reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + "200": + description: Success + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + /fake/body-with-binary: + put: + tags: + - fake + description: >- + For this test, the body has to be a binary file. + operationId: testBodyWithBinary + responses: + "200": + description: Success + requestBody: + content: + image/png: + schema: + type: string + nullable: true + format: binary + description: image to upload + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + style: pipeDelimited + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: language + in: query + required: false + schema: + type: object + additionalProperties: + type: string + format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string + responses: + "200": + description: Success + "/fake/{petId}/uploadImageWithRequiredFile": + post: + tags: + - pet + summary: uploads an image (required) + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheckResult" + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: false + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: false + schema: + type: string + security: + - http_signature_test: [] + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + 200: + description: The instance started successfully + /oneof: + get: + responses: + "200": + description: desc + content: + application/json: + schema: + $ref: "#/components/schemas/fruit" + /oneof-primitive: + get: + operationId: list + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/GigaOneOf" + /variant1: + get: + responses: + "200": + description: desc + content: + application/json: + schema: + $ref: "#/components/schemas/fruitVariant1" + put: + operationId: test + parameters: [] + requestBody: + content: + application/json: + schema: {} + responses: + "204": + description: Success + /variant2: + get: + responses: + "200": + description: desc + content: + application/json: + schema: + $ref: "#/components/schemas/FruitAllOfDisc" +servers: + - url: "http://{server}.swagger.io:{port}/v2" + description: petstore server + variables: + server: + enum: + - "petstore" + - "qa-petstore" + - "dev-petstore" + default: "petstore" + port: + enum: + - "80" + - "8080" + default: "80" + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - "v1" + - "v2" + default: "v2" + - url: https://127.0.0.1/no_varaible + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + Foo: + description: The Foo to be created + content: + application/json;charset=utf-8: + schema: + $ref: "#/components/schemas/Foo" + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" + scopes: + "write:pets": modify pets in your account + "read:pets": read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + type: http + scheme: signature + schemas: + FruitType: + properties: + fruitType: + type: string + required: + - fruitType + FruitInlineDisc: + oneOf: + - type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + - type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + discriminator: + propertyName: fruitType + FruitInlineInlineDisc: + oneOf: + - type: object + required: + - seeds + properties: + seeds: + type: integer + oneOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + - type: object + required: + - length + properties: + length: + type: integer + oneOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + discriminator: + propertyName: fruitType + FruitReqDisc: + oneOf: + - $ref: "#/components/schemas/AppleReqDisc" + - $ref: "#/components/schemas/BananaReqDisc" + discriminator: + propertyName: fruitType + AppleReqDisc: + type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + BananaReqDisc: + type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + FruitAllOfDisc: + oneOf: + - $ref: "#/components/schemas/AppleAllOfDisc" + - $ref: "#/components/schemas/BananaAllOfDisc" + discriminator: + propertyName: fruitType + AppleAllOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: "#/components/schemas/FruitType" + BananaAllOfDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: "#/components/schemas/FruitType" + FruitAnyOfDisc: + oneOf: + - $ref: "#/components/schemas/AppleAnyOfDisc" + - $ref: "#/components/schemas/BananaAnyOfDisc" + discriminator: + propertyName: fruitType + AppleAnyOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + anyOf: + - $ref: "#/components/schemas/FruitType" + BananaAnyOfDisc: + type: object + required: + - length + properties: + length: + type: integer + anyOf: + - $ref: "#/components/schemas/FruitType" + FruitOneOfDisc: + oneOf: + - $ref: "#/components/schemas/AppleOneOfDisc" + - $ref: "#/components/schemas/BananaOneOfDisc" + discriminator: + propertyName: fruitType + AppleOneOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + oneOf: + - $ref: "#/components/schemas/FruitType" + BananaOneOfDisc: + type: object + required: + - length + properties: + length: + type: integer + oneOf: + - $ref: "#/components/schemas/FruitType" + FruitGrandparentDisc: + oneOf: + - $ref: "#/components/schemas/AppleGrandparentDisc" + - $ref: "#/components/schemas/BananaGrandparentDisc" + discriminator: + propertyName: fruitType + Parent: + type: object + allOf: + # the FruitType schema is a grandparent of AppleGrandparentDisc + BananaGrandparentDisc + - $ref: "#/components/schemas/FruitType" + AppleGrandparentDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: "#/components/schemas/Parent" + BananaGrandparentDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: "#/components/schemas/Parent" + # ComposedDiscMissingNoProperties: + # oneOf: + # - $ref: "#/components/schemas/DiscMissingNoProperties" + # discriminator: + # propertyName: fruitType + # # Model DiscMissingNoProperties not generated since it's a free-form object + # DiscMissingNoProperties: + # type: object + ComposedDiscMissingFromProperties: + oneOf: + - $ref: "#/components/schemas/DiscMissingFromProperties" + discriminator: + propertyName: fruitType + DiscMissingFromProperties: + type: object + properties: + length: + type: integer + ComposedDiscOptionalTypeCorrect: + oneOf: + - $ref: "#/components/schemas/DiscOptionalTypeCorrect" + discriminator: + propertyName: fruitType + DiscOptionalTypeCorrect: + type: object + properties: + fruitType: + type: string + ComposedDiscOptionalTypeIncorrect: + oneOf: + - $ref: "#/components/schemas/DiscOptionalTypeIncorrect" + discriminator: + propertyName: fruitType + DiscOptionalTypeIncorrect: + type: object + properties: + fruitType: + type: integer + ComposedDiscOptionalTypeInconsistent: + oneOf: + - $ref: "#/components/schemas/DiscOptionalTypeIncorrect" + - $ref: "#/components/schemas/DiscOptionalTypeCorrect" + discriminator: + propertyName: fruitType + ComposedDiscTypeIncorrect: + oneOf: + - $ref: "#/components/schemas/DiscTypeIncorrect" + discriminator: + propertyName: fruitType + DiscTypeIncorrect: + type: object + properties: + fruitType: + type: integer + required: + - fruitType + ComposedDiscTypeInconsistent: + oneOf: + - $ref: "#/components/schemas/DiscTypeIncorrect" + - $ref: "#/components/schemas/FruitType" + discriminator: + propertyName: fruitType + ComposedDiscRequiredInconsistent: + oneOf: + - $ref: "#/components/schemas/DiscOptionalTypeCorrect" + - $ref: "#/components/schemas/FruitType" + discriminator: + propertyName: fruitType + + fruitVariant1: + title: fruit + properties: + color: + type: string + oneOf: + - $ref: "#/components/schemas/appleVariant1" + - $ref: "#/components/schemas/grapesVariant1" + # additionalProperties: + # type: string + # uncomment this when https://github.com/swagger-api/swagger-parser/issues/1252 is resolved + appleVariant1: + title: apple + type: object + properties: + kind: + type: string + applesVariant1: + title: apples + type: object + additionalProperties: + $ref: "#/components/schemas/appleVariant1" + grapeVariant1: + title: grape + type: object + properties: + color: + type: string + grapesVariant1: + title: grapes + type: array + items: + $ref: "#/components/schemas/grapeVariant1" + + GigaOneOf: + oneOf: + - type: string + format: uuid + - type: string + format: date-time + - type: integer + - type: number + - $ref: "#/components/schemas/OneOfPrimitiveChild" + - type: integer + format: int32 + OneOfPrimitiveChild: + type: object + properties: + name: + type: string + + fruit: + title: fruit + properties: + color: + type: string + oneOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + # additionalProperties: + # type: string + # uncomment this when https://github.com/swagger-api/swagger-parser/issues/1252 is resolved + apple: + title: apple + type: object + properties: + kind: + type: string + banana: + title: banana + type: object + properties: + count: + type: number + Addressable: + type: object + properties: + href: + type: string + description: Hyperlink reference + id: + type: string + description: unique identifier + description: Base schema for addressable entities + Extensible: + type: object + properties: + "@schemaLocation": + type: string + description: + A URI to a JSON-Schema file that defines additional attributes + and relationships + "@baseType": + type: string + description: When sub-classing, this defines the super-class + "@type": + type: string + description: When sub-classing, this defines the sub-class Extensible name + required: + - "@type" + Entity: + type: object + discriminator: + propertyName: "@type" + allOf: + - "$ref": "#/components/schemas/Addressable" + - "$ref": "#/components/schemas/Extensible" + EntityRef: + type: object + discriminator: + propertyName: "@type" + description: Entity reference schema to be use for all entityRef class. + properties: + name: + type: string + description: Name of the related entity. + "@referredType": + type: string + description: The actual type of the target instance when needed for disambiguation. + allOf: + - $ref: "#/components/schemas/Addressable" + - "$ref": "#/components/schemas/Extensible" + FooRefOrValue: + type: object + oneOf: + - $ref: "#/components/schemas/Foo" + - $ref: "#/components/schemas/FooRef" + discriminator: + propertyName: "@type" + Foo: + type: object + properties: + fooPropA: + type: string + fooPropB: + type: string + allOf: + - $ref: "#/components/schemas/Entity" + FooRef: + type: object + properties: + foorefPropA: + type: string + allOf: + - $ref: "#/components/schemas/EntityRef" + BarRef: + type: object + allOf: + - $ref: "#/components/schemas/EntityRef" + Bar_Create: + type: object + properties: + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: "#/components/schemas/FooRefOrValue" + allOf: + - $ref: "#/components/schemas/Entity" + Bar: + type: object + required: + - id + properties: + id: + type: string + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: "#/components/schemas/FooRefOrValue" + allOf: + - $ref: "#/components/schemas/Entity" + BarRefOrValue: + type: object + oneOf: + - $ref: "#/components/schemas/Bar" + - $ref: "#/components/schemas/BarRef" + Pizza: + type: object + properties: + pizzaSize: + type: number + allOf: + - $ref: "#/components/schemas/Entity" + Pasta: + type: object + properties: + vendor: + type: string + allOf: + - $ref: "#/components/schemas/Entity" + PizzaSpeziale: + type: object + properties: + toppings: + type: string + allOf: + - $ref: "#/components/schemas/Pizza" + + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + uniqueItems: true + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: "#/components/schemas/Tag" + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: "#/components/schemas/Animal" + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + mapping: + DOG: "#/components/schemas/Dog" + CAT: "#/components/schemas/Cat" + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: "#/components/schemas/Animal" + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: "/[a-z]/i" + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: "-efg" + enum: + - _abc + - "-efg" + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - "" + enum_string_required: + type: string + enum: + - UPPER + - lower + - "" + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: "#/components/schemas/OuterEnum" + outerEnumInteger: + $ref: "#/components/schemas/OuterEnumInteger" + outerEnumDefaultValue: + $ref: "#/components/schemas/OuterEnumDefaultValue" + outerEnumIntegerDefaultValue: + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: "#/components/schemas/Animal" + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: "#/components/schemas/StringBooleanMap" + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: "#/components/schemas/ReadOnlyFirst" + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - ">=" + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: "#/components/schemas/OuterNumber" + my_string: + $ref: "#/components/schemas/OuterString" + my_boolean: + $ref: "#/components/schemas/OuterBoolean" + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: "#/components/schemas/File" + files: + type: array + items: + $ref: "#/components/schemas/File" + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + "$special[property.name]": + type: integer + format: int64 + xml: + name: "$special[model.name]" + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: "#/components/schemas/OuterEnumInteger" + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: "#/components/schemas/DeprecatedObject" + bars: + type: array + deprecated: true + items: + $ref: "#/components/schemas/Bar" + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: "#/components/schemas/SingleRefType" + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user + responses: + "204": + description: Deleted + content: {} + 201Foo: + description: Error + content: + application/json: + schema: + $ref: "#/components/schemas/FooRefOrValue" + 200FooArray: + description: Success + content: + application/json;charset=utf-8: + schema: + type: array + items: + $ref: "#/components/schemas/FooRefOrValue" From 7b3715fdf1eb1493794436d5d1d80e32def8e8a6 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:03:35 +0200 Subject: [PATCH 09/31] WIP --- .../languages/DartDioClientCodegen.java | 5 +- .../resources/dart/libraries/dio/api.mustache | 1 + .../dart/libraries/dio/api_raw.mustache | 5 +- .../dart/libraries/dio/api_typed.mustache | 19 ++-- .../dart/libraries/dio/api_util.mustache | 61 +++++++++++++ .../built_value/repository_impl.mustache | 89 ------------------- .../repository_impl.mustache | 63 +++++-------- .../serialization/repository_base.mustache | 4 - 8 files changed, 100 insertions(+), 147 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 2d107bbf7d46..84963054519f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -289,9 +289,10 @@ private void configureNetworkingLibrary(String sourceFolder) { private void configureNetworkingLibraryDio(String srcFolder) { imports.put("MultipartFile", DIO_IMPORT); final String dioMustacheFolder = "libraries/dio/"; - final String authMustacheFolder = dioMustacheFolder + "auth/"; - supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api_client.dart")); + supportingFiles.add(new SupportingFile(dioMustacheFolder + "api_client.mustache", srcFolder, "api_client.dart")); + supportingFiles.add(new SupportingFile(dioMustacheFolder + "api_util.mustache", srcFolder, "api_util.dart")); final String authFolder = srcFolder + File.separator + "auth"; + final String authMustacheFolder = dioMustacheFolder + "auth/"; supportingFiles.add(new SupportingFile(authMustacheFolder + "auth_exports.mustache", authFolder, "_exports.dart")); supportingFiles.add(new SupportingFile(authMustacheFolder + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); supportingFiles.add(new SupportingFile(authMustacheFolder + "basic_auth.mustache", authFolder, "basic_auth.dart")); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index 3337b1a58c0c..28ac7a46ff54 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/api_util.dart'; import 'package:{{pubName}}/models.dart'; {{#operations}} {{#imports}}import '{{.}}'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache index f35d4e947fc2..212a7814dc6c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache @@ -35,6 +35,7 @@ class {{classname}}Raw { Object? body, String? requestContentType, String? acceptContentType, + ResponseType? responseType, CancelToken? cancelToken, Map? headers, Map? extra, @@ -45,9 +46,6 @@ class {{classname}}Raw { final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; final _options = Options( method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', - {{#isResponseFile}} - responseType: ResponseType.bytes, - {{/isResponseFile}} headers: { {{#httpUserAgent}} r'User-Agent': r'{{{.}}}', @@ -71,6 +69,7 @@ class {{classname}}Raw { ...?extra, }, contentType: requestContentType, + responseType: responseType, validateStatus: validateStatus, );{{#hasQueryParams}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache index 3e65e0bf065b..523a843b56e4 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache @@ -1,9 +1,9 @@ class {{classname}} { - final {{classname}}Raw _rawApi; + final {{classname}}Raw rawApi; final SerializationRepositoryBase _repository; - const {{classname}}(this._rawApi, this._repository); + const {{classname}}(this.rawApi, this._repository); {{#operation}} /// {{summary}}{{^summary}}{{nickname}}{{/summary}} @@ -49,14 +49,14 @@ class {{classname}} { {{#isMultipart}} _bodyData = FormData.fromMap({ {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}_repository.encodeFormParameter({{{paramName}}}, {{>types/recursion_base_type_info}}){{/isFile}}, + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_base_type_info}}){{/isFile}}, {{/formParams}} }); {{/isMultipart}} {{^isMultipart}} _bodyData = { {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': _repository.encodeFormParameter({{{paramName}}}, {{>types/recursion_base_type_info}}), + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_base_type_info}}), {{/formParams}} }; {{/isMultipart}} @@ -71,17 +71,20 @@ class {{classname}} { {{/bodyParam}} {{/hasBodyOrFormParams}} - final _response = await _rawApi.{{nickname}}( + final _response = await rawApi.{{nickname}}( {{#allParams}}{{#isPathParam}} - {{paramName}}: _repository.encodeStringParameter({{paramName}}, {{>types/recursion_base_type_info}}),{{/isPathParam}}{{#isQueryParam}} - {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.encodeQueryParameter({{paramName}}, {{>types/recursion_base_type_info}}{{#collectionFormat}}, context: ListFormat.{{collectionFormat}}{{/collectionFormat}}) ,{{/isQueryParam}}{{#isHeaderParam}} - {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.encodeStringParameter({{paramName}}, {{>types/recursion_base_type_info}}) ,{{/isHeaderParam}}{{/allParams}} + {{paramName}}: _repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString(),{{/isPathParam}}{{#isQueryParam}} + {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_base_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}) ,{{/isQueryParam}}{{#isHeaderParam}} + {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString() ,{{/isHeaderParam}}{{/allParams}} {{#hasConsumes}} body: _bodyData, requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} cancelToken: cancelToken, headers: headers, extra: extra, + {{#isResponseFile}} + responseType: responseType.bytes, + {{/isResponseFile}} validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache new file mode 100644 index 000000000000..1bc33e18abee --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache @@ -0,0 +1,61 @@ +import 'package:dio/dio.dart'; +import 'dart:convert'; +import 'package:openapi/models.dart'; +import 'dart:typed_data'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +Object encodeFormParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +Object encodeQueryParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +ListParam encodeCollectionQueryParameter( + SerializationRepositoryBase repository, + Iterable value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = repository.serialize( + value, + type, + ); + if (serialized is Iterable) { + return ListParam(serialized.toList(), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache index 75a8d82b735a..6978920951b3 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache @@ -39,93 +39,4 @@ class BuiltValueJsonRepository extends SerializationRepositoryBase { specifiedType: typeInfoToFullType(inputTypeInfo), ) as Object; } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}) { - - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, - {Object? context,}) { - } - - } - -/* -old api_util.dart for reference - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache index a243ac68c048..57e84455c5d1 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache @@ -11,84 +11,65 @@ class JsonSerializableRepository extends SerializationRepositoryBase { return jsonEncode(src); } - /* ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { }*/ @override T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - //Dio automatically calls jsonDecode if the value is a string - if (value is String) { - value = jsonDecode(value); + Object valueParsed; + if (context == 'decodedJson') { + //if we are deserializing a decoded json, don't decode it again. + valueParsed = value; + } else { + valueParsed = jsonDecode(value.toString()) as Object; } switch (targetTypeInfo.root) { case String: - return valueString as T; + return valueParsed as T; case int: - return (value is num ? value.toInt() : int.parse(value.toString())) as T; + return (valueParsed is num ? valueParsed.toInt() : int.parse(valueParsed.toString())) as T; case bool: - if (value is bool) { - return value as T; + if (valueParsed is bool) { + return valueParsed as T; } - final valueString = value.toString().toLowerCase(); + final valueString = valueParsed.toString().toLowerCase(); return (valueString == 'true' || valueString == '1') as T; case double: - return (value is num ? value.toDouble() : double.parse(value.toString())) as T; + return (valueParsed is num ? valueParsed.toDouble() : double.parse(valueParsed.toString())) as T; //TODO: add support for DateTime? {{#models}} {{#model}} case {{{classname}}}: {{#isEnum}} - {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} - {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(valueParsed);{{/native_serialization}} + {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, valueParsed);{{/json_serializable}} {{/isEnum}} {{^isEnum}} - return {{{classname}}}.fromJson(value as Map) as T; + return {{{classname}}}.fromJson(valueParsed as Map) as T; {{/isEnum}} {{/model}} {{/models}} default: RegExpMatch? match; - if (value is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { + if (valueParsed is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { targetType = match![1]!; // ignore: parameter_assignments - return value + return valueParsed .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) .toList(growable: growable) as T; } - if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + if (valueParsed is Set && (match = _regSet.firstMatch(targetType)) != null) { targetType = match![1]!; // ignore: parameter_assignments - return value + return valueParsed .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) .toSet() as T; } - if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + if (valueParsed is Map && (match = _regMap.firstMatch(targetType)) != null) { targetType = match![1]!; // ignore: parameter_assignments return Map.fromIterables( - value.keys, - value.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), + valueParsed.keys, + valueParsed.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), ) as T; } break; } throw Exception('Cannot deserialize'); } - - @override - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context}) { - return src; - } - - @override - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, { - Object? context, - }) { - return src; - } - - @override - String encodeStringParameter(T src, TypeInfo inputTypeInfo, { - Object? context, - }) { - return src.toString(); - } - - } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache index 0efdf678482a..4d0b9eb3fda1 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache @@ -7,10 +7,6 @@ abstract class SerializationRepositoryBase { Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); - - String encodeStringParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeFormParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); - Object encodeQueryParameter(T src, TypeInfo inputTypeInfo, {Object? context,}); } /// A modified version of `built_value`'s `FullType` class, found here From 9b6e6aa68d8a391f3ddfc1a1d78f5b321f4d669a Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:09:32 +0200 Subject: [PATCH 10/31] fix pom location --- pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 727254bdc14e..1e4bb1e07e6d 100644 --- a/pom.xml +++ b/pom.xml @@ -1330,11 +1330,8 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib - samples/openapi3/client/petstore/dart-dio/oneof - samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance - samples/openapi3/client/petstore/dart-dio/oneof_primitive - samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake - samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable + samples/openapi3/client/petstore/dart-dio/built_value + samples/openapi3/client/petstore/dart-dio/json_serializable From 7893bd6976d7d9bf57ff624258834189496f45da Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:13:16 +0200 Subject: [PATCH 11/31] fix pom locations --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1e4bb1e07e6d..a5bfb5b7a24e 100644 --- a/pom.xml +++ b/pom.xml @@ -1330,8 +1330,8 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib - samples/openapi3/client/petstore/dart-dio/built_value - samples/openapi3/client/petstore/dart-dio/json_serializable + samples/openapi3/client/petstore/dart-dio/dio/built_value + samples/openapi3/client/petstore/dart-dio/dio/json_serializable From c4b5c2b49140750c08bbdb5b3054ffe65c70f60b Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:41:58 +0200 Subject: [PATCH 12/31] WIP test improvements --- .../built_value_tests/analysis_options.yaml | 6 +- .../dio/built_value_tests/pubspec.yaml | 14 +- .../built_value_tests/test/api_util_test.dart | 123 +++++++++--------- 3 files changed, 72 insertions(+), 71 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml index a611887d3acf..4fbcc289dd3f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml @@ -2,8 +2,4 @@ analyzer: language: strict-inference: true strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart + strict-casts: true \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml index 1bf1491bd60e..e51b6fde72e2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml @@ -5,14 +5,14 @@ description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake publish_to: none environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' dev_dependencies: - built_collection: 5.1.1 - built_value: 8.4.3 - dio: 5.0.0 - http_mock_adapter: 0.4.2 - mockito: 5.2.0 + built_collection: ^5.1.1 + built_value: ^8.4.3 + dio: ^5.0.0 + http_mock_adapter: ^0.4.2 + mockito: ^5.2.0 openapi: path: ../built_value - test: 1.21.0 + test: ^1.21.0 diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart index 4b0bf354ccaa..8b008ef6c5cc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart @@ -7,14 +7,15 @@ import 'package:test/test.dart'; void main() { group('api_utils', () { + final repository = BuiltValueJsonRepository(standardSerializers); group('encodeQueryParameter should encode', () { group('String enum', () { test('empty String for null', () { expect( encodeQueryParameter( - standardSerializers, + repository, null, - const FullType(ModelEnumClass), + const TypeInfo(ModelEnumClass), ), '', ); @@ -23,9 +24,9 @@ void main() { test('correct String for value', () { expect( encodeQueryParameter( - standardSerializers, + repository, ModelEnumClass.leftParenthesisXyzRightParenthesis, - const FullType(ModelEnumClass), + const TypeInfo(ModelEnumClass), ), '(xyz)', ); @@ -36,9 +37,9 @@ void main() { test('empty String for null', () { expect( encodeQueryParameter( - standardSerializers, + repository, null, - const FullType(EnumTestEnumIntegerEnum), + const TypeInfo(EnumTestEnumIntegerEnum), ), '', ); @@ -47,9 +48,9 @@ void main() { test('correct int for value', () { expect( encodeQueryParameter( - standardSerializers, + repository, EnumTestEnumIntegerEnum.numberNegative1, - const FullType(EnumTestEnumIntegerEnum), + const TypeInfo(EnumTestEnumIntegerEnum), ), -1, ); @@ -68,13 +69,13 @@ void main() { () => ListBuilder(), )) .build(); - + final repository = BuiltValueJsonRepository(serializers); group('String enum', () { test('empty ListParam for empty list', () { final param = encodeCollectionQueryParameter( - serializers, + repository, [].build(), - const FullType(BuiltList, [FullType(ModelEnumClass)]), + const TypeInfo(BuiltList, [TypeInfo(ModelEnumClass)]), ); expect(param.value, isEmpty); @@ -83,12 +84,12 @@ void main() { test('correct ListParam for value', () { final param = encodeCollectionQueryParameter( - serializers, + repository, [ ModelEnumClass.leftParenthesisXyzRightParenthesis, ModelEnumClass.efg, ].build(), - const FullType(BuiltList, [FullType(ModelEnumClass)]), + const TypeInfo(BuiltList, [TypeInfo(ModelEnumClass)]), ); expect(param.value, hasLength(2)); @@ -100,9 +101,9 @@ void main() { group('int enum', () { test('empty ListParam for empty list', () { final param = encodeCollectionQueryParameter( - serializers, + repository, [].build(), - const FullType(BuiltList, [FullType(EnumTestEnumIntegerEnum)]), + const TypeInfo(BuiltList, [TypeInfo(EnumTestEnumIntegerEnum)]), ); expect(param.value, isEmpty); @@ -111,12 +112,12 @@ void main() { test('correct ListParam for value', () { final param = encodeCollectionQueryParameter( - serializers, + repository, [ EnumTestEnumIntegerEnum.number1, EnumTestEnumIntegerEnum.numberNegative1, ].build(), - const FullType(BuiltList, [FullType(EnumTestEnumIntegerEnum)]), + const TypeInfo(BuiltList, [TypeInfo(EnumTestEnumIntegerEnum)]), ); expect(param.value, hasLength(2)); @@ -130,9 +131,9 @@ void main() { test('empty String for null', () { expect( encodeFormParameter( - standardSerializers, + repository, null, - const FullType(Cat), + const TypeInfo(Cat), ), '', ); @@ -141,9 +142,9 @@ void main() { test('String for String', () { expect( encodeFormParameter( - standardSerializers, + repository, 'foo', - const FullType(String), + const TypeInfo(String), ), 'foo', ); @@ -152,9 +153,9 @@ void main() { test('List for BuiltList', () { expect( encodeFormParameter( - standardSerializers, + repository, ListBuilder(['foo', 'bar', 'baz']).build(), - const FullType(BuiltList, [FullType(String)]), + const TypeInfo(BuiltList, [TypeInfo(String)]), ), ['foo', 'bar', 'baz'], ); @@ -163,13 +164,13 @@ void main() { test('Map for BuiltList', () { expect( encodeFormParameter( - standardSerializers, + repository, MapBuilder({ 'foo': 'foo-value', 'bar': 'bar-value', 'baz': 'baz-value', }).build(), - const FullType(BuiltMap, [FullType(String), FullType(String)]), + const TypeInfo(BuiltMap, [TypeInfo(String), TypeInfo(String)]), ), { 'foo': 'foo-value', @@ -181,20 +182,19 @@ void main() { test('num for num', () { expect( - encodeFormParameter(standardSerializers, 0, const FullType(int)), + encodeFormParameter(repository, 0, const TypeInfo(int)), 0, ); expect( - encodeFormParameter(standardSerializers, 1, const FullType(int)), + encodeFormParameter(repository, 1, const TypeInfo(int)), 1, ); expect( - encodeFormParameter(standardSerializers, 1.0, const FullType(num)), + encodeFormParameter(repository, 1.0, const TypeInfo(num)), 1.0, ); expect( - encodeFormParameter( - standardSerializers, 1.234, const FullType(double)), + encodeFormParameter(repository, 1.234, const TypeInfo(double)), 1.234, ); }); @@ -202,9 +202,9 @@ void main() { test('List for BuiltList', () { expect( encodeFormParameter( - standardSerializers, + repository, ListBuilder([0, 1, 2, 3, 4.5, -123.456]).build(), - const FullType(BuiltList, [FullType(num)]), + const TypeInfo(BuiltList, [TypeInfo(num)]), ), [0, 1, 2, 3, 4.5, -123.456], ); @@ -213,17 +213,17 @@ void main() { test('bool for bool', () { expect( encodeFormParameter( - standardSerializers, + repository, true, - const FullType(bool), + const TypeInfo(bool), ), true, ); expect( encodeFormParameter( - standardSerializers, + repository, false, - const FullType(bool), + const TypeInfo(bool), ), false, ); @@ -232,9 +232,9 @@ void main() { test('String for Date', () { expect( encodeFormParameter( - standardSerializers, + repository, DateTime.utc(2020, 8, 11), - const FullType(DateTime), + const TypeInfo(DateTime), ), '2020-08-11T00:00:00.000Z', ); @@ -243,9 +243,9 @@ void main() { test('String for DateTime', () { expect( encodeFormParameter( - standardSerializers, + repository, DateTime.utc(2020, 8, 11, 12, 30, 55, 123), - const FullType(DateTime), + const TypeInfo(DateTime), ), '2020-08-11T12:30:55.123Z', ); @@ -254,17 +254,22 @@ void main() { test('JSON String for Cat', () { // Not sure that is even a valid case, // sending complex objects via FormData may not work as expected + expect( encodeFormParameter( - standardSerializers, + repository, (CatBuilder() ..color = 'black' ..className = 'cat' ..declawed = false) .build(), - const FullType(Cat), + const TypeInfo(Cat), ), - '{"className":"cat","color":"black","declawed":false}', + equals({ + "className": "cat", + "color": "black", + "declawed": false, + }), ); }); }); @@ -272,48 +277,48 @@ void main() { test('encodes FormData correctly', () { final data = FormData.fromMap({ 'null': encodeFormParameter( - standardSerializers, + repository, null, - const FullType(num), + const TypeInfo(num), ), 'empty': encodeFormParameter( - standardSerializers, + repository, '', - const FullType(String), + const TypeInfo(String), ), 'string_list': encodeFormParameter( - standardSerializers, + repository, ListBuilder(['foo', 'bar', 'baz']).build(), - const FullType(BuiltList, [FullType(String)]), + const TypeInfo(BuiltList, [TypeInfo(String)]), ), 'num_list': encodeFormParameter( - standardSerializers, + repository, ListBuilder([0, 1, 2, 3, 4.5, -123.456]).build(), - const FullType(BuiltList, [FullType(num)]), + const TypeInfo(BuiltList, [TypeInfo(num)]), ), 'string_map': encodeFormParameter( - standardSerializers, + repository, MapBuilder({ 'foo': 'foo-value', 'bar': 'bar-value', 'baz': 'baz-value', }).build(), - const FullType(BuiltMap, [FullType(String), FullType(String)]), + const TypeInfo(BuiltMap, [TypeInfo(String), TypeInfo(String)]), ), 'bool': encodeFormParameter( - standardSerializers, + repository, true, - const FullType(bool), + const TypeInfo(bool), ), 'double': encodeFormParameter( - standardSerializers, + repository, -123.456, - const FullType(double), + const TypeInfo(double), ), 'date_time': encodeFormParameter( - standardSerializers, + repository, DateTime.utc(2020, 8, 11, 12, 30, 55, 123), - const FullType(DateTime), + const TypeInfo(DateTime), ), }); From 99567851ae8f5f4d16407a9ab6f6e23ea8e31518 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:49:09 +0200 Subject: [PATCH 13/31] don't exclude tests from analysis options --- .../src/main/resources/dart/analysis_options.mustache | 10 +++++----- .../dart-dio/dio/built_value/analysis_options.yaml | 10 +++++----- .../dio/json_serializable/analysis_options.yaml | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/analysis_options.mustache index a83aae97f5e6..e050affe9b73 100644 --- a/modules/openapi-generator/src/main/resources/dart/analysis_options.mustache +++ b/modules/openapi-generator/src/main/resources/dart/analysis_options.mustache @@ -2,11 +2,11 @@ analyzer: language: strict-inference: true strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart{{#useJsonSerializable}} + strict-casts: true + exclude: {{#useJsonSerializable}} - lib/src/model/*.g.dart{{/useJsonSerializable}} errors: deprecated_member_use_from_same_package: ignore + unused_import: ignore + unused_local_variable: ignore + unnecessary_import: ignore \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml index 139ad7abf559..c84e864f76be 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml @@ -2,10 +2,10 @@ analyzer: language: strict-inference: true strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart + strict-casts: true + exclude: errors: deprecated_member_use_from_same_package: ignore + unused_import: ignore + unused_local_variable: ignore + unnecessary_import: ignore \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml index ac01482530cc..2bb925d60c15 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml @@ -2,11 +2,11 @@ analyzer: language: strict-inference: true strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart + strict-casts: true + exclude: - lib/src/model/*.g.dart errors: deprecated_member_use_from_same_package: ignore + unused_import: ignore + unused_local_variable: ignore + unnecessary_import: ignore \ No newline at end of file From 34760b5ac7452c74201ef72ba61c6408b7af7a5a Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:58:04 +0200 Subject: [PATCH 14/31] remove TODOs from test projects --- .../src/main/resources/dart/libraries/dio/api_test.mustache | 2 +- .../src/main/resources/dart/libraries/http/api_test.mustache | 2 +- .../src/main/resources/dart/libraries/http/model_test.mustache | 2 +- .../src/main/resources/dart/model_test.mustache | 2 +- .../dart/serialization/built_value/test_instance.mustache | 2 +- .../serialization/json_serializable/repository_impl.mustache | 2 +- .../dart/serialization/json_serializable/test_instance.mustache | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache index 8420ac5dfaf7..3adeec7072af 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache @@ -19,7 +19,7 @@ void main() { {{/notes}} //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { - // TODO + }); {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache index 6873ba0f9d4d..442885a38ae6 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache @@ -20,7 +20,7 @@ void main() { {{/notes}} //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { - // TODO + }); {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache index 1a074d47b71d..53facddb67be 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache @@ -17,7 +17,7 @@ void main() { {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { - // TODO + }); {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/model_test.mustache index 2c188ea7dc50..e11b878ff632 100644 --- a/modules/openapi-generator/src/main/resources/dart/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/model_test.mustache @@ -17,7 +17,7 @@ void main() { {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { - // TODO + }); {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache index 2d92c472df31..993f5db1d64f 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache @@ -1,2 +1,2 @@ {{#vendorExtensions.x-is-parent}}//{{/vendorExtensions.x-is-parent}}final instance = {{{classname}}}Builder(); - // TODO add properties to the builder and call build() \ No newline at end of file + // add properties to the builder and call build() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache index 57e84455c5d1..f3e9445798f9 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache @@ -33,7 +33,7 @@ class JsonSerializableRepository extends SerializationRepositoryBase { return (valueString == 'true' || valueString == '1') as T; case double: return (valueParsed is num ? valueParsed.toDouble() : double.parse(valueParsed.toString())) as T; - //TODO: add support for DateTime? + {{! TODO: add support for DateTime? }} {{#models}} {{#model}} case {{{classname}}}: diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache index 1b32f6768164..489ed278e439 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache +++ b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache @@ -1,2 +1,2 @@ final {{{classname}}}? instance = /* {{{classname}}}(...) */ null; - // TODO add properties to the entity \ No newline at end of file + // add properties to the entity \ No newline at end of file From 3336772789c74a52c83be2b053e760d5203b0832 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 01:58:12 +0200 Subject: [PATCH 15/31] gen samples --- .../additional_properties_class_test.dart | 10 +-- .../built_value/test/addressable_test.dart | 10 +-- .../test/all_of_with_single_ref_test.dart | 10 +-- .../dio/built_value/test/animal_test.dart | 10 +-- .../test/another_fake_api_test.dart | 4 +- .../built_value/test/api_response_test.dart | 14 ++-- .../test/apple_all_of_disc_test.dart | 10 +-- .../test/apple_any_of_disc_test.dart | 10 +-- .../test/apple_grandparent_disc_test.dart | 10 +-- .../test/apple_one_of_disc_test.dart | 10 +-- .../built_value/test/apple_req_disc_test.dart | 10 +-- .../dio/built_value/test/apple_test.dart | 6 +- .../built_value/test/apple_variant1_test.dart | 6 +- .../array_of_array_of_number_only_test.dart | 6 +- .../test/array_of_number_only_test.dart | 6 +- .../dio/built_value/test/array_test_test.dart | 14 ++-- .../test/banana_all_of_disc_test.dart | 10 +-- .../test/banana_any_of_disc_test.dart | 10 +-- .../test/banana_grandparent_disc_test.dart | 10 +-- .../test/banana_one_of_disc_test.dart | 10 +-- .../test/banana_req_disc_test.dart | 10 +-- .../dio/built_value/test/banana_test.dart | 6 +- .../dio/built_value/test/bar_api_test.dart | 4 +- .../dio/built_value/test/bar_create_test.dart | 34 +++------- .../test/bar_ref_or_value_test.dart | 22 ++---- .../dio/built_value/test/bar_ref_test.dart | 22 ++---- .../dio/built_value/test/bar_test.dart | 34 +++------- .../built_value/test/capitalization_test.dart | 26 ++----- .../dio/built_value/test/cat_all_of_test.dart | 6 +- .../dio/built_value/test/cat_test.dart | 14 ++-- .../dio/built_value/test/category_test.dart | 10 +-- .../built_value/test/class_model_test.dart | 6 +- ...sed_disc_missing_from_properties_test.dart | 6 +- ...posed_disc_optional_type_correct_test.dart | 6 +- ..._disc_optional_type_inconsistent_test.dart | 6 +- ...sed_disc_optional_type_incorrect_test.dart | 6 +- ...posed_disc_required_inconsistent_test.dart | 6 +- .../composed_disc_type_inconsistent_test.dart | 6 +- .../composed_disc_type_incorrect_test.dart | 6 +- .../built_value/test/default_api_test.dart | 24 ++----- .../test/deprecated_object_test.dart | 6 +- .../disc_missing_from_properties_test.dart | 6 +- .../test/disc_optional_type_correct_test.dart | 6 +- .../disc_optional_type_incorrect_test.dart | 6 +- .../test/disc_type_incorrect_test.dart | 6 +- .../dio/built_value/test/dog_all_of_test.dart | 6 +- .../dio/built_value/test/dog_test.dart | 14 ++-- .../dio/built_value/test/entity_ref_test.dart | 30 +++----- .../dio/built_value/test/entity_test.dart | 22 ++---- .../built_value/test/enum_arrays_test.dart | 10 +-- .../dio/built_value/test/enum_test_test.dart | 34 +++------- .../dio/built_value/test/extensible_test.dart | 14 ++-- .../dio/built_value/test/fake_api_test.dart | 68 +++++-------------- .../test/fake_classname_tags123_api_test.dart | 4 +- .../test/file_schema_test_class_test.dart | 10 +-- .../dio/built_value/test/foo_api_test.dart | 8 +-- .../foo_basic_get_default_response_test.dart | 6 +- .../test/foo_ref_or_value_test.dart | 22 ++---- .../dio/built_value/test/foo_ref_test.dart | 26 ++----- .../dio/built_value/test/foo_test.dart | 30 +++----- .../built_value/test/format_test_test.dart | 66 +++++------------- .../test/fruit_all_of_disc_test.dart | 6 +- .../test/fruit_any_of_disc_test.dart | 6 +- .../test/fruit_grandparent_disc_test.dart | 6 +- .../test/fruit_inline_disc_one_of1_test.dart | 10 +-- .../test/fruit_inline_disc_one_of_test.dart | 10 +-- .../test/fruit_inline_disc_test.dart | 14 ++-- ...fruit_inline_inline_disc_one_of1_test.dart | 10 +-- ...inline_inline_disc_one_of_one_of_test.dart | 6 +- .../fruit_inline_inline_disc_one_of_test.dart | 10 +-- .../test/fruit_inline_inline_disc_test.dart | 6 +- .../test/fruit_one_of_disc_test.dart | 6 +- .../built_value/test/fruit_req_disc_test.dart | 14 ++-- .../dio/built_value/test/fruit_test.dart | 14 ++-- .../dio/built_value/test/fruit_type_test.dart | 6 +- .../built_value/test/fruit_variant1_test.dart | 10 +-- .../built_value/test/giga_one_of_test.dart | 6 +- .../built_value/test/grape_variant1_test.dart | 6 +- .../test/has_only_read_only_test.dart | 10 +-- .../test/health_check_result_test.dart | 6 +- .../dio/built_value/test/map_test_test.dart | 18 ++--- ..._and_additional_properties_class_test.dart | 14 ++-- .../test/model200_response_test.dart | 10 +-- .../built_value/test/model_client_test.dart | 6 +- .../dio/built_value/test/model_file_test.dart | 6 +- .../dio/built_value/test/model_list_test.dart | 6 +- .../built_value/test/model_return_test.dart | 6 +- .../dio/built_value/test/name_test.dart | 18 ++--- .../built_value/test/nullable_class_test.dart | 50 ++++---------- .../built_value/test/number_only_test.dart | 6 +- .../object_with_deprecated_fields_test.dart | 18 ++--- .../test/one_of_primitive_child_test.dart | 6 +- .../dio/built_value/test/order_test.dart | 26 ++----- .../test/outer_composite_test.dart | 14 ++-- .../outer_object_with_enum_property_test.dart | 6 +- .../dio/built_value/test/parent_test.dart | 6 +- .../dio/built_value/test/pasta_test.dart | 26 ++----- .../dio/built_value/test/pet_api_test.dart | 36 +++------- .../dio/built_value/test/pet_test.dart | 26 ++----- .../built_value/test/pizza_speziale_test.dart | 26 ++----- .../dio/built_value/test/pizza_test.dart | 26 ++----- .../test/read_only_first_test.dart | 10 +-- .../test/special_model_name_test.dart | 6 +- .../dio/built_value/test/store_api_test.dart | 16 ++--- .../dio/built_value/test/tag_test.dart | 10 +-- .../dio/built_value/test/user_api_test.dart | 32 +++------ .../dio/built_value/test/user_test.dart | 34 +++------- .../dio/built_value_tests/pubspec.yaml | 4 +- .../lib/src/repository_impl.dart | 1 - .../additional_properties_class_test.dart | 10 +-- .../test/addressable_test.dart | 10 +-- .../test/all_of_with_single_ref_test.dart | 10 +-- .../json_serializable/test/animal_test.dart | 10 +-- .../test/another_fake_api_test.dart | 4 +- .../test/api_response_test.dart | 14 ++-- .../test/apple_all_of_disc_test.dart | 10 +-- .../test/apple_any_of_disc_test.dart | 10 +-- .../test/apple_grandparent_disc_test.dart | 10 +-- .../test/apple_one_of_disc_test.dart | 10 +-- .../test/apple_req_disc_test.dart | 10 +-- .../json_serializable/test/apple_test.dart | 6 +- .../test/apple_variant1_test.dart | 6 +- .../array_of_array_of_number_only_test.dart | 6 +- .../test/array_of_number_only_test.dart | 6 +- .../test/array_test_test.dart | 14 ++-- .../test/banana_all_of_disc_test.dart | 10 +-- .../test/banana_any_of_disc_test.dart | 10 +-- .../test/banana_grandparent_disc_test.dart | 10 +-- .../test/banana_one_of_disc_test.dart | 10 +-- .../test/banana_req_disc_test.dart | 10 +-- .../json_serializable/test/banana_test.dart | 6 +- .../json_serializable/test/bar_api_test.dart | 4 +- .../test/bar_create_test.dart | 34 +++------- .../test/bar_ref_or_value_test.dart | 22 ++---- .../json_serializable/test/bar_ref_test.dart | 22 ++---- .../dio/json_serializable/test/bar_test.dart | 34 +++------- .../test/capitalization_test.dart | 26 ++----- .../test/cat_all_of_test.dart | 6 +- .../dio/json_serializable/test/cat_test.dart | 14 ++-- .../json_serializable/test/category_test.dart | 10 +-- .../test/class_model_test.dart | 6 +- ...sed_disc_missing_from_properties_test.dart | 6 +- ...posed_disc_optional_type_correct_test.dart | 6 +- ..._disc_optional_type_inconsistent_test.dart | 6 +- ...sed_disc_optional_type_incorrect_test.dart | 6 +- ...posed_disc_required_inconsistent_test.dart | 6 +- .../composed_disc_type_inconsistent_test.dart | 6 +- .../composed_disc_type_incorrect_test.dart | 6 +- .../test/default_api_test.dart | 24 ++----- .../test/deprecated_object_test.dart | 6 +- .../disc_missing_from_properties_test.dart | 6 +- .../test/disc_optional_type_correct_test.dart | 6 +- .../disc_optional_type_incorrect_test.dart | 6 +- .../test/disc_type_incorrect_test.dart | 6 +- .../test/dog_all_of_test.dart | 6 +- .../dio/json_serializable/test/dog_test.dart | 14 ++-- .../test/entity_ref_test.dart | 30 +++----- .../json_serializable/test/entity_test.dart | 22 ++---- .../test/enum_arrays_test.dart | 10 +-- .../test/enum_test_test.dart | 34 +++------- .../test/extensible_test.dart | 14 ++-- .../json_serializable/test/fake_api_test.dart | 68 +++++-------------- .../test/fake_classname_tags123_api_test.dart | 4 +- .../test/file_schema_test_class_test.dart | 10 +-- .../json_serializable/test/foo_api_test.dart | 8 +-- .../foo_basic_get_default_response_test.dart | 6 +- .../test/foo_ref_or_value_test.dart | 22 ++---- .../json_serializable/test/foo_ref_test.dart | 26 ++----- .../dio/json_serializable/test/foo_test.dart | 30 +++----- .../test/format_test_test.dart | 66 +++++------------- .../test/fruit_all_of_disc_test.dart | 6 +- .../test/fruit_any_of_disc_test.dart | 6 +- .../test/fruit_grandparent_disc_test.dart | 6 +- .../test/fruit_inline_disc_one_of1_test.dart | 10 +-- .../test/fruit_inline_disc_one_of_test.dart | 10 +-- .../test/fruit_inline_disc_test.dart | 14 ++-- ...fruit_inline_inline_disc_one_of1_test.dart | 10 +-- ...inline_inline_disc_one_of_one_of_test.dart | 6 +- .../fruit_inline_inline_disc_one_of_test.dart | 10 +-- .../test/fruit_inline_inline_disc_test.dart | 6 +- .../test/fruit_one_of_disc_test.dart | 6 +- .../test/fruit_req_disc_test.dart | 14 ++-- .../json_serializable/test/fruit_test.dart | 14 ++-- .../test/fruit_type_test.dart | 6 +- .../test/fruit_variant1_test.dart | 10 +-- .../test/giga_one_of_test.dart | 6 +- .../test/grape_variant1_test.dart | 6 +- .../test/has_only_read_only_test.dart | 10 +-- .../test/health_check_result_test.dart | 6 +- .../json_serializable/test/map_test_test.dart | 18 ++--- ..._and_additional_properties_class_test.dart | 14 ++-- .../test/model200_response_test.dart | 10 +-- .../test/model_client_test.dart | 6 +- .../test/model_file_test.dart | 6 +- .../test/model_list_test.dart | 6 +- .../test/model_return_test.dart | 6 +- .../dio/json_serializable/test/name_test.dart | 18 ++--- .../test/nullable_class_test.dart | 50 ++++---------- .../test/number_only_test.dart | 6 +- .../object_with_deprecated_fields_test.dart | 18 ++--- .../test/one_of_primitive_child_test.dart | 6 +- .../json_serializable/test/order_test.dart | 26 ++----- .../test/outer_composite_test.dart | 14 ++-- .../outer_object_with_enum_property_test.dart | 6 +- .../json_serializable/test/parent_test.dart | 6 +- .../json_serializable/test/pasta_test.dart | 26 ++----- .../json_serializable/test/pet_api_test.dart | 36 +++------- .../dio/json_serializable/test/pet_test.dart | 26 ++----- .../test/pizza_speziale_test.dart | 26 ++----- .../json_serializable/test/pizza_test.dart | 26 ++----- .../test/read_only_first_test.dart | 10 +-- .../test/special_model_name_test.dart | 6 +- .../test/store_api_test.dart | 16 ++--- .../dio/json_serializable/test/tag_test.dart | 10 +-- .../json_serializable/test/user_api_test.dart | 32 +++------ .../dio/json_serializable/test/user_test.dart | 34 +++------- 216 files changed, 836 insertions(+), 2113 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart index 0ee0559d710c..c07a9bc22ba0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AdditionalPropertiesClass void main() { final instance = AdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AdditionalPropertiesClass, () { // BuiltMap mapProperty - test('to test the property `mapProperty`', () async { - // TODO - }); + test('to test the property `mapProperty`', () async {}); // BuiltMap> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async { - // TODO - }); + test('to test the property `mapOfMapProperty`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart index 657f7ee74448..1bcecbfd9fd9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart @@ -4,19 +4,15 @@ import 'package:openapi/openapi.dart'; // tests for Addressable void main() { //final instance = AddressableBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Addressable, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart index a423afab69b0..c3c9e614338b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AllOfWithSingleRef void main() { final instance = AllOfWithSingleRefBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AllOfWithSingleRef, () { // String username - test('to test the property `username`', () async { - // TODO - }); + test('to test the property `username`', () async {}); // SingleRefType singleRefType - test('to test the property `singleRefType`', () async { - // TODO - }); + test('to test the property `singleRefType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart index 023e09145fe3..27ac771d0488 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Animal void main() { //final instance = AnimalBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Animal, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart index b758bba36ae0..5b98fa2a4e0a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart @@ -11,8 +11,6 @@ void main() { // To test special tags and operation ID starting with number // //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async { - // TODO - }); + test('test call123testSpecialTags', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart index 9587579a4ab0..4eff382b9c65 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for ApiResponse void main() { final instance = ApiResponseBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ApiResponse, () { // int code - test('to test the property `code`', () async { - // TODO - }); + test('to test the property `code`', () async {}); // String type - test('to test the property `type`', () async { - // TODO - }); + test('to test the property `type`', () async {}); // String message - test('to test the property `message`', () async { - // TODO - }); + test('to test the property `message`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart index 31d86af790da..a60557855cf7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleAllOfDisc void main() { final instance = AppleAllOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleAllOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart index c3bd9cdf1cb0..ce0b61263756 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleAnyOfDisc void main() { final instance = AppleAnyOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleAnyOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart index 840b36b8a4b1..6d63b53809f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleGrandparentDisc void main() { final instance = AppleGrandparentDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleGrandparentDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart index 8f753f5fdc83..17c2c40475ec 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleOneOfDisc void main() { final instance = AppleOneOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleOneOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart index df1e3b7464e6..725750c8a2cf 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleReqDisc void main() { final instance = AppleReqDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleReqDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart index 0949f55b7247..2c70979c9b51 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Apple void main() { final instance = AppleBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Apple, () { // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart index 10f6a46f11ab..bac42d3d78cb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for AppleVariant1 void main() { final instance = AppleVariant1Builder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(AppleVariant1, () { // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart index ad6d165e3c83..1d1a4465426a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfArrayOfNumberOnly void main() { final instance = ArrayOfArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ArrayOfArrayOfNumberOnly, () { // BuiltList> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); + test('to test the property `arrayArrayNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart index 456681ced455..491cea2fe307 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfNumberOnly void main() { final instance = ArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ArrayOfNumberOnly, () { // BuiltList arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); + test('to test the property `arrayNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart index 7b89588b2157..e33be3375c3b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for ArrayTest void main() { final instance = ArrayTestBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ArrayTest, () { // BuiltList arrayOfString - test('to test the property `arrayOfString`', () async { - // TODO - }); + test('to test the property `arrayOfString`', () async {}); // BuiltList> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async { - // TODO - }); + test('to test the property `arrayArrayOfInteger`', () async {}); // BuiltList> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async { - // TODO - }); + test('to test the property `arrayArrayOfModel`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart index 0dcd6419d9c6..cf66d3a165f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaAllOfDisc void main() { final instance = BananaAllOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BananaAllOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart index dead79eb0cae..494911f8e82e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaAnyOfDisc void main() { final instance = BananaAnyOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BananaAnyOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart index 01ad40b891bc..2f9969c1733a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaGrandparentDisc void main() { final instance = BananaGrandparentDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BananaGrandparentDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart index be124eb7b4cb..973707c9dd6a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaOneOfDisc void main() { final instance = BananaOneOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BananaOneOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart index a034fc27dafe..70e07cc4b1a1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaReqDisc void main() { final instance = BananaReqDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BananaReqDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart index 34f4c1ca36ed..0678b7d72e9d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Banana void main() { final instance = BananaBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Banana, () { // num count - test('to test the property `count`', () async { - // TODO - }); + test('to test the property `count`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart index 4c2cb1de1f98..b85771fca95b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart @@ -9,8 +9,6 @@ void main() { // Create a Bar // //Future createBar(BarCreate barCreate) async - test('test createBar', () async { - // TODO - }); + test('test createBar', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart index 050dcadfb0f9..4a3ea406fdb7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart @@ -4,52 +4,36 @@ import 'package:openapi/openapi.dart'; // tests for BarCreate void main() { final instance = BarCreateBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BarCreate, () { // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); + test('to test the property `barPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart index a6ceb001ec11..b8890050e0c5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for BarRefOrValue void main() { final instance = BarRefOrValueBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BarRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart index 4a31ed0904b5..acd5cb762a2f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for BarRef void main() { final instance = BarRefBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(BarRef, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart index 616f922b5d14..8d6eb79ac955 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart @@ -4,51 +4,35 @@ import 'package:openapi/openapi.dart'; // tests for Bar void main() { final instance = BarBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Bar, () { // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); + test('to test the property `barPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart index c1fb9cd73dc7..585d6d62657e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Capitalization void main() { final instance = CapitalizationBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Capitalization, () { // String smallCamel - test('to test the property `smallCamel`', () async { - // TODO - }); + test('to test the property `smallCamel`', () async {}); // String capitalCamel - test('to test the property `capitalCamel`', () async { - // TODO - }); + test('to test the property `capitalCamel`', () async {}); // String smallSnake - test('to test the property `smallSnake`', () async { - // TODO - }); + test('to test the property `smallSnake`', () async {}); // String capitalSnake - test('to test the property `capitalSnake`', () async { - // TODO - }); + test('to test the property `capitalSnake`', () async {}); // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async { - // TODO - }); + test('to test the property `sCAETHFlowPoints`', () async {}); // Name of the pet // String ATT_NAME - test('to test the property `ATT_NAME`', () async { - // TODO - }); + test('to test the property `ATT_NAME`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart index b84216c8996d..9e99c51f3b21 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for CatAllOf void main() { //final instance = CatAllOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(CatAllOf, () { // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); + test('to test the property `declawed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart index 000e31d7f176..37ddce486e87 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Cat void main() { final instance = CatBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Cat, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); + test('to test the property `declawed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart index c484b83670ec..33e7f0eb3817 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Category void main() { final instance = CategoryBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Category, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String name (default value: 'default-name') - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart index 1ca5ccc3a74b..61ff5834b458 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ClassModel void main() { final instance = ClassModelBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ClassModel, () { // String classField - test('to test the property `classField`', () async { - // TODO - }); + test('to test the property `classField`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart index 235e52fe31ea..df4bfa1fde89 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscMissingFromProperties void main() { final instance = ComposedDiscMissingFromPropertiesBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscMissingFromProperties, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart index e891898254db..07e3393ce709 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscOptionalTypeCorrect void main() { final instance = ComposedDiscOptionalTypeCorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart index 668155d37edb..e7dbb5928f9a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscOptionalTypeInconsistent void main() { final instance = ComposedDiscOptionalTypeInconsistentBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscOptionalTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart index 464f2087ba4c..0881c1656115 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscOptionalTypeIncorrect void main() { final instance = ComposedDiscOptionalTypeIncorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart index 695f83d060b2..66a290d8945e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscRequiredInconsistent void main() { final instance = ComposedDiscRequiredInconsistentBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscRequiredInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart index b4fd9265c3a3..b03c47bad3ea 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscTypeInconsistent void main() { final instance = ComposedDiscTypeInconsistentBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart index 8ba06950f485..ce7b12f0d535 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ComposedDiscTypeIncorrect void main() { final instance = ComposedDiscTypeIncorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ComposedDiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart index 4438ef5ca1f9..3330a732290e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart @@ -7,33 +7,21 @@ void main() { group(DefaultApi, () { //Future fooBasicGet() async - test('test fooBasicGet', () async { - // TODO - }); + test('test fooBasicGet', () async {}); //Future list() async - test('test list', () async { - // TODO - }); + test('test list', () async {}); //Future oneofGet() async - test('test oneofGet', () async { - // TODO - }); + test('test oneofGet', () async {}); //Future test({ JsonObject body }) async - test('test test', () async { - // TODO - }); + test('test test', () async {}); //Future variant1Get() async - test('test variant1Get', () async { - // TODO - }); + test('test variant1Get', () async {}); //Future variant2Get() async - test('test variant2Get', () async { - // TODO - }); + test('test variant2Get', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart index 298f2d2253b4..a921940cfbba 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DeprecatedObject void main() { final instance = DeprecatedObjectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DeprecatedObject, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart index cb7585a900db..ba42a35b5787 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DiscMissingFromProperties void main() { final instance = DiscMissingFromPropertiesBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DiscMissingFromProperties, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart index 26592261616b..bb317950a76c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DiscOptionalTypeCorrect void main() { final instance = DiscOptionalTypeCorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart index 80328bcc3736..99434f6da66e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DiscOptionalTypeIncorrect void main() { final instance = DiscOptionalTypeIncorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart index 95d512049d06..c2a907a4a142 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DiscTypeIncorrect void main() { final instance = DiscTypeIncorrectBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart index 8d258244accb..59cc36628bde 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DogAllOf void main() { //final instance = DogAllOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(DogAllOf, () { // String breed - test('to test the property `breed`', () async { - // TODO - }); + test('to test the property `breed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart index 0d810b3b9fa9..473aa680ac0c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Dog void main() { final instance = DogBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Dog, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String breed - test('to test the property `breed`', () async { - // TODO - }); + test('to test the property `breed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart index ce3ed9868212..70d28bc3226f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart @@ -4,49 +4,35 @@ import 'package:openapi/openapi.dart'; // tests for EntityRef void main() { //final instance = EntityRefBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(EntityRef, () { // Name of the related entity. // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // The actual type of the target instance when needed for disambiguation. // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); + test('to test the property `atReferredType`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart index ca7dd754f98d..d8c1fddd1705 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for Entity void main() { //final instance = EntityBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Entity, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart index c0d5de925aec..3ec881278f35 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for EnumArrays void main() { final instance = EnumArraysBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(EnumArrays, () { // String justSymbol - test('to test the property `justSymbol`', () async { - // TODO - }); + test('to test the property `justSymbol`', () async {}); // BuiltList arrayEnum - test('to test the property `arrayEnum`', () async { - // TODO - }); + test('to test the property `arrayEnum`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart index d7dc20b5eb77..115876ca53aa 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart @@ -4,47 +4,31 @@ import 'package:openapi/openapi.dart'; // tests for EnumTest void main() { final instance = EnumTestBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(EnumTest, () { // String enumString - test('to test the property `enumString`', () async { - // TODO - }); + test('to test the property `enumString`', () async {}); // String enumStringRequired - test('to test the property `enumStringRequired`', () async { - // TODO - }); + test('to test the property `enumStringRequired`', () async {}); // int enumInteger - test('to test the property `enumInteger`', () async { - // TODO - }); + test('to test the property `enumInteger`', () async {}); // double enumNumber - test('to test the property `enumNumber`', () async { - // TODO - }); + test('to test the property `enumNumber`', () async {}); // OuterEnum outerEnum - test('to test the property `outerEnum`', () async { - // TODO - }); + test('to test the property `outerEnum`', () async {}); // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async { - // TODO - }); + test('to test the property `outerEnumInteger`', () async {}); // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async { - // TODO - }); + test('to test the property `outerEnumDefaultValue`', () async {}); // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async { - // TODO - }); + test('to test the property `outerEnumIntegerDefaultValue`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart index 158df10ac74e..2c9d0014abe0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart @@ -4,25 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for Extensible void main() { //final instance = ExtensibleBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Extensible, () { // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart index b6cd879840dd..03e275390fca 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart @@ -9,130 +9,96 @@ void main() { // Health check endpoint // //Future fakeHealthGet() async - test('test fakeHealthGet', () async { - // TODO - }); + test('test fakeHealthGet', () async {}); // test http signature authentication // //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async { - // TODO - }); + test('test fakeHttpSignatureTest', () async {}); // Test serialization of outer boolean types // //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async { - // TODO - }); + test('test fakeOuterBooleanSerialize', () async {}); // Test serialization of object with outer number type // //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async { - // TODO - }); + test('test fakeOuterCompositeSerialize', () async {}); // Test serialization of outer number types // //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async { - // TODO - }); + test('test fakeOuterNumberSerialize', () async {}); // Test serialization of outer string types // //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async { - // TODO - }); + test('test fakeOuterStringSerialize', () async {}); // Test serialization of enum (int) properties with examples // //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async { - // TODO - }); + test('test fakePropertyEnumIntegerSerialize', () async {}); // For this test, the body has to be a binary file. // //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async { - // TODO - }); + test('test testBodyWithBinary', () async {}); // For this test, the body for this request must reference a schema named `File`. // //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async { - // TODO - }); + test('test testBodyWithFileSchema', () async {}); //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async { - // TODO - }); + test('test testBodyWithQueryParams', () async {}); // To test \"client\" model // // To test \"client\" model // //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async { - // TODO - }); + test('test testClientModel', () async {}); // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async { - // TODO - }); + test('test testEndpointParameters', () async {}); // To test enum parameters // // To test enum parameters // //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumQueryModelArray, BuiltList enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async { - // TODO - }); + test('test testEnumParameters', () async {}); // Fake endpoint to test group parameters (optional) // // Fake endpoint to test group parameters (optional) // //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async { - // TODO - }); + test('test testGroupParameters', () async {}); // test inline additionalProperties // // // //Future testInlineAdditionalProperties(BuiltMap requestBody) async - test('test testInlineAdditionalProperties', () async { - // TODO - }); + test('test testInlineAdditionalProperties', () async {}); // test json serialization of form data // // // //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); + test('test testJsonFormData', () async {}); // To test the collection format in query parameters // //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async - test('test testQueryParameterCollectionFormat', () async { - // TODO - }); + test('test testQueryParameterCollectionFormat', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart index 979c752e1c26..e2b2e38526dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart @@ -11,8 +11,6 @@ void main() { // To test class name in snake case // //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async { - // TODO - }); + test('test testClassname', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart index 1ef8cf8861b4..1264053bcb2d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FileSchemaTestClass void main() { final instance = FileSchemaTestClassBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FileSchemaTestClass, () { // ModelFile file - test('to test the property `file`', () async { - // TODO - }); + test('to test the property `file`', () async {}); // BuiltList files - test('to test the property `files`', () async { - // TODO - }); + test('to test the property `files`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart index 8712e0bcab98..66daa2bdb5b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart @@ -9,15 +9,11 @@ void main() { // Create a Foo // //Future createFoo({ Foo foo }) async - test('test createFoo', () async { - // TODO - }); + test('test createFoo', () async {}); // GET all Foos // //Future> getAllFoos() async - test('test getAllFoos', () async { - // TODO - }); + test('test getAllFoos', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart index c3c4e462c2c1..4efb1929b0e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FooBasicGetDefaultResponse void main() { final instance = FooBasicGetDefaultResponseBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FooBasicGetDefaultResponse, () { // Foo string - test('to test the property `string`', () async { - // TODO - }); + test('to test the property `string`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart index bcee2f7eaee1..b167f0627ffd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for FooRefOrValue void main() { final instance = FooRefOrValueBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FooRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart index b28c262c3e22..7eb4462f80f7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for FooRef void main() { final instance = FooRefBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FooRef, () { // String foorefPropA - test('to test the property `foorefPropA`', () async { - // TODO - }); + test('to test the property `foorefPropA`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart index 0b491bb37b68..5bd90ef32ed2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart @@ -4,47 +4,33 @@ import 'package:openapi/openapi.dart'; // tests for Foo void main() { final instance = FooBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Foo, () { // String fooPropA - test('to test the property `fooPropA`', () async { - // TODO - }); + test('to test the property `fooPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart index 3827c02e13ae..672761823d83 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart @@ -4,89 +4,57 @@ import 'package:openapi/openapi.dart'; // tests for FormatTest void main() { final instance = FormatTestBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FormatTest, () { // int integer - test('to test the property `integer`', () async { - // TODO - }); + test('to test the property `integer`', () async {}); // int int32 - test('to test the property `int32`', () async { - // TODO - }); + test('to test the property `int32`', () async {}); // int int64 - test('to test the property `int64`', () async { - // TODO - }); + test('to test the property `int64`', () async {}); // num number - test('to test the property `number`', () async { - // TODO - }); + test('to test the property `number`', () async {}); // double float - test('to test the property `float`', () async { - // TODO - }); + test('to test the property `float`', () async {}); // double double_ - test('to test the property `double_`', () async { - // TODO - }); + test('to test the property `double_`', () async {}); // double decimal - test('to test the property `decimal`', () async { - // TODO - }); + test('to test the property `decimal`', () async {}); // String string - test('to test the property `string`', () async { - // TODO - }); + test('to test the property `string`', () async {}); // String byte - test('to test the property `byte`', () async { - // TODO - }); + test('to test the property `byte`', () async {}); // Uint8List binary - test('to test the property `binary`', () async { - // TODO - }); + test('to test the property `binary`', () async {}); // Date date - test('to test the property `date`', () async { - // TODO - }); + test('to test the property `date`', () async {}); // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); + test('to test the property `dateTime`', () async {}); // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // String password - test('to test the property `password`', () async { - // TODO - }); + test('to test the property `password`', () async {}); // A string that is a 10 digit number. Can have leading zeros. // String patternWithDigits - test('to test the property `patternWithDigits`', () async { - // TODO - }); + test('to test the property `patternWithDigits`', () async {}); // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async { - // TODO - }); + test('to test the property `patternWithDigitsAndDelimiter`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart index 91acb802e671..f819488cacd7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitAllOfDisc void main() { final instance = FruitAllOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitAllOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart index 908b3625f532..083549013a3a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitAnyOfDisc void main() { final instance = FruitAnyOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitAnyOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart index 2b161c37be72..e2b0902cdf1e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitGrandparentDisc void main() { final instance = FruitGrandparentDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitGrandparentDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart index f71204d0bc79..9f76c006f85b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDiscOneOf1 void main() { final instance = FruitInlineDiscOneOf1Builder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart index ecc76d47c479..867200109263 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDiscOneOf void main() { final instance = FruitInlineDiscOneOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart index 9bf4923efddc..289554d087d9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDisc void main() { final instance = FruitInlineDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart index 0d13e5318543..8698c0c9b737 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineInlineDiscOneOf1 void main() { final instance = FruitInlineInlineDiscOneOf1Builder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart index 5b52a69fe7f7..0db995287f6c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineInlineDiscOneOfOneOf void main() { final instance = FruitInlineInlineDiscOneOfOneOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineInlineDiscOneOfOneOf, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart index a19b0b4b7382..0871a31ca2d1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineInlineDiscOneOf void main() { final instance = FruitInlineInlineDiscOneOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart index 52fe8b9f1fea..01dc0d7ba46b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineInlineDisc void main() { final instance = FruitInlineInlineDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitInlineInlineDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart index f9a7c1acc30e..809de19ee018 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitOneOfDisc void main() { final instance = FruitOneOfDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitOneOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart index 1e5609b3a6aa..b35113f22b3b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for FruitReqDisc void main() { final instance = FruitReqDiscBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitReqDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart index 26b265ccb93f..dbc551de8fab 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Fruit void main() { final instance = FruitBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Fruit, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); // num count - test('to test the property `count`', () async { - // TODO - }); + test('to test the property `count`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart index 2079c036aa71..43aa0db383b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitType void main() { //final instance = FruitTypeBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitType, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart index 03f0f63ad365..63fa22d46499 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitVariant1 void main() { final instance = FruitVariant1Builder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(FruitVariant1, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart index 8888444f3139..04b8c85290ee 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for GigaOneOf void main() { final instance = GigaOneOfBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(GigaOneOf, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart index 13509d311d82..87696795e46b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for GrapeVariant1 void main() { final instance = GrapeVariant1Builder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(GrapeVariant1, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart index 8b00db3d0711..c0db81ee6dfc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for HasOnlyReadOnly void main() { final instance = HasOnlyReadOnlyBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(HasOnlyReadOnly, () { // String bar - test('to test the property `bar`', () async { - // TODO - }); + test('to test the property `bar`', () async {}); // String foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart index 050e2c9b814f..09374fc01b6c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for HealthCheckResult void main() { final instance = HealthCheckResultBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(HealthCheckResult, () { // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); + test('to test the property `nullableMessage`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart index 56c3d448c6c5..855a2a7075bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart @@ -4,27 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for MapTest void main() { final instance = MapTestBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(MapTest, () { // BuiltMap> mapMapOfString - test('to test the property `mapMapOfString`', () async { - // TODO - }); + test('to test the property `mapMapOfString`', () async {}); // BuiltMap mapOfEnumString - test('to test the property `mapOfEnumString`', () async { - // TODO - }); + test('to test the property `mapOfEnumString`', () async {}); // BuiltMap directMap - test('to test the property `directMap`', () async { - // TODO - }); + test('to test the property `directMap`', () async {}); // BuiltMap indirectMap - test('to test the property `indirectMap`', () async { - // TODO - }); + test('to test the property `indirectMap`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart index dcaa8d351ae5..25f4383f9a2f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for MixedPropertiesAndAdditionalPropertiesClass void main() { final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(MixedPropertiesAndAdditionalPropertiesClass, () { // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); + test('to test the property `dateTime`', () async {}); // BuiltMap map - test('to test the property `map`', () async { - // TODO - }); + test('to test the property `map`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart index 8064eb959a32..75e433c1960e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Model200Response void main() { final instance = Model200ResponseBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Model200Response, () { // int name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // String classField - test('to test the property `classField`', () async { - // TODO - }); + test('to test the property `classField`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart index 1998f27d715a..2e99f627104a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelClient void main() { final instance = ModelClientBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ModelClient, () { // String client - test('to test the property `client`', () async { - // TODO - }); + test('to test the property `client`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart index a07c60c5d85d..1f5e162d4d53 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart @@ -4,13 +4,11 @@ import 'package:openapi/openapi.dart'; // tests for ModelFile void main() { final instance = ModelFileBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ModelFile, () { // Test capitalization // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); + test('to test the property `sourceURI`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart index 0c4e3c45c7a9..c8b1ec50b4f2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelList void main() { final instance = ModelListBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ModelList, () { // String n123list - test('to test the property `n123list`', () async { - // TODO - }); + test('to test the property `n123list`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart index b60abdfd6021..cae8e13559e6 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelReturn void main() { final instance = ModelReturnBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ModelReturn, () { // int return_ - test('to test the property `return_`', () async { - // TODO - }); + test('to test the property `return_`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart index d04e76fef9e0..3dae7f131506 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart @@ -4,27 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for Name void main() { final instance = NameBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Name, () { // int name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // int snakeCase - test('to test the property `snakeCase`', () async { - // TODO - }); + test('to test the property `snakeCase`', () async {}); // String property - test('to test the property `property`', () async { - // TODO - }); + test('to test the property `property`', () async {}); // int n123number - test('to test the property `n123number`', () async { - // TODO - }); + test('to test the property `n123number`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart index 32f0eba4fb2e..2bedc2c5d07f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart @@ -4,67 +4,43 @@ import 'package:openapi/openapi.dart'; // tests for NullableClass void main() { final instance = NullableClassBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(NullableClass, () { // int integerProp - test('to test the property `integerProp`', () async { - // TODO - }); + test('to test the property `integerProp`', () async {}); // num numberProp - test('to test the property `numberProp`', () async { - // TODO - }); + test('to test the property `numberProp`', () async {}); // bool booleanProp - test('to test the property `booleanProp`', () async { - // TODO - }); + test('to test the property `booleanProp`', () async {}); // String stringProp - test('to test the property `stringProp`', () async { - // TODO - }); + test('to test the property `stringProp`', () async {}); // Date dateProp - test('to test the property `dateProp`', () async { - // TODO - }); + test('to test the property `dateProp`', () async {}); // DateTime datetimeProp - test('to test the property `datetimeProp`', () async { - // TODO - }); + test('to test the property `datetimeProp`', () async {}); // BuiltList arrayNullableProp - test('to test the property `arrayNullableProp`', () async { - // TODO - }); + test('to test the property `arrayNullableProp`', () async {}); // BuiltList arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async { - // TODO - }); + test('to test the property `arrayAndItemsNullableProp`', () async {}); // BuiltList arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async { - // TODO - }); + test('to test the property `arrayItemsNullable`', () async {}); // BuiltMap objectNullableProp - test('to test the property `objectNullableProp`', () async { - // TODO - }); + test('to test the property `objectNullableProp`', () async {}); // BuiltMap objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async { - // TODO - }); + test('to test the property `objectAndItemsNullableProp`', () async {}); // BuiltMap objectItemsNullable - test('to test the property `objectItemsNullable`', () async { - // TODO - }); + test('to test the property `objectItemsNullable`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart index 7f34d2a5ce60..51c99d0940ae 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for NumberOnly void main() { final instance = NumberOnlyBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(NumberOnly, () { // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); + test('to test the property `justNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart index 574970b317ca..8bc4de110c80 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart @@ -4,27 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for ObjectWithDeprecatedFields void main() { final instance = ObjectWithDeprecatedFieldsBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ObjectWithDeprecatedFields, () { // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // num id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async { - // TODO - }); + test('to test the property `deprecatedRef`', () async {}); // BuiltList bars - test('to test the property `bars`', () async { - // TODO - }); + test('to test the property `bars`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart index 78c841d1973c..e6a050464f76 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for OneOfPrimitiveChild void main() { final instance = OneOfPrimitiveChildBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(OneOfPrimitiveChild, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart index 3ed96043d80c..b1e140131007 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Order void main() { final instance = OrderBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Order, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // int petId - test('to test the property `petId`', () async { - // TODO - }); + test('to test the property `petId`', () async {}); // int quantity - test('to test the property `quantity`', () async { - // TODO - }); + test('to test the property `quantity`', () async {}); // DateTime shipDate - test('to test the property `shipDate`', () async { - // TODO - }); + test('to test the property `shipDate`', () async {}); // Order Status // String status - test('to test the property `status`', () async { - // TODO - }); + test('to test the property `status`', () async {}); // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); + test('to test the property `complete`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart index 99a7cb7db596..dfb42ab6eb07 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for OuterComposite void main() { final instance = OuterCompositeBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(OuterComposite, () { // num myNumber - test('to test the property `myNumber`', () async { - // TODO - }); + test('to test the property `myNumber`', () async {}); // String myString - test('to test the property `myString`', () async { - // TODO - }); + test('to test the property `myString`', () async {}); // bool myBoolean - test('to test the property `myBoolean`', () async { - // TODO - }); + test('to test the property `myBoolean`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart index cb621828cbc0..e0d4c80f00c8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for OuterObjectWithEnumProperty void main() { final instance = OuterObjectWithEnumPropertyBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(OuterObjectWithEnumProperty, () { // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); + test('to test the property `value`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart index a1cacb130ef8..0b04c690c5eb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Parent void main() { //final instance = ParentBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Parent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart index 42de4a90e2fa..1883898d1e68 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for Pasta void main() { final instance = PastaBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Pasta, () { // String vendor - test('to test the property `vendor`', () async { - // TODO - }); + test('to test the property `vendor`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart index 32a58c15534d..373d26c1a5ee 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart @@ -11,80 +11,62 @@ void main() { // // //Future addPet(Pet pet) async - test('test addPet', () async { - // TODO - }); + test('test addPet', () async {}); // Deletes a pet // // // //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); + test('test deletePet', () async {}); // Finds Pets by status // // Multiple status values can be provided with comma separated strings // //Future> findPetsByStatus(BuiltList status) async - test('test findPetsByStatus', () async { - // TODO - }); + test('test findPetsByStatus', () async {}); // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // //Future> findPetsByTags(BuiltSet tags) async - test('test findPetsByTags', () async { - // TODO - }); + test('test findPetsByTags', () async {}); // Find pet by ID // // Returns a single pet // //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); + test('test getPetById', () async {}); // Update an existing pet // // // //Future updatePet(Pet pet) async - test('test updatePet', () async { - // TODO - }); + test('test updatePet', () async {}); // Updates a pet in the store with form data // // // //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); + test('test updatePetWithForm', () async {}); // uploads an image // // // //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); + test('test uploadFile', () async {}); // uploads an image (required) // // // //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async { - // TODO - }); + test('test uploadFileWithRequiredFile', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart index 7d57000d4d98..bc228a2447a8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Pet void main() { final instance = PetBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Pet, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // Category category - test('to test the property `category`', () async { - // TODO - }); + test('to test the property `category`', () async {}); // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // BuiltSet photoUrls - test('to test the property `photoUrls`', () async { - // TODO - }); + test('to test the property `photoUrls`', () async {}); // BuiltList tags - test('to test the property `tags`', () async { - // TODO - }); + test('to test the property `tags`', () async {}); // pet status in the store // String status - test('to test the property `status`', () async { - // TODO - }); + test('to test the property `status`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart index c6a78cb12fc7..84d5ef417e99 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for PizzaSpeziale void main() { final instance = PizzaSpezialeBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(PizzaSpeziale, () { // String toppings - test('to test the property `toppings`', () async { - // TODO - }); + test('to test the property `toppings`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart index 7e0b87b9ab5a..bab1b1c52812 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for Pizza void main() { //final instance = PizzaBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Pizza, () { // num pizzaSize - test('to test the property `pizzaSize`', () async { - // TODO - }); + test('to test the property `pizzaSize`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart index f4652322f2c7..900cc8bfe94f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for ReadOnlyFirst void main() { final instance = ReadOnlyFirstBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(ReadOnlyFirst, () { // String bar - test('to test the property `bar`', () async { - // TODO - }); + test('to test the property `bar`', () async {}); // String baz - test('to test the property `baz`', () async { - // TODO - }); + test('to test the property `baz`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart index f81e03f7188d..d2c7227d6a25 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart @@ -4,14 +4,12 @@ import 'package:openapi/openapi.dart'; // tests for SpecialModelName void main() { final instance = SpecialModelNameBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket test( 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', - () async { - // TODO - }); + () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart index 434bba4e5d7a..ed22c06ba895 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart @@ -11,35 +11,27 @@ void main() { // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); + test('test deleteOrder', () async {}); // Returns pet inventories by status // // Returns a map of status codes to quantities // //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); + test('test getInventory', () async {}); // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions // //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); + test('test getOrderById', () async {}); // Place an order for a pet // // // //Future placeOrder(Order order) async - test('test placeOrder', () async { - // TODO - }); + test('test placeOrder', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart index 253a283fc867..25be1ec749a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Tag void main() { final instance = TagBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(Tag, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart index e7f3b4112e7d..0ea7ac6d3868 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart @@ -11,71 +11,55 @@ void main() { // This can only be done by the logged in user. // //Future createUser(User user) async - test('test createUser', () async { - // TODO - }); + test('test createUser', () async {}); // Creates list of users with given input array // // // //Future createUsersWithArrayInput(BuiltList user) async - test('test createUsersWithArrayInput', () async { - // TODO - }); + test('test createUsersWithArrayInput', () async {}); // Creates list of users with given input array // // // //Future createUsersWithListInput(BuiltList user) async - test('test createUsersWithListInput', () async { - // TODO - }); + test('test createUsersWithListInput', () async {}); // Delete user // // This can only be done by the logged in user. // //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); + test('test deleteUser', () async {}); // Get user by user name // // // //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); + test('test getUserByName', () async {}); // Logs user into the system // // // //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); + test('test loginUser', () async {}); // Logs out current logged in user session // // // //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); + test('test logoutUser', () async {}); // Updated user // // This can only be done by the logged in user. // //Future updateUser(String username, User user) async - test('test updateUser', () async { - // TODO - }); + test('test updateUser', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart index 40bef6e6d21c..c106b8f486b0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart @@ -4,48 +4,32 @@ import 'package:openapi/openapi.dart'; // tests for User void main() { final instance = UserBuilder(); - // TODO add properties to the builder and call build() + // add properties to the builder and call build() group(User, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String username - test('to test the property `username`', () async { - // TODO - }); + test('to test the property `username`', () async {}); // String firstName - test('to test the property `firstName`', () async { - // TODO - }); + test('to test the property `firstName`', () async {}); // String lastName - test('to test the property `lastName`', () async { - // TODO - }); + test('to test the property `lastName`', () async {}); // String email - test('to test the property `email`', () async { - // TODO - }); + test('to test the property `email`', () async {}); // String password - test('to test the property `password`', () async { - // TODO - }); + test('to test the property `password`', () async {}); // String phone - test('to test the property `phone`', () async { - // TODO - }); + test('to test the property `phone`', () async {}); // User Status // int userStatus - test('to test the property `userStatus`', () async { - // TODO - }); + test('to test the property `userStatus`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml index e51b6fde72e2..f362824c092c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml @@ -1,11 +1,11 @@ -name: petstore_client_lib_fake_tests +name: built_value_tests version: 1.0.0 description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake publish_to: none environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dev_dependencies: built_collection: ^5.1.1 diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart index 8ce925e5a603..bad9b16dfa05 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart @@ -37,7 +37,6 @@ class JsonSerializableRepository extends SerializationRepositoryBase { return (valueParsed is num ? valueParsed.toDouble() : double.parse(valueParsed.toString())) as T; - //TODO: add support for DateTime? case AdditionalPropertiesClass: return AdditionalPropertiesClass.fromJson( valueParsed as Map) as T; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart index 28348e7fc36e..e9d8dbaec130 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart @@ -5,17 +5,13 @@ import 'package:openapi/openapi.dart'; void main() { final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AdditionalPropertiesClass, () { // Map mapProperty - test('to test the property `mapProperty`', () async { - // TODO - }); + test('to test the property `mapProperty`', () async {}); // Map> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async { - // TODO - }); + test('to test the property `mapOfMapProperty`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart index 00e1b6eba940..bbdc7725b0ab 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart @@ -4,19 +4,15 @@ import 'package:openapi/openapi.dart'; // tests for Addressable void main() { final Addressable? instance = /* Addressable(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Addressable, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart index 92cbebda26cf..b398d3cb7394 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AllOfWithSingleRef void main() { final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AllOfWithSingleRef, () { // String username - test('to test the property `username`', () async { - // TODO - }); + test('to test the property `username`', () async {}); // SingleRefType singleRefType - test('to test the property `singleRefType`', () async { - // TODO - }); + test('to test the property `singleRefType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart index d5464a4278b1..0a6686e9a1d3 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Animal void main() { final Animal? instance = /* Animal(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Animal, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart index b758bba36ae0..5b98fa2a4e0a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart @@ -11,8 +11,6 @@ void main() { // To test special tags and operation ID starting with number // //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async { - // TODO - }); + test('test call123testSpecialTags', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart index 3132ef4e8a51..8d77a18549fe 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for ApiResponse void main() { final ApiResponse? instance = /* ApiResponse(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ApiResponse, () { // int code - test('to test the property `code`', () async { - // TODO - }); + test('to test the property `code`', () async {}); // String type - test('to test the property `type`', () async { - // TODO - }); + test('to test the property `type`', () async {}); // String message - test('to test the property `message`', () async { - // TODO - }); + test('to test the property `message`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart index 9e64326664e2..dea988fb4814 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleAllOfDisc void main() { final AppleAllOfDisc? instance = /* AppleAllOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleAllOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart index 424d1cde60db..4e07f6c62eff 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleAnyOfDisc void main() { final AppleAnyOfDisc? instance = /* AppleAnyOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleAnyOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart index a437c94d611e..e2dc6e593c7a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleGrandparentDisc void main() { final AppleGrandparentDisc? instance = /* AppleGrandparentDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleGrandparentDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart index dbc28e30ab3d..95f0608c25fc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleOneOfDisc void main() { final AppleOneOfDisc? instance = /* AppleOneOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleOneOfDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart index 69765cacefe9..a1db5b180284 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for AppleReqDisc void main() { final AppleReqDisc? instance = /* AppleReqDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleReqDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart index 1c2c2037cd06..57c8d5b58882 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Apple void main() { final Apple? instance = /* Apple(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Apple, () { // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart index 1d64a9b164ef..ae810e3a455f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for AppleVariant1 void main() { final AppleVariant1? instance = /* AppleVariant1(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(AppleVariant1, () { // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart index 95eabc3a01aa..a572243fe334 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ArrayOfArrayOfNumberOnly, () { // List> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); + test('to test the property `arrayArrayNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart index b547bb1728d8..d5faf37a3369 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ArrayOfNumberOnly void main() { final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ArrayOfNumberOnly, () { // List arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); + test('to test the property `arrayNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart index 83b1fee56fb0..d15d2b928241 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for ArrayTest void main() { final ArrayTest? instance = /* ArrayTest(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ArrayTest, () { // List arrayOfString - test('to test the property `arrayOfString`', () async { - // TODO - }); + test('to test the property `arrayOfString`', () async {}); // List> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async { - // TODO - }); + test('to test the property `arrayArrayOfInteger`', () async {}); // List> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async { - // TODO - }); + test('to test the property `arrayArrayOfModel`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart index 0978ebebbc30..b051558b9544 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaAllOfDisc void main() { final BananaAllOfDisc? instance = /* BananaAllOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BananaAllOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart index 91ed142d7b41..62fbd9b26337 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaAnyOfDisc void main() { final BananaAnyOfDisc? instance = /* BananaAnyOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BananaAnyOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart index 895c6d7a399e..5d9e66c59d7e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaGrandparentDisc void main() { final BananaGrandparentDisc? instance = /* BananaGrandparentDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BananaGrandparentDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart index a073a587149e..55f1cb0cc526 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaOneOfDisc void main() { final BananaOneOfDisc? instance = /* BananaOneOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BananaOneOfDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart index b3d7ce7a00aa..1e1a4a7ea5f5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for BananaReqDisc void main() { final BananaReqDisc? instance = /* BananaReqDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BananaReqDisc, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart index d5b0a6def843..9aee52bea59b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Banana void main() { final Banana? instance = /* Banana(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Banana, () { // num count - test('to test the property `count`', () async { - // TODO - }); + test('to test the property `count`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart index 4c2cb1de1f98..b85771fca95b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart @@ -9,8 +9,6 @@ void main() { // Create a Bar // //Future createBar(BarCreate barCreate) async - test('test createBar', () async { - // TODO - }); + test('test createBar', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart index 0833036690d6..7b82c1e20eb2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart @@ -4,52 +4,36 @@ import 'package:openapi/openapi.dart'; // tests for BarCreate void main() { final BarCreate? instance = /* BarCreate(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BarCreate, () { // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); + test('to test the property `barPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart index 3088b2f6cd4e..9f9676456408 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for BarRefOrValue void main() { final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BarRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart index 080a462d0be6..ebafc2a9717d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for BarRef void main() { final BarRef? instance = /* BarRef(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(BarRef, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart index 80bcd0c8227c..bae1408ce6a7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart @@ -4,51 +4,35 @@ import 'package:openapi/openapi.dart'; // tests for Bar void main() { final Bar? instance = /* Bar(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Bar, () { // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); + test('to test the property `barPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart index 6d1094e22d0d..584540dba7d7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Capitalization void main() { final Capitalization? instance = /* Capitalization(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Capitalization, () { // String smallCamel - test('to test the property `smallCamel`', () async { - // TODO - }); + test('to test the property `smallCamel`', () async {}); // String capitalCamel - test('to test the property `capitalCamel`', () async { - // TODO - }); + test('to test the property `capitalCamel`', () async {}); // String smallSnake - test('to test the property `smallSnake`', () async { - // TODO - }); + test('to test the property `smallSnake`', () async {}); // String capitalSnake - test('to test the property `capitalSnake`', () async { - // TODO - }); + test('to test the property `capitalSnake`', () async {}); // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async { - // TODO - }); + test('to test the property `sCAETHFlowPoints`', () async {}); // Name of the pet // String ATT_NAME - test('to test the property `ATT_NAME`', () async { - // TODO - }); + test('to test the property `ATT_NAME`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart index c9df8b953a81..eaca12c52ea8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for CatAllOf void main() { final CatAllOf? instance = /* CatAllOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(CatAllOf, () { // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); + test('to test the property `declawed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart index 28e5faaeb1cd..2ed74c7b389e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Cat void main() { final Cat? instance = /* Cat(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Cat, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); + test('to test the property `declawed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart index 1d1a07c6ed0a..86a2b1f4bbb7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Category void main() { final Category? instance = /* Category(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Category, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String name (default value: 'default-name') - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart index a30d478c9566..7818c205258e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ClassModel void main() { final ClassModel? instance = /* ClassModel(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ClassModel, () { // String class_ - test('to test the property `class_`', () async { - // TODO - }); + test('to test the property `class_`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart index 61a0d0f85e4b..e8d8d1671732 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscMissingFromProperties? instance = /* ComposedDiscMissingFromProperties(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscMissingFromProperties, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart index 916749ab6e9a..df93193940f3 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscOptionalTypeCorrect? instance = /* ComposedDiscOptionalTypeCorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart index 694477afe9a4..fbc52a26ecbd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscOptionalTypeInconsistent? instance = /* ComposedDiscOptionalTypeInconsistent(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscOptionalTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart index d8eb42867727..96c906705ddf 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscOptionalTypeIncorrect? instance = /* ComposedDiscOptionalTypeIncorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart index 46235de826bf..fdd6834a8029 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscRequiredInconsistent? instance = /* ComposedDiscRequiredInconsistent(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscRequiredInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart index 29b9afae253e..0e980486db1a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscTypeInconsistent? instance = /* ComposedDiscTypeInconsistent(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart index 957bb2d3d038..51c8290d9f50 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final ComposedDiscTypeIncorrect? instance = /* ComposedDiscTypeIncorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ComposedDiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart index b8f7033a61e9..a083a0416b02 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart @@ -7,33 +7,21 @@ void main() { group(DefaultApi, () { //Future fooBasicGet() async - test('test fooBasicGet', () async { - // TODO - }); + test('test fooBasicGet', () async {}); //Future list() async - test('test list', () async { - // TODO - }); + test('test list', () async {}); //Future oneofGet() async - test('test oneofGet', () async { - // TODO - }); + test('test oneofGet', () async {}); //Future test({ Object body }) async - test('test test', () async { - // TODO - }); + test('test test', () async {}); //Future variant1Get() async - test('test variant1Get', () async { - // TODO - }); + test('test variant1Get', () async {}); //Future variant2Get() async - test('test variant2Get', () async { - // TODO - }); + test('test variant2Get', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart index 8668a44a0158..f0131b657232 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DeprecatedObject void main() { final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DeprecatedObject, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart index c705f439e738..3585ee4c9aaf 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final DiscMissingFromProperties? instance = /* DiscMissingFromProperties(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DiscMissingFromProperties, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart index 63603e6df6bc..2eabb0728afd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final DiscOptionalTypeCorrect? instance = /* DiscOptionalTypeCorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart index ad51a6519df6..82cbc9bb3687 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final DiscOptionalTypeIncorrect? instance = /* DiscOptionalTypeIncorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart index 909584dbb482..709b19535702 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DiscTypeIncorrect void main() { final DiscTypeIncorrect? instance = /* DiscTypeIncorrect(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart index ca5f74f20fbe..2e4074e24392 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for DogAllOf void main() { final DogAllOf? instance = /* DogAllOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(DogAllOf, () { // String breed - test('to test the property `breed`', () async { - // TODO - }); + test('to test the property `breed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart index 611f2a3fdc6f..f2a34b1432ab 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Dog void main() { final Dog? instance = /* Dog(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Dog, () { // String className - test('to test the property `className`', () async { - // TODO - }); + test('to test the property `className`', () async {}); // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String breed - test('to test the property `breed`', () async { - // TODO - }); + test('to test the property `breed`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart index 6f3bf3393abc..48cfd4fa75e5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart @@ -4,49 +4,35 @@ import 'package:openapi/openapi.dart'; // tests for EntityRef void main() { final EntityRef? instance = /* EntityRef(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(EntityRef, () { // Name of the related entity. // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // The actual type of the target instance when needed for disambiguation. // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); + test('to test the property `atReferredType`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart index 72563a81a3e5..32eb67a90cda 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for Entity void main() { final Entity? instance = /* Entity(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Entity, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart index 5c12838ce848..c675421e55c9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for EnumArrays void main() { final EnumArrays? instance = /* EnumArrays(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(EnumArrays, () { // String justSymbol - test('to test the property `justSymbol`', () async { - // TODO - }); + test('to test the property `justSymbol`', () async {}); // List arrayEnum - test('to test the property `arrayEnum`', () async { - // TODO - }); + test('to test the property `arrayEnum`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart index 40083505d1c0..aed8498fe61b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart @@ -4,47 +4,31 @@ import 'package:openapi/openapi.dart'; // tests for EnumTest void main() { final EnumTest? instance = /* EnumTest(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(EnumTest, () { // String enumString - test('to test the property `enumString`', () async { - // TODO - }); + test('to test the property `enumString`', () async {}); // String enumStringRequired - test('to test the property `enumStringRequired`', () async { - // TODO - }); + test('to test the property `enumStringRequired`', () async {}); // int enumInteger - test('to test the property `enumInteger`', () async { - // TODO - }); + test('to test the property `enumInteger`', () async {}); // double enumNumber - test('to test the property `enumNumber`', () async { - // TODO - }); + test('to test the property `enumNumber`', () async {}); // OuterEnum outerEnum - test('to test the property `outerEnum`', () async { - // TODO - }); + test('to test the property `outerEnum`', () async {}); // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async { - // TODO - }); + test('to test the property `outerEnumInteger`', () async {}); // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async { - // TODO - }); + test('to test the property `outerEnumDefaultValue`', () async {}); // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async { - // TODO - }); + test('to test the property `outerEnumIntegerDefaultValue`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart index 821bd1b142fa..89efd21178fd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart @@ -4,25 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for Extensible void main() { final Extensible? instance = /* Extensible(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Extensible, () { // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart index 722fa7226b15..3344dacc57cc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart @@ -9,130 +9,96 @@ void main() { // Health check endpoint // //Future fakeHealthGet() async - test('test fakeHealthGet', () async { - // TODO - }); + test('test fakeHealthGet', () async {}); // test http signature authentication // //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async { - // TODO - }); + test('test fakeHttpSignatureTest', () async {}); // Test serialization of outer boolean types // //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async { - // TODO - }); + test('test fakeOuterBooleanSerialize', () async {}); // Test serialization of object with outer number type // //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async { - // TODO - }); + test('test fakeOuterCompositeSerialize', () async {}); // Test serialization of outer number types // //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async { - // TODO - }); + test('test fakeOuterNumberSerialize', () async {}); // Test serialization of outer string types // //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async { - // TODO - }); + test('test fakeOuterStringSerialize', () async {}); // Test serialization of enum (int) properties with examples // //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async { - // TODO - }); + test('test fakePropertyEnumIntegerSerialize', () async {}); // For this test, the body has to be a binary file. // //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async { - // TODO - }); + test('test testBodyWithBinary', () async {}); // For this test, the body for this request must reference a schema named `File`. // //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async { - // TODO - }); + test('test testBodyWithFileSchema', () async {}); //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async { - // TODO - }); + test('test testBodyWithQueryParams', () async {}); // To test \"client\" model // // To test \"client\" model // //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async { - // TODO - }); + test('test testClientModel', () async {}); // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async { - // TODO - }); + test('test testEndpointParameters', () async {}); // To test enum parameters // // To test enum parameters // //Future testEnumParameters({ List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async { - // TODO - }); + test('test testEnumParameters', () async {}); // Fake endpoint to test group parameters (optional) // // Fake endpoint to test group parameters (optional) // //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async { - // TODO - }); + test('test testGroupParameters', () async {}); // test inline additionalProperties // // // //Future testInlineAdditionalProperties(Map requestBody) async - test('test testInlineAdditionalProperties', () async { - // TODO - }); + test('test testInlineAdditionalProperties', () async {}); // test json serialization of form data // // // //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); + test('test testJsonFormData', () async {}); // To test the collection format in query parameters // //Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async - test('test testQueryParameterCollectionFormat', () async { - // TODO - }); + test('test testQueryParameterCollectionFormat', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart index 979c752e1c26..e2b2e38526dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart @@ -11,8 +11,6 @@ void main() { // To test class name in snake case // //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async { - // TODO - }); + test('test testClassname', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart index 14d7c2120cd9..934f530caf6f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FileSchemaTestClass void main() { final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FileSchemaTestClass, () { // ModelFile file - test('to test the property `file`', () async { - // TODO - }); + test('to test the property `file`', () async {}); // List files - test('to test the property `files`', () async { - // TODO - }); + test('to test the property `files`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart index 010cf1d167e5..37e97eb7b7a0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart @@ -9,15 +9,11 @@ void main() { // Create a Foo // //Future createFoo({ Foo foo }) async - test('test createFoo', () async { - // TODO - }); + test('test createFoo', () async {}); // GET all Foos // //Future> getAllFoos() async - test('test getAllFoos', () async { - // TODO - }); + test('test getAllFoos', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart index 8c9fc046dc25..07aa63e74690 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final FooBasicGetDefaultResponse? instance = /* FooBasicGetDefaultResponse(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FooBasicGetDefaultResponse, () { // Foo string - test('to test the property `string`', () async { - // TODO - }); + test('to test the property `string`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart index e5c101940aa0..7d91e69c2e13 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart @@ -4,37 +4,27 @@ import 'package:openapi/openapi.dart'; // tests for FooRefOrValue void main() { final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FooRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart index fe14a0965722..f6f684fcf861 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for FooRef void main() { final FooRef? instance = /* FooRef(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FooRef, () { // String foorefPropA - test('to test the property `foorefPropA`', () async { - // TODO - }); + test('to test the property `foorefPropA`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart index 42b4149f85b6..57fe605b6865 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart @@ -4,47 +4,33 @@ import 'package:openapi/openapi.dart'; // tests for Foo void main() { final Foo? instance = /* Foo(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Foo, () { // String fooPropA - test('to test the property `fooPropA`', () async { - // TODO - }); + test('to test the property `fooPropA`', () async {}); // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); + test('to test the property `fooPropB`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart index 93bb4ba3ca97..df0e277f8fce 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart @@ -4,89 +4,57 @@ import 'package:openapi/openapi.dart'; // tests for FormatTest void main() { final FormatTest? instance = /* FormatTest(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FormatTest, () { // int integer - test('to test the property `integer`', () async { - // TODO - }); + test('to test the property `integer`', () async {}); // int int32 - test('to test the property `int32`', () async { - // TODO - }); + test('to test the property `int32`', () async {}); // int int64 - test('to test the property `int64`', () async { - // TODO - }); + test('to test the property `int64`', () async {}); // num number - test('to test the property `number`', () async { - // TODO - }); + test('to test the property `number`', () async {}); // double float - test('to test the property `float`', () async { - // TODO - }); + test('to test the property `float`', () async {}); // double double_ - test('to test the property `double_`', () async { - // TODO - }); + test('to test the property `double_`', () async {}); // double decimal - test('to test the property `decimal`', () async { - // TODO - }); + test('to test the property `decimal`', () async {}); // String string - test('to test the property `string`', () async { - // TODO - }); + test('to test the property `string`', () async {}); // String byte - test('to test the property `byte`', () async { - // TODO - }); + test('to test the property `byte`', () async {}); // MultipartFile binary - test('to test the property `binary`', () async { - // TODO - }); + test('to test the property `binary`', () async {}); // DateTime date - test('to test the property `date`', () async { - // TODO - }); + test('to test the property `date`', () async {}); // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); + test('to test the property `dateTime`', () async {}); // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // String password - test('to test the property `password`', () async { - // TODO - }); + test('to test the property `password`', () async {}); // A string that is a 10 digit number. Can have leading zeros. // String patternWithDigits - test('to test the property `patternWithDigits`', () async { - // TODO - }); + test('to test the property `patternWithDigits`', () async {}); // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async { - // TODO - }); + test('to test the property `patternWithDigitsAndDelimiter`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart index 9c65d0622f84..1d6b05bd8905 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitAllOfDisc void main() { final FruitAllOfDisc? instance = /* FruitAllOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitAllOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart index ea6dd1079ea2..986e1f86a67f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitAnyOfDisc void main() { final FruitAnyOfDisc? instance = /* FruitAnyOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitAnyOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart index 90642e3028c8..7b0ed4b5f1ba 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitGrandparentDisc void main() { final FruitGrandparentDisc? instance = /* FruitGrandparentDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitGrandparentDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart index 604d536ed6eb..051e872b5ade 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDiscOneOf1 void main() { final FruitInlineDiscOneOf1? instance = /* FruitInlineDiscOneOf1(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart index c5ce025e0ee5..563b53be4ea4 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDiscOneOf void main() { final FruitInlineDiscOneOf? instance = /* FruitInlineDiscOneOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart index 09e2ef323ee5..502f4e7ef50c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineDisc void main() { final FruitInlineDisc? instance = /* FruitInlineDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart index a484f3a06494..825b41d9cc14 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart @@ -5,17 +5,13 @@ import 'package:openapi/openapi.dart'; void main() { final FruitInlineInlineDiscOneOf1? instance = /* FruitInlineInlineDiscOneOf1(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart index b7205794a8dc..16e0e703e347 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final FruitInlineInlineDiscOneOfOneOf? instance = /* FruitInlineInlineDiscOneOfOneOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineInlineDiscOneOfOneOf, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart index 6346211501dc..42566f6da0cd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart @@ -5,17 +5,13 @@ import 'package:openapi/openapi.dart'; void main() { final FruitInlineInlineDiscOneOf? instance = /* FruitInlineInlineDiscOneOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart index 5aa2ce2a79fd..f5c13c87c591 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitInlineInlineDisc void main() { final FruitInlineInlineDisc? instance = /* FruitInlineInlineDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitInlineInlineDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart index fd5e785603fd..f12c284ba507 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitOneOfDisc void main() { final FruitOneOfDisc? instance = /* FruitOneOfDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitOneOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart index a96143f06dc7..f9aadcc2fd86 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for FruitReqDisc void main() { final FruitReqDisc? instance = /* FruitReqDisc(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitReqDisc, () { // int seeds - test('to test the property `seeds`', () async { - // TODO - }); + test('to test the property `seeds`', () async {}); // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); // int length - test('to test the property `length`', () async { - // TODO - }); + test('to test the property `length`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart index e376b1d49990..ed0918001305 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for Fruit void main() { final Fruit? instance = /* Fruit(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Fruit, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); // num count - test('to test the property `count`', () async { - // TODO - }); + test('to test the property `count`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart index 4d1a0822c652..dbff53174feb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for FruitType void main() { final FruitType? instance = /* FruitType(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitType, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart index 1e7401d7f787..5b63b1301ce2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for FruitVariant1 void main() { final FruitVariant1? instance = /* FruitVariant1(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(FruitVariant1, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); // String kind - test('to test the property `kind`', () async { - // TODO - }); + test('to test the property `kind`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart index d9a2a5e015da..baaa072aad50 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for GigaOneOf void main() { final GigaOneOf? instance = /* GigaOneOf(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(GigaOneOf, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart index f9ddc8a6f4ef..9d7aab37b3f4 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for GrapeVariant1 void main() { final GrapeVariant1? instance = /* GrapeVariant1(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(GrapeVariant1, () { // String color - test('to test the property `color`', () async { - // TODO - }); + test('to test the property `color`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart index 5b33d9ca7457..8c50f9bffae1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for HasOnlyReadOnly void main() { final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(HasOnlyReadOnly, () { // String bar - test('to test the property `bar`', () async { - // TODO - }); + test('to test the property `bar`', () async {}); // String foo - test('to test the property `foo`', () async { - // TODO - }); + test('to test the property `foo`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart index adc423fde5d8..cac9fc773e64 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for HealthCheckResult void main() { final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(HealthCheckResult, () { // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); + test('to test the property `nullableMessage`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart index e6efc4c58af7..2e4968e31621 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart @@ -4,27 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for MapTest void main() { final MapTest? instance = /* MapTest(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(MapTest, () { // Map> mapMapOfString - test('to test the property `mapMapOfString`', () async { - // TODO - }); + test('to test the property `mapMapOfString`', () async {}); // Map mapOfEnumString - test('to test the property `mapOfEnumString`', () async { - // TODO - }); + test('to test the property `mapOfEnumString`', () async {}); // Map directMap - test('to test the property `directMap`', () async { - // TODO - }); + test('to test the property `directMap`', () async {}); // Map indirectMap - test('to test the property `indirectMap`', () async { - // TODO - }); + test('to test the property `indirectMap`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart index 4f4ed38bff17..ba7d3e7e1d0f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -5,22 +5,16 @@ import 'package:openapi/openapi.dart'; void main() { final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(MixedPropertiesAndAdditionalPropertiesClass, () { // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); + test('to test the property `dateTime`', () async {}); // Map map - test('to test the property `map`', () async { - // TODO - }); + test('to test the property `map`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart index f6c115209ad3..513eeaf5b0ca 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Model200Response void main() { final Model200Response? instance = /* Model200Response(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Model200Response, () { // int name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // String class_ - test('to test the property `class_`', () async { - // TODO - }); + test('to test the property `class_`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart index 5ea0a93ab265..bd1a98e0d42c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelClient void main() { final ModelClient? instance = /* ModelClient(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ModelClient, () { // String client - test('to test the property `client`', () async { - // TODO - }); + test('to test the property `client`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart index cfc5be5ba117..7e48a75765b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart @@ -4,13 +4,11 @@ import 'package:openapi/openapi.dart'; // tests for ModelFile void main() { final ModelFile? instance = /* ModelFile(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ModelFile, () { // Test capitalization // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); + test('to test the property `sourceURI`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart index a4ff05980ee6..98466f84a50d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelList void main() { final ModelList? instance = /* ModelList(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ModelList, () { // String n123list - test('to test the property `n123list`', () async { - // TODO - }); + test('to test the property `n123list`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart index 2f97f6cf6ed7..e13ca216a72b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for ModelReturn void main() { final ModelReturn? instance = /* ModelReturn(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ModelReturn, () { // int return_ - test('to test the property `return_`', () async { - // TODO - }); + test('to test the property `return_`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart index 036c3d07845c..ada0d1c60bc0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart @@ -4,27 +4,19 @@ import 'package:openapi/openapi.dart'; // tests for Name void main() { final Name? instance = /* Name(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Name, () { // int name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // int snakeCase - test('to test the property `snakeCase`', () async { - // TODO - }); + test('to test the property `snakeCase`', () async {}); // String property - test('to test the property `property`', () async { - // TODO - }); + test('to test the property `property`', () async {}); // int n123number - test('to test the property `n123number`', () async { - // TODO - }); + test('to test the property `n123number`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart index b5b320cae68b..9d4fe62b1014 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart @@ -4,67 +4,43 @@ import 'package:openapi/openapi.dart'; // tests for NullableClass void main() { final NullableClass? instance = /* NullableClass(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(NullableClass, () { // int integerProp - test('to test the property `integerProp`', () async { - // TODO - }); + test('to test the property `integerProp`', () async {}); // num numberProp - test('to test the property `numberProp`', () async { - // TODO - }); + test('to test the property `numberProp`', () async {}); // bool booleanProp - test('to test the property `booleanProp`', () async { - // TODO - }); + test('to test the property `booleanProp`', () async {}); // String stringProp - test('to test the property `stringProp`', () async { - // TODO - }); + test('to test the property `stringProp`', () async {}); // DateTime dateProp - test('to test the property `dateProp`', () async { - // TODO - }); + test('to test the property `dateProp`', () async {}); // DateTime datetimeProp - test('to test the property `datetimeProp`', () async { - // TODO - }); + test('to test the property `datetimeProp`', () async {}); // List arrayNullableProp - test('to test the property `arrayNullableProp`', () async { - // TODO - }); + test('to test the property `arrayNullableProp`', () async {}); // List arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async { - // TODO - }); + test('to test the property `arrayAndItemsNullableProp`', () async {}); // List arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async { - // TODO - }); + test('to test the property `arrayItemsNullable`', () async {}); // Map objectNullableProp - test('to test the property `objectNullableProp`', () async { - // TODO - }); + test('to test the property `objectNullableProp`', () async {}); // Map objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async { - // TODO - }); + test('to test the property `objectAndItemsNullableProp`', () async {}); // Map objectItemsNullable - test('to test the property `objectItemsNullable`', () async { - // TODO - }); + test('to test the property `objectItemsNullable`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart index 6764fbc7a8c5..1cd19b9bcd33 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for NumberOnly void main() { final NumberOnly? instance = /* NumberOnly(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(NumberOnly, () { // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); + test('to test the property `justNumber`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart index dd0c27df02a3..bd636f2eb2f1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart @@ -5,27 +5,19 @@ import 'package:openapi/openapi.dart'; void main() { final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ObjectWithDeprecatedFields, () { // String uuid - test('to test the property `uuid`', () async { - // TODO - }); + test('to test the property `uuid`', () async {}); // num id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async { - // TODO - }); + test('to test the property `deprecatedRef`', () async {}); // List bars - test('to test the property `bars`', () async { - // TODO - }); + test('to test the property `bars`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart index 58ad197020ad..90259deed94a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for OneOfPrimitiveChild void main() { final OneOfPrimitiveChild? instance = /* OneOfPrimitiveChild(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(OneOfPrimitiveChild, () { // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart index 8d5cbc6a9df5..e7456dbc208b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Order void main() { final Order? instance = /* Order(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Order, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // int petId - test('to test the property `petId`', () async { - // TODO - }); + test('to test the property `petId`', () async {}); // int quantity - test('to test the property `quantity`', () async { - // TODO - }); + test('to test the property `quantity`', () async {}); // DateTime shipDate - test('to test the property `shipDate`', () async { - // TODO - }); + test('to test the property `shipDate`', () async {}); // Order Status // String status - test('to test the property `status`', () async { - // TODO - }); + test('to test the property `status`', () async {}); // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); + test('to test the property `complete`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart index 5d675fe37618..620cb8580d1e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart @@ -4,22 +4,16 @@ import 'package:openapi/openapi.dart'; // tests for OuterComposite void main() { final OuterComposite? instance = /* OuterComposite(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(OuterComposite, () { // num myNumber - test('to test the property `myNumber`', () async { - // TODO - }); + test('to test the property `myNumber`', () async {}); // String myString - test('to test the property `myString`', () async { - // TODO - }); + test('to test the property `myString`', () async {}); // bool myBoolean - test('to test the property `myBoolean`', () async { - // TODO - }); + test('to test the property `myBoolean`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart index c658fed371ec..197fdbef8ea7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart @@ -5,12 +5,10 @@ import 'package:openapi/openapi.dart'; void main() { final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(OuterObjectWithEnumProperty, () { // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); + test('to test the property `value`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart index ac18a4a2c3a9..a15e32f69fde 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart @@ -4,12 +4,10 @@ import 'package:openapi/openapi.dart'; // tests for Parent void main() { final Parent? instance = /* Parent(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Parent, () { // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); + test('to test the property `fruitType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart index 98ba6325ac09..aa8cac46702c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for Pasta void main() { final Pasta? instance = /* Pasta(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Pasta, () { // String vendor - test('to test the property `vendor`', () async { - // TODO - }); + test('to test the property `vendor`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart index 149849529e17..adb75c822a58 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart @@ -11,80 +11,62 @@ void main() { // // //Future addPet(Pet pet) async - test('test addPet', () async { - // TODO - }); + test('test addPet', () async {}); // Deletes a pet // // // //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); + test('test deletePet', () async {}); // Finds Pets by status // // Multiple status values can be provided with comma separated strings // //Future> findPetsByStatus(List status) async - test('test findPetsByStatus', () async { - // TODO - }); + test('test findPetsByStatus', () async {}); // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // //Future> findPetsByTags(Set tags) async - test('test findPetsByTags', () async { - // TODO - }); + test('test findPetsByTags', () async {}); // Find pet by ID // // Returns a single pet // //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); + test('test getPetById', () async {}); // Update an existing pet // // // //Future updatePet(Pet pet) async - test('test updatePet', () async { - // TODO - }); + test('test updatePet', () async {}); // Updates a pet in the store with form data // // // //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); + test('test updatePetWithForm', () async {}); // uploads an image // // // //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); + test('test uploadFile', () async {}); // uploads an image (required) // // // //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async { - // TODO - }); + test('test uploadFileWithRequiredFile', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart index 4ff0a1207949..3ef32379be9d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart @@ -4,38 +4,26 @@ import 'package:openapi/openapi.dart'; // tests for Pet void main() { final Pet? instance = /* Pet(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Pet, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // Category category - test('to test the property `category`', () async { - // TODO - }); + test('to test the property `category`', () async {}); // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); // Set photoUrls - test('to test the property `photoUrls`', () async { - // TODO - }); + test('to test the property `photoUrls`', () async {}); // List tags - test('to test the property `tags`', () async { - // TODO - }); + test('to test the property `tags`', () async {}); // pet status in the store // String status - test('to test the property `status`', () async { - // TODO - }); + test('to test the property `status`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart index 002deb101bfc..a66c45371050 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for PizzaSpeziale void main() { final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(PizzaSpeziale, () { // String toppings - test('to test the property `toppings`', () async { - // TODO - }); + test('to test the property `toppings`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart index ea886dcc3a49..3b94adfed7a4 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart @@ -4,42 +4,30 @@ import 'package:openapi/openapi.dart'; // tests for Pizza void main() { final Pizza? instance = /* Pizza(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Pizza, () { // num pizzaSize - test('to test the property `pizzaSize`', () async { - // TODO - }); + test('to test the property `pizzaSize`', () async {}); // Hyperlink reference // String href - test('to test the property `href`', () async { - // TODO - }); + test('to test the property `href`', () async {}); // unique identifier // String id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); + test('to test the property `atSchemaLocation`', () async {}); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); + test('to test the property `atBaseType`', () async {}); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async { - // TODO - }); + test('to test the property `atType`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart index 4f4d9d207593..283271ed5a2e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for ReadOnlyFirst void main() { final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(ReadOnlyFirst, () { // String bar - test('to test the property `bar`', () async { - // TODO - }); + test('to test the property `bar`', () async {}); // String baz - test('to test the property `baz`', () async { - // TODO - }); + test('to test the property `baz`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart index 3a6043c9054b..3105bbd21bf8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart @@ -4,14 +4,12 @@ import 'package:openapi/openapi.dart'; // tests for SpecialModelName void main() { final SpecialModelName? instance = /* SpecialModelName(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket test( 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', - () async { - // TODO - }); + () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart index 97796b2576c4..df8b3438d90e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart @@ -11,35 +11,27 @@ void main() { // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); + test('test deleteOrder', () async {}); // Returns pet inventories by status // // Returns a map of status codes to quantities // //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); + test('test getInventory', () async {}); // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions // //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); + test('test getOrderById', () async {}); // Place an order for a pet // // // //Future placeOrder(Order order) async - test('test placeOrder', () async { - // TODO - }); + test('test placeOrder', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart index df95f3461fd9..7b4992ed979e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart @@ -4,17 +4,13 @@ import 'package:openapi/openapi.dart'; // tests for Tag void main() { final Tag? instance = /* Tag(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(Tag, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String name - test('to test the property `name`', () async { - // TODO - }); + test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart index 26839dcd85dd..30bc306fecc9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart @@ -11,71 +11,55 @@ void main() { // This can only be done by the logged in user. // //Future createUser(User user) async - test('test createUser', () async { - // TODO - }); + test('test createUser', () async {}); // Creates list of users with given input array // // // //Future createUsersWithArrayInput(List user) async - test('test createUsersWithArrayInput', () async { - // TODO - }); + test('test createUsersWithArrayInput', () async {}); // Creates list of users with given input array // // // //Future createUsersWithListInput(List user) async - test('test createUsersWithListInput', () async { - // TODO - }); + test('test createUsersWithListInput', () async {}); // Delete user // // This can only be done by the logged in user. // //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); + test('test deleteUser', () async {}); // Get user by user name // // // //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); + test('test getUserByName', () async {}); // Logs user into the system // // // //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); + test('test loginUser', () async {}); // Logs out current logged in user session // // // //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); + test('test logoutUser', () async {}); // Updated user // // This can only be done by the logged in user. // //Future updateUser(String username, User user) async - test('test updateUser', () async { - // TODO - }); + test('test updateUser', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart index fc1bb1cea555..2780d247eb1f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart @@ -4,48 +4,32 @@ import 'package:openapi/openapi.dart'; // tests for User void main() { final User? instance = /* User(...) */ null; - // TODO add properties to the entity + // add properties to the entity group(User, () { // int id - test('to test the property `id`', () async { - // TODO - }); + test('to test the property `id`', () async {}); // String username - test('to test the property `username`', () async { - // TODO - }); + test('to test the property `username`', () async {}); // String firstName - test('to test the property `firstName`', () async { - // TODO - }); + test('to test the property `firstName`', () async {}); // String lastName - test('to test the property `lastName`', () async { - // TODO - }); + test('to test the property `lastName`', () async {}); // String email - test('to test the property `email`', () async { - // TODO - }); + test('to test the property `email`', () async {}); // String password - test('to test the property `password`', () async { - // TODO - }); + test('to test the property `password`', () async {}); // String phone - test('to test the property `phone`', () async { - // TODO - }); + test('to test the property `phone`', () async {}); // User Status // int userStatus - test('to test the property `userStatus`', () async { - // TODO - }); + test('to test the property `userStatus`', () async {}); }); } From 244ca74ae6af1a14791b0f03726ed567fbf57ffb Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sun, 14 May 2023 04:16:16 +0200 Subject: [PATCH 16/31] WIP blocked by #10189 --- .../languages/DartDioClientCodegen.java | 18 ++++++- .../dart/libraries/dio/api_typed.mustache | 2 +- .../types/recursion_base_type_info.mustache | 11 +++- .../dart-dio/dio/built_value/doc/FakeApi.md | 18 +++---- .../dart-dio/dio/built_value/doc/PetApi.md | 4 +- .../dio/built_value/lib/src/api/fake_api.dart | 53 ++++++++++++++----- .../dio/built_value/lib/src/api/foo_api.dart | 4 +- .../dio/built_value/lib/src/api/pet_api.dart | 16 ++++-- .../built_value/lib/src/api/store_api.dart | 5 +- .../dio/built_value/lib/src/api/user_api.dart | 10 +++- .../dio/built_value/lib/src/serializers.dart | 16 +++--- .../test/api/pet_api_test.dart | 6 +-- .../test/model/date_serializer_test.dart | 1 - .../dio/json_serializable/doc/FakeApi.md | 18 +++---- .../dio/json_serializable/doc/PetApi.md | 4 +- .../lib/src/api/fake_api.dart | 53 ++++++++++++++----- .../lib/src/api/foo_api.dart | 4 +- .../lib/src/api/pet_api.dart | 16 ++++-- .../lib/src/api/store_api.dart | 5 +- .../lib/src/api/user_api.dart | 10 +++- 20 files changed, 195 insertions(+), 79 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 84963054519f..a704d4edc5a8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -46,8 +46,10 @@ import org.slf4j.LoggerFactory; import java.io.File; +import java.sql.Array; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -710,6 +712,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } + private void preferSchemaBaseType(CodegenParameter param) { + if (param.baseType != null && param.getSchema() != null && !param.baseType.equals(param.getSchema().baseType)){ + param.baseType = param.getSchema().baseType; + } + } + + @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { super.postProcessOperationsWithModels(objs, allModels); @@ -719,7 +728,9 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List resultImports = new HashSet<>(); for (CodegenOperation op : operationList) { - for (CodegenParameter param : op.allParams) { + for (CodegenParameter param : Stream.of(op.allParams, op.bodyParams, op.formParams) + .flatMap(Collection::stream) + .collect(Collectors.toList())) { if (((op.isMultipart && param.isFormParam) || param.isBodyParam) && (param.isBinary || param.isFile)) { param.dataType = param.dataType.replace("Uint8List", "MultipartFile"); param.baseType = param.baseType.replace("Uint8List", "MultipartFile"); @@ -735,6 +746,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, Listtypes/recursion_base_type_info}}).toString(),{{/isPathParam}}{{#isQueryParam}} {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_base_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}) ,{{/isQueryParam}}{{#isHeaderParam}} - {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString() ,{{/isHeaderParam}}{{/allParams}} + {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString(), {{/isHeaderParam}}{{/allParams}} {{#hasConsumes}} body: _bodyData, requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} diff --git a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache index 536bd8823c5d..00306c3fe3c4 100644 --- a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache +++ b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache @@ -1 +1,10 @@ -const TypeInfo{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{baseType}}, [{{#isMap}}TypeInfo(String), {{/isMap}}{{#items}}{{>types/recursion_base_type_info}}{{/items}}]{{/isContainer}}{{^isContainer}}{{#baseType}}{{{.}}}{{/baseType}}{{^baseType}}{{{dataType}}}{{/baseType}}{{/isContainer}}) \ No newline at end of file +{{! Prefer working with schemas}} +const TypeInfo{{#isNullable}}.nullable{{/isNullable}}( + {{#isContainer}}{{baseType}}, [ + {{#isMap}}TypeInfo(String), {{/isMap}} + {{#items}}{{>types/recursion_base_type_info}}{{/items}}, + ]{{/isContainer}}{{^isContainer}} + {{#baseType}}{{{.}}}{{/baseType}} + {{^baseType}}{{{dataType}}}{{/baseType}} + {{/isContainer}}) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md index 6787b8a9026b..d21291251d25 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md @@ -600,13 +600,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderStringArray** | [**BuiltList<String>**](BuiltList.md)| Header parameter enum test (string array) | [optional] **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryStringArray** | [**BuiltList<String>**](BuiltList.md)| Query parameter enum test (string array) | [optional] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](BuiltList.md)| | [optional] **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'] @@ -797,13 +797,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**BuiltList<String>**](String.md)| | - **ioutil** | [**BuiltList<String>**](String.md)| | - **http** | [**BuiltList<String>**](String.md)| | - **url** | [**BuiltList<String>**](String.md)| | - **context** | [**BuiltList<String>**](String.md)| | + **pipe** | [**BuiltList<String>**](BuiltList.md)| | + **ioutil** | [**BuiltList<String>**](BuiltList.md)| | + **http** | [**BuiltList<String>**](BuiltList.md)| | + **url** | [**BuiltList<String>**](BuiltList.md)| | + **context** | [**BuiltList<String>**](BuiltList.md)| | **allowEmpty** | **String**| | - **language** | [**BuiltMap<String, String>**](String.md)| | [optional] + **language** | [**BuiltMap<String, String>**](BuiltMap.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md index 4439dd57f352..bacc768e1498 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md @@ -138,7 +138,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | + **status** | [**BuiltList<String>**](BuiltList.md)| Status values that need to be considered for filter | ### Return type @@ -183,7 +183,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by | + **tags** | [**BuiltSet<String>**](BuiltSet.md)| Tags to filter by | ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart index 55f31dc05f8c..4b7997befee0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart @@ -832,7 +832,9 @@ class FakeApi { r'enum_form_string_array': encodeFormParameter( _repository, enumFormStringArray, - const TypeInfo(String, [const TypeInfo(String)])), + const TypeInfo(String, [ + const TypeInfo(String), + ])), if (enumFormString != null) r'enum_form_string': encodeFormParameter( _repository, enumFormString, const TypeInfo(String)), @@ -842,8 +844,11 @@ class FakeApi { enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository - .serialize(enumHeaderStringArray, - const TypeInfo(String, [const TypeInfo(String)])) + .serialize( + enumHeaderStringArray, + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ])) .toString(), enumHeaderString: enumHeaderString == null ? null @@ -855,7 +860,9 @@ class FakeApi { : encodeQueryParameter( _repository, enumQueryStringArray, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.multi, ), enumQueryString: enumQueryString == null @@ -884,7 +891,9 @@ class FakeApi { : encodeQueryParameter( _repository, enumQueryModelArray, - const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), + const TypeInfo(BuiltList, [ + const TypeInfo(ModelEnumClass), + ]), format: ListFormat.multi, ), body: _bodyData, @@ -1001,8 +1010,12 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(requestBody, - const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + _bodyData = _repository.serialize( + requestBody, + const TypeInfo(String, [ + TypeInfo(String), + const TypeInfo(String), + ])); final _response = await rawApi.testInlineAdditionalProperties( body: _bodyData, @@ -1103,31 +1116,41 @@ class FakeApi { pipe: encodeQueryParameter( _repository, pipe, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.pipes, ), ioutil: encodeQueryParameter( _repository, ioutil, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), http: encodeQueryParameter( _repository, http, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.ssv, ), url: encodeQueryParameter( _repository, url, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), context: encodeQueryParameter( _repository, context, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.multi, ), allowEmpty: encodeQueryParameter( @@ -1140,8 +1163,10 @@ class FakeApi { : encodeQueryParameter( _repository, language, - const TypeInfo( - String, [TypeInfo(String), const TypeInfo(String)]), + const TypeInfo(BuiltMap, [ + TypeInfo(String), + const TypeInfo(String), + ]), ), cancelToken: cancelToken, headers: headers, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart index a945593958a4..93be9791fc8e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart @@ -125,7 +125,9 @@ class FooApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(BuiltList, [const TypeInfo(FooRefOrValue)]), + const TypeInfo(BuiltList, [ + const TypeInfo(FooRefOrValue), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart index 06ea1bdb914d..2c2211230586 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart @@ -125,7 +125,9 @@ class PetApi { status: encodeQueryParameter( _repository, status, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltList, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), cancelToken: cancelToken, @@ -144,7 +146,9 @@ class PetApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(BuiltList, [const TypeInfo(Pet)]), + const TypeInfo(BuiltList, [ + const TypeInfo(Pet), + ]), ); } catch (error, stackTrace) { throw DioError( @@ -196,7 +200,9 @@ class PetApi { tags: encodeQueryParameter( _repository, tags, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(BuiltSet, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), cancelToken: cancelToken, @@ -215,7 +221,9 @@ class PetApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(BuiltSet, [const TypeInfo(Pet)]), + const TypeInfo(BuiltSet, [ + const TypeInfo(Pet), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart index 9d5b0ea36be3..4a36c8468a47 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart @@ -91,7 +91,10 @@ class StoreApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(BuiltMap, [TypeInfo(String), const TypeInfo(int)]), + const TypeInfo(BuiltMap, [ + TypeInfo(String), + const TypeInfo(int), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart index b5cc18ba6dd7..69e6a8249374 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart @@ -81,7 +81,10 @@ class UserApi { }) async { Object? _bodyData; _bodyData = _repository.serialize( - user, const TypeInfo(User, [const TypeInfo(User)])); + user, + const TypeInfo(User, [ + const TypeInfo(User), + ])); final _response = await rawApi.createUsersWithArrayInput( body: _bodyData, @@ -122,7 +125,10 @@ class UserApi { }) async { Object? _bodyData; _bodyData = _repository.serialize( - user, const TypeInfo(User, [const TypeInfo(User)])); + user, + const TypeInfo(User, [ + const TypeInfo(User), + ])); final _response = await rawApi.createUsersWithListInput( body: _bodyData, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart index 1f4b9ed153f0..852390728e2c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart @@ -140,10 +140,6 @@ Serializers serializers = (_$serializers.toBuilder() const FullType(BuiltList, [FullType(User)]), () => ListBuilder(), ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(String)]), - () => SetBuilder(), - ) ..addBuilderFactory( const FullType(BuiltSet, [FullType(Pet)]), () => SetBuilder(), @@ -152,6 +148,10 @@ Serializers serializers = (_$serializers.toBuilder() const FullType(BuiltList, [FullType(Pet)]), () => ListBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltSet, [FullType(BuiltSet)]), + () => SetBuilder(), + ) ..addBuilderFactory( const FullType(BuiltList, [FullType(FooRefOrValue)]), () => ListBuilder(), @@ -161,13 +161,17 @@ Serializers serializers = (_$serializers.toBuilder() () => MapBuilder(), ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(ModelEnumClass)]), - () => ListBuilder(), + const FullType(BuiltMap, [FullType(String), FullType(BuiltMap)]), + () => MapBuilder(), ) ..addBuilderFactory( const FullType(BuiltList, [FullType(String)]), () => ListBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(BuiltList)]), + () => ListBuilder(), + ) ..add(Addressable.serializer) ..add(Animal.serializer) ..add(CatAllOf.serializer) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart index af0363a2edac..74a3a319ac6e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart @@ -199,9 +199,9 @@ void main() { final response = await client.getPetApi().findPetsByStatus( // ignore: deprecated_member_use - status: ListBuilder([ - PetStatusEnum.available.name, - PetStatusEnum.sold.name, + status: ListBuilder([ + PetStatusEnum.available, + PetStatusEnum.sold, ]).build(), ); diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart index 9422fe8e47dd..22eb27f392c6 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart @@ -1,5 +1,4 @@ import 'package:openapi/openapi.dart'; -import 'package:openapi/src/date_serializer.dart'; import 'package:test/test.dart'; void main() { diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md index e0a685c9088e..b8d6974d4fcf 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md @@ -600,13 +600,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderStringArray** | [**List<String>**](List.md)| Header parameter enum test (string array) | [optional] **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryStringArray** | [**List<String>**](List.md)| Query parameter enum test (string array) | [optional] **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumQueryModelArray** | [**List<ModelEnumClass>**](List.md)| | [optional] **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] @@ -797,13 +797,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**List<String>**](String.md)| | - **ioutil** | [**List<String>**](String.md)| | - **http** | [**List<String>**](String.md)| | - **url** | [**List<String>**](String.md)| | - **context** | [**List<String>**](String.md)| | + **pipe** | [**List<String>**](List.md)| | + **ioutil** | [**List<String>**](List.md)| | + **http** | [**List<String>**](List.md)| | + **url** | [**List<String>**](List.md)| | + **context** | [**List<String>**](List.md)| | **allowEmpty** | **String**| | - **language** | [**Map<String, String>**](String.md)| | [optional] + **language** | [**Map<String, String>**](Map.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md index 46f6e5aa8d50..ce6501fd70cb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md @@ -138,7 +138,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + **status** | [**List<String>**](List.md)| Status values that need to be considered for filter | ### Return type @@ -183,7 +183,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**Set<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](Set.md)| Tags to filter by | ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart index 1d163823885f..aff48971f8eb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart @@ -830,7 +830,9 @@ class FakeApi { r'enum_form_string_array': encodeFormParameter( _repository, enumFormStringArray, - const TypeInfo(String, [const TypeInfo(String)])), + const TypeInfo(String, [ + const TypeInfo(String), + ])), if (enumFormString != null) r'enum_form_string': encodeFormParameter( _repository, enumFormString, const TypeInfo(String)), @@ -840,8 +842,11 @@ class FakeApi { enumHeaderStringArray: enumHeaderStringArray == null ? null : _repository - .serialize(enumHeaderStringArray, - const TypeInfo(String, [const TypeInfo(String)])) + .serialize( + enumHeaderStringArray, + const TypeInfo(List, [ + const TypeInfo(String), + ])) .toString(), enumHeaderString: enumHeaderString == null ? null @@ -853,7 +858,9 @@ class FakeApi { : encodeQueryParameter( _repository, enumQueryStringArray, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.multi, ), enumQueryString: enumQueryString == null @@ -882,7 +889,9 @@ class FakeApi { : encodeQueryParameter( _repository, enumQueryModelArray, - const TypeInfo(ModelEnumClass, [const TypeInfo(ModelEnumClass)]), + const TypeInfo(List, [ + const TypeInfo(ModelEnumClass), + ]), format: ListFormat.multi, ), body: _bodyData, @@ -999,8 +1008,12 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(requestBody, - const TypeInfo(String, [TypeInfo(String), const TypeInfo(String)])); + _bodyData = _repository.serialize( + requestBody, + const TypeInfo(String, [ + TypeInfo(String), + const TypeInfo(String), + ])); final _response = await rawApi.testInlineAdditionalProperties( body: _bodyData, @@ -1101,31 +1114,41 @@ class FakeApi { pipe: encodeQueryParameter( _repository, pipe, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.pipes, ), ioutil: encodeQueryParameter( _repository, ioutil, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), http: encodeQueryParameter( _repository, http, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.ssv, ), url: encodeQueryParameter( _repository, url, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), context: encodeQueryParameter( _repository, context, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.multi, ), allowEmpty: encodeQueryParameter( @@ -1138,8 +1161,10 @@ class FakeApi { : encodeQueryParameter( _repository, language, - const TypeInfo( - String, [TypeInfo(String), const TypeInfo(String)]), + const TypeInfo(Map, [ + TypeInfo(String), + const TypeInfo(String), + ]), ), cancelToken: cancelToken, headers: headers, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart index 20314653dfe4..9ef019c8f3f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart @@ -124,7 +124,9 @@ class FooApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(List, [const TypeInfo(FooRefOrValue)]), + const TypeInfo(List, [ + const TypeInfo(FooRefOrValue), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart index 2df778c0a647..8056aff4ef4d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart @@ -124,7 +124,9 @@ class PetApi { status: encodeQueryParameter( _repository, status, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(List, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), cancelToken: cancelToken, @@ -143,7 +145,9 @@ class PetApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(List, [const TypeInfo(Pet)]), + const TypeInfo(List, [ + const TypeInfo(Pet), + ]), ); } catch (error, stackTrace) { throw DioError( @@ -195,7 +199,9 @@ class PetApi { tags: encodeQueryParameter( _repository, tags, - const TypeInfo(String, [const TypeInfo(String)]), + const TypeInfo(Set, [ + const TypeInfo(String), + ]), format: ListFormat.csv, ), cancelToken: cancelToken, @@ -214,7 +220,9 @@ class PetApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(Set, [const TypeInfo(Pet)]), + const TypeInfo(Set, [ + const TypeInfo(Pet), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart index 5c749f4f277a..60f047ea4df5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart @@ -90,7 +90,10 @@ class StoreApi { ? null : _repository.deserialize( rawResponse, - const TypeInfo(Map, [TypeInfo(String), const TypeInfo(int)]), + const TypeInfo(Map, [ + TypeInfo(String), + const TypeInfo(int), + ]), ); } catch (error, stackTrace) { throw DioError( diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart index c5bd11a4ef64..2d145d17f8b5 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart @@ -80,7 +80,10 @@ class UserApi { }) async { Object? _bodyData; _bodyData = _repository.serialize( - user, const TypeInfo(User, [const TypeInfo(User)])); + user, + const TypeInfo(User, [ + const TypeInfo(User), + ])); final _response = await rawApi.createUsersWithArrayInput( body: _bodyData, @@ -121,7 +124,10 @@ class UserApi { }) async { Object? _bodyData; _bodyData = _repository.serialize( - user, const TypeInfo(User, [const TypeInfo(User)])); + user, + const TypeInfo(User, [ + const TypeInfo(User), + ])); final _response = await rawApi.createUsersWithListInput( body: _bodyData, From 26034cbacca1eb739cee9009fe95fd7224cf47cc Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:05:29 +0200 Subject: [PATCH 17/31] introduce dart-next --- .github/.test/samples.json | 6 + ...yaml => dart-next-dio-built_value-v3.yaml} | 6 +- ...> dart-next-dio-json_serializable-v3.yaml} | 0 docs/generators.md | 1 + docs/generators/README.md | 1 + docs/generators/dart-next.md | 256 ++++ .../languages/AbstractDartCodegen.java | 33 +- .../codegen/languages/DartClientCodegen.java | 36 + .../languages/DartDioClientCodegen.java | 238 ++- .../languages/DartNextAbstractCodegen.java | 845 +++++++++++ .../languages/DartNextClientCodegen.java | 1072 ++++++++++++++ .../org.openapitools.codegen.CodegenConfig | 1 + .../{dart => dart-next}/README.mustache | 0 .../analysis_options.mustache | 0 .../{dart => dart-next}/api.mustache | 0 .../{dart => dart-next}/api_doc.mustache | 0 .../{dart => dart-next}/api_test.mustache | 0 .../{dart => dart-next}/class.mustache | 0 .../{dart => dart-next}/dart-keywords.txt | 0 .../{dart => dart-next}/enum.mustache | 0 .../{dart => dart-next}/gitignore.mustache | 0 .../{dart => dart-next}/header.mustache | 0 .../{dart => dart-next}/lib.mustache | 0 .../lib_api_exports.mustache | 0 .../lib_model_exports.mustache | 0 .../dart-next/libraries/dio/api.mustache | 27 + .../libraries/dio/api_client.mustache | 0 .../libraries/dio/api_doc.mustache | 0 .../dart-next/libraries/dio/api_raw.mustache | 94 ++ .../libraries/dio/api_test.mustache | 0 .../libraries/dio/api_typed.mustache | 112 ++ .../libraries/dio/api_util.mustache | 27 + .../libraries/dio/auth/api_key_auth.mustache | 0 .../libraries/dio/auth/auth.mustache | 0 .../libraries/dio/auth/auth_exports.mustache | 0 .../libraries/dio/auth/basic_auth.mustache | 0 .../libraries/dio/auth/bearer_auth.mustache | 0 .../libraries/dio/auth/oauth.mustache | 0 .../{dart => dart-next}/model.mustache | 0 .../{dart => dart-next}/model_test.mustache | 0 .../{dart => dart-next}/object_doc.mustache | 0 .../{dart => dart-next}/pubspec.mustache | 0 .../serialization/built_value/class.mustache | 11 +- .../built_value/class_concrete.mustache | 0 .../built_value/class_discriminator.mustache | 0 .../built_value/class_header.mustache | 0 .../built_value/class_members.mustache | 2 +- .../built_value/class_serializer.mustache | 0 .../serialization/built_value/date.mustache | 0 .../built_value/date_serializer.mustache | 0 .../deserialize_properties.mustache | 2 +- .../serialization/built_value/enum.mustache | 4 +- .../built_value/enum_inline.mustache | 2 +- .../offset_date_serializer.mustache | 0 .../recursion_enum_inline.mustache | 12 + .../repository_construction.mustache | 0 .../built_value/repository_impl.mustache | 10 +- .../built_value/serializers.mustache | 11 +- .../built_value/test_instance.mustache | 0 .../variable_builder_type.mustache | 1 + .../variable_serializer_type.mustache | 1 + .../json_serializable/build.yaml.mustache | 0 .../json_serializable/class.mustache | 0 .../dart_constructor.mustache | 0 .../json_serializable/enum.mustache | 0 .../json_serializable/enum_inline.mustache | 0 .../repository_construction.mustache | 0 .../repository_impl.mustache | 121 ++ .../json_serializable/test_instance.mustache | 0 .../recursion_enum_inline.mustache | 12 + .../serialization/repository_base.mustache | 7 +- .../dart-next/types/recursion_type.mustache | 1 + .../types/recursion_type_info.mustache | 9 + .../dart-next/types/required.mustache | 15 + .../resources/dart/libraries/dio/api.mustache | 14 - .../dart/libraries/dio/api_raw.mustache | 232 --- .../dart/libraries/dio/api_typed.mustache | 133 -- .../dart/libraries/http/README.mustache | 145 -- .../libraries/http/analysis_options.mustache | 0 .../dart/libraries/http/api.mustache | 194 --- .../dart/libraries/http/api_client.mustache | 251 ---- .../dart/libraries/http/api_doc.mustache | 96 -- .../libraries/http/api_exception.mustache | 23 - .../dart/libraries/http/api_helper.mustache | 100 -- .../dart/libraries/http/api_test.mustache | 29 - .../dart/libraries/http/apilib.mustache | 33 - .../libraries/http/auth/api_key_auth.mustache | 30 - .../http/auth/authentication.mustache | 7 - .../dart/libraries/http/auth/header.mustache | 9 - .../http/auth/http_basic_auth.mustache | 16 - .../http/auth/http_bearer_auth.mustache | 39 - .../dart/libraries/http/auth/oauth.mustache | 14 - .../dart/libraries/http/auth/part_of.mustache | 1 - .../libraries/http/dart_constructor.mustache | 10 - .../dart/libraries/http/git_push.sh.mustache | 57 - .../dart/libraries/http/gitignore.mustache | 17 - .../dart/libraries/http/header.mustache | 9 - .../dart/libraries/http/model.mustache | 16 - .../dart/libraries/http/model_test.mustache | 29 - .../dart/libraries/http/object_doc.mustache | 16 - .../dart/libraries/http/part_of.mustache | 1 - .../dart/libraries/http/pubspec.mustache | 25 - .../native/native_class.mustache | 301 ---- .../serialization/native/native_enum.mustache | 81 - .../native/native_enum_inline.mustache | 81 - .../dart/libraries/http/travis.mustache | 14 - .../built_value/class_inline_enums.mustache | 23 - .../variable_serializer_type.mustache | 1 - .../built_value/variable_type.mustache | 1 - .../repository_impl.mustache | 75 - .../dart/types/recursion_base_type.mustache | 0 .../types/recursion_base_type_info.mustache | 10 - .../dart/dio/DartDioClientCodegenTest.java | 2 +- .../dart/next/DartNextClientCodegenTest.java | 126 ++ .../dart/next/DartNextClientOptionsTest.java | 59 + .../codegen/dart/next/DartNextModelTest.java | 495 +++++++ .../DartNextClientOptionsProvider.java | 82 + .../src/test/resources/3_0/dart/v3.0.0.yaml | 2 +- pom.xml | 2 + .../dio/built_value/doc/AppleAnyOfDisc.md | 16 - .../dio/built_value/doc/BananaAnyOfDisc.md | 16 - .../dart-dio/dio/built_value/doc/CatAllOf.md | 15 - .../dart-dio/dio/built_value/doc/DogAllOf.md | 15 - .../doc/FakeBigDecimalMap200Response.md | 16 - .../lib/src/model/apple_any_of_disc.dart | 134 -- .../lib/src/model/banana_any_of_disc.dart | 134 -- .../built_value/lib/src/model/cat_all_of.dart | 144 -- .../built_value/lib/src/model/dog_all_of.dart | 144 -- .../fake_big_decimal_map200_response.dart | 127 -- .../lib/src/model/fruit_any_of_disc.dart | 138 -- .../test/apple_any_of_disc_test.dart | 16 - .../test/banana_any_of_disc_test.dart | 16 - .../dio/built_value/test/cat_all_of_test.dart | 13 - .../dio/built_value/test/dog_all_of_test.dart | 13 - ...fake_big_decimal_map200_response_test.dart | 21 - .../json_serializable/doc/AppleAnyOfDisc.md | 16 - .../json_serializable/doc/BananaAnyOfDisc.md | 16 - .../dio/json_serializable/doc/CatAllOf.md | 15 - .../dio/json_serializable/doc/DogAllOf.md | 15 - .../doc/FakeBigDecimalMap200Response.md | 16 - .../lib/src/model/apple_any_of_disc.dart | 49 - .../lib/src/model/banana_any_of_disc.dart | 49 - .../lib/src/model/cat_all_of.dart | 41 - .../lib/src/model/dog_all_of.dart | 41 - .../fake_big_decimal_map200_response.dart | 70 - .../lib/src/repository_impl.dart | 324 ---- .../test/apple_any_of_disc_test.dart | 16 - .../test/banana_any_of_disc_test.dart | 16 - .../test/cat_all_of_test.dart | 13 - .../test/dog_all_of_test.dart | 13 - ...fake_big_decimal_map200_response_test.dart | 21 - .../dio/built_value/.gitignore | 0 .../dio/built_value/.openapi-generator-ignore | 0 .../dio/built_value/.openapi-generator/FILES | 117 +- .../built_value/.openapi-generator/VERSION | 0 .../dio/built_value/README.md | 14 - .../dio/built_value/analysis_options.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../dio/built_value/doc/Addressable.md | 0 .../dio/built_value/doc/AllOfWithSingleRef.md | 0 .../dio/built_value/doc/Animal.md | 0 .../dio/built_value/doc/AnotherFakeApi.md | 0 .../dio/built_value/doc/ApiResponse.md | 0 .../dio/built_value/doc/Apple.md | 0 .../dio/built_value/doc/AppleAllOfDisc.md | 0 .../built_value/doc/AppleGrandparentDisc.md | 0 .../dio/built_value/doc/AppleOneOfDisc.md | 0 .../dio/built_value/doc/AppleReqDisc.md | 0 .../dio/built_value/doc/AppleVariant1.md | 0 .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../dio/built_value/doc/ArrayOfNumberOnly.md | 0 .../dio/built_value/doc/ArrayTest.md | 0 .../dio/built_value/doc/Banana.md | 0 .../dio/built_value/doc/BananaAllOfDisc.md | 0 .../built_value/doc/BananaGrandparentDisc.md | 0 .../dio/built_value/doc/BananaOneOfDisc.md | 0 .../dio/built_value/doc/BananaReqDisc.md | 0 .../dio/built_value/doc/Bar.md | 0 .../dio/built_value/doc/BarApi.md | 0 .../dio/built_value/doc/BarCreate.md | 0 .../dio/built_value/doc/BarRef.md | 0 .../dio/built_value/doc/BarRefOrValue.md | 0 .../dio/built_value/doc/Capitalization.md | 0 .../dio/built_value/doc/Cat.md | 0 .../dio/built_value/doc/Category.md | 0 .../dio/built_value/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 0 .../doc/ComposedDiscOptionalTypeCorrect.md | 0 .../ComposedDiscOptionalTypeInconsistent.md | 0 .../doc/ComposedDiscOptionalTypeIncorrect.md | 0 .../doc/ComposedDiscRequiredInconsistent.md | 0 .../doc/ComposedDiscTypeInconsistent.md | 0 .../doc/ComposedDiscTypeIncorrect.md | 0 .../dio/built_value/doc/DefaultApi.md | 12 +- .../dio/built_value/doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 0 .../doc/DiscOptionalTypeCorrect.md | 0 .../doc/DiscOptionalTypeIncorrect.md | 0 .../dio/built_value/doc/DiscTypeIncorrect.md | 0 .../dio/built_value/doc/Dog.md | 0 .../dio/built_value/doc/Entity.md | 0 .../dio/built_value/doc/EntityRef.md | 0 .../dio/built_value/doc/EnumArrays.md | 0 .../dio/built_value/doc/EnumTest.md | 0 .../dio/built_value/doc/Extensible.md | 0 .../dio/built_value/doc/FakeApi.md | 70 +- .../doc/FakeClassnameTags123Api.md | 0 .../built_value/doc/FileSchemaTestClass.md | 0 .../dio/built_value/doc/Foo.md | 0 .../dio/built_value/doc/FooApi.md | 0 .../doc/FooBasicGetDefaultResponse.md | 0 .../dio/built_value/doc/FooRef.md | 0 .../dio/built_value/doc/FooRefOrValue.md | 0 .../dio/built_value/doc/FormatTest.md | 0 .../dio/built_value/doc/Fruit.md | 0 .../dio/built_value/doc/FruitAllOfDisc.md | 0 .../dio/built_value/doc/FruitAnyOfDisc.md | 0 .../built_value/doc/FruitGrandparentDisc.md | 0 .../dio/built_value/doc/FruitInlineDisc.md | 0 .../built_value/doc/FruitInlineDiscOneOf.md | 0 .../built_value/doc/FruitInlineDiscOneOf1.md | 0 .../built_value/doc/FruitInlineInlineDisc.md | 0 .../doc/FruitInlineInlineDiscOneOf.md | 0 .../doc/FruitInlineInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDiscOneOfOneOf.md | 0 .../dio/built_value/doc/FruitOneOfDisc.md | 0 .../dio/built_value/doc/FruitReqDisc.md | 0 .../dio/built_value/doc/FruitType.md | 0 .../dio/built_value/doc/FruitVariant1.md | 0 .../dio/built_value/doc/GigaOneOf.md | 0 .../dio/built_value/doc/GrapeVariant1.md | 0 .../dio/built_value/doc/HasOnlyReadOnly.md | 0 .../dio/built_value/doc/HealthCheckResult.md | 0 .../dio/built_value/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../dio/built_value/doc/Model200Response.md | 0 .../dio/built_value/doc/ModelClient.md | 0 .../dio/built_value/doc/ModelEnumClass.md | 0 .../dio/built_value/doc/ModelFile.md | 0 .../dio/built_value/doc/ModelList.md | 0 .../dio/built_value/doc/ModelReturn.md | 0 .../dio/built_value/doc/Name.md | 0 .../dio/built_value/doc/NullableClass.md | 0 .../dio/built_value/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 0 .../built_value/doc/OneOfPrimitiveChild.md | 0 .../dio/built_value/doc/Order.md | 0 .../dio/built_value/doc/OuterComposite.md | 0 .../dio/built_value/doc/OuterEnum.md | 0 .../built_value/doc/OuterEnumDefaultValue.md | 0 .../dio/built_value/doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dio/built_value/doc/Parent.md | 0 .../dio/built_value/doc/Pasta.md | 0 .../dio/built_value/doc/Pet.md | 0 .../dio/built_value/doc/PetApi.md | 4 +- .../dio/built_value/doc/Pizza.md | 0 .../dio/built_value/doc/PizzaSpeziale.md | 0 .../dio/built_value/doc/ReadOnlyFirst.md | 0 .../dio/built_value/doc/SingleRefType.md | 0 .../dio/built_value/doc/SpecialModelName.md | 0 .../dio/built_value/doc/StoreApi.md | 0 .../dio/built_value/doc/Tag.md | 0 .../dio/built_value/doc/User.md | 0 .../dio/built_value/doc/UserApi.md | 0 .../dio/built_value/lib/apis.dart | 0 .../dio/built_value/lib/models.dart | 4 - .../dio/built_value/lib/openapi.dart | 0 .../lib/src/api/another_fake_api.dart | 57 +- .../dio/built_value/lib/src/api/bar_api.dart | 82 +- .../built_value/lib/src/api/default_api.dart | 349 +---- .../dio/built_value/lib/src/api/fake_api.dart | 623 +++++--- .../src/api/fake_classname_tags123_api.dart | 44 +- .../dio/built_value/lib/src/api/foo_api.dart | 140 +- .../dio/built_value/lib/src/api/pet_api.dart | 838 ++--------- .../built_value/lib/src/api/store_api.dart | 280 +--- .../dio/built_value/lib/src/api/user_api.dart | 75 +- .../dio/built_value/lib/src/api_client.dart | 0 .../dio/built_value/lib/src/api_util.dart | 28 + .../built_value/lib/src/auth/_exports.dart | 0 .../lib/src/auth/api_key_auth.dart | 0 .../dio/built_value/lib/src/auth/auth.dart | 0 .../built_value/lib/src/auth/basic_auth.dart | 0 .../built_value/lib/src/auth/bearer_auth.dart | 0 .../dio/built_value/lib/src/auth/oauth.dart | 0 .../built_value/lib/src/date_serializer.dart | 0 .../model/additional_properties_class.dart | 0 .../lib/src/model/addressable.dart | 0 .../lib/src/model/all_of_with_single_ref.dart | 0 .../dio/built_value/lib/src/model/animal.dart | 0 .../lib/src/model/api_response.dart | 0 .../dio/built_value/lib/src/model/apple.dart | 0 .../lib/src/model/apple_all_of_disc.dart | 0 .../lib/src/model/apple_grandparent_disc.dart | 0 .../lib/src/model/apple_one_of_disc.dart | 0 .../lib/src/model/apple_req_disc.dart | 0 .../lib/src/model/apple_variant1.dart | 0 .../model/array_of_array_of_number_only.dart | 0 .../lib/src/model/array_of_number_only.dart | 0 .../built_value/lib/src/model/array_test.dart | 0 .../dio/built_value/lib/src/model/banana.dart | 0 .../lib/src/model/banana_all_of_disc.dart | 0 .../src/model/banana_grandparent_disc.dart | 0 .../lib/src/model/banana_one_of_disc.dart | 0 .../lib/src/model/banana_req_disc.dart | 0 .../dio/built_value/lib/src/model/bar.dart | 0 .../built_value/lib/src/model/bar_create.dart | 0 .../built_value/lib/src/model/bar_ref.dart | 0 .../lib/src/model/bar_ref_or_value.dart | 0 .../lib/src/model/capitalization.dart | 0 .../dio/built_value/lib/src/model/cat.dart | 0 .../built_value/lib/src/model/category.dart | 0 .../lib/src/model/class_model.dart | 0 ...composed_disc_missing_from_properties.dart | 0 .../composed_disc_optional_type_correct.dart | 0 ...posed_disc_optional_type_inconsistent.dart | 0 ...composed_disc_optional_type_incorrect.dart | 0 .../composed_disc_required_inconsistent.dart | 0 .../composed_disc_type_inconsistent.dart | 0 .../model/composed_disc_type_incorrect.dart | 0 .../dio/built_value/lib/src/model/date.dart | 0 .../lib/src/model/deprecated_object.dart | 0 .../model/disc_missing_from_properties.dart | 0 .../src/model/disc_optional_type_correct.dart | 0 .../model/disc_optional_type_incorrect.dart | 0 .../lib/src/model/disc_type_incorrect.dart | 0 .../dio/built_value/lib/src/model/dog.dart | 0 .../dio/built_value/lib/src/model/entity.dart | 0 .../built_value/lib/src/model/entity_ref.dart | 0 .../lib/src/model/enum_arrays.dart | 0 .../built_value/lib/src/model/enum_test.dart | 0 .../built_value/lib/src/model/extensible.dart | 0 .../lib/src/model/file_schema_test_class.dart | 0 .../dio/built_value/lib/src/model/foo.dart | 0 .../model/foo_basic_get_default_response.dart | 0 .../built_value/lib/src/model/foo_ref.dart | 0 .../lib/src/model/foo_ref_or_value.dart | 0 .../lib/src/model/format_test.dart | 0 .../dio/built_value/lib/src/model/fruit.dart | 0 .../lib/src/model/fruit_all_of_disc.dart | 0 .../lib/src/model/fruit_any_of_disc.dart | 75 + .../lib/src/model/fruit_grandparent_disc.dart | 0 .../lib/src/model/fruit_inline_disc.dart | 0 .../src/model/fruit_inline_disc_one_of.dart | 0 .../src/model/fruit_inline_disc_one_of1.dart | 0 .../src/model/fruit_inline_inline_disc.dart | 0 .../fruit_inline_inline_disc_one_of.dart | 0 .../fruit_inline_inline_disc_one_of1.dart | 0 ...ruit_inline_inline_disc_one_of_one_of.dart | 0 .../lib/src/model/fruit_one_of_disc.dart | 0 .../lib/src/model/fruit_req_disc.dart | 0 .../built_value/lib/src/model/fruit_type.dart | 0 .../lib/src/model/fruit_variant1.dart | 0 .../lib/src/model/giga_one_of.dart | 0 .../lib/src/model/grape_variant1.dart | 0 .../lib/src/model/has_only_read_only.dart | 0 .../lib/src/model/health_check_result.dart | 0 .../built_value/lib/src/model/map_test.dart | 0 ...rties_and_additional_properties_class.dart | 0 .../lib/src/model/model200_response.dart | 0 .../lib/src/model/model_client.dart | 0 .../lib/src/model/model_enum_class.dart | 2 +- .../built_value/lib/src/model/model_file.dart | 0 .../built_value/lib/src/model/model_list.dart | 0 .../lib/src/model/model_return.dart | 0 .../dio/built_value/lib/src/model/name.dart | 0 .../lib/src/model/nullable_class.dart | 0 .../lib/src/model/number_only.dart | 0 .../model/object_with_deprecated_fields.dart | 0 .../lib/src/model/one_of_primitive_child.dart | 0 .../dio/built_value/lib/src/model/order.dart | 0 .../lib/src/model/outer_composite.dart | 0 .../built_value/lib/src/model/outer_enum.dart | 2 +- .../src/model/outer_enum_default_value.dart | 3 +- .../lib/src/model/outer_enum_integer.dart | 2 +- .../outer_enum_integer_default_value.dart | 3 +- .../outer_object_with_enum_property.dart | 0 .../dio/built_value/lib/src/model/parent.dart | 0 .../dio/built_value/lib/src/model/pasta.dart | 0 .../dio/built_value/lib/src/model/pet.dart | 0 .../dio/built_value/lib/src/model/pizza.dart | 0 .../lib/src/model/pizza_speziale.dart | 0 .../lib/src/model/read_only_first.dart | 0 .../lib/src/model/single_ref_type.dart | 2 +- .../lib/src/model/special_model_name.dart | 0 .../dio/built_value/lib/src/model/tag.dart | 0 .../dio/built_value/lib/src/model/user.dart | 0 .../built_value}/lib/src/repository_base.dart | 9 +- .../built_value/lib/src/repository_impl.dart | 12 +- .../dio/built_value/lib/src/serializers.dart | 59 +- .../dio/built_value/pom.xml | 0 .../dio/built_value/pubspec.yaml | 0 .../additional_properties_class_test.dart | 0 .../built_value/test/addressable_test.dart | 0 .../test/all_of_with_single_ref_test.dart | 0 .../dio/built_value/test/animal_test.dart | 0 .../test/another_fake_api_test.dart | 0 .../built_value/test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 0 .../test/apple_grandparent_disc_test.dart | 0 .../test/apple_one_of_disc_test.dart | 0 .../built_value/test/apple_req_disc_test.dart | 0 .../dio/built_value/test/apple_test.dart | 0 .../built_value/test/apple_variant1_test.dart | 0 .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../dio/built_value/test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 0 .../test/banana_grandparent_disc_test.dart | 0 .../test/banana_one_of_disc_test.dart | 0 .../test/banana_req_disc_test.dart | 0 .../dio/built_value/test/banana_test.dart | 0 .../dio/built_value/test/bar_api_test.dart | 0 .../dio/built_value/test/bar_create_test.dart | 0 .../test/bar_ref_or_value_test.dart | 0 .../dio/built_value/test/bar_ref_test.dart | 0 .../dio/built_value/test/bar_test.dart | 0 .../built_value/test/capitalization_test.dart | 0 .../dio/built_value/test/cat_test.dart | 0 .../dio/built_value/test/category_test.dart | 0 .../built_value/test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 0 ...posed_disc_optional_type_correct_test.dart | 0 ..._disc_optional_type_inconsistent_test.dart | 0 ...sed_disc_optional_type_incorrect_test.dart | 0 ...posed_disc_required_inconsistent_test.dart | 0 .../composed_disc_type_inconsistent_test.dart | 0 .../composed_disc_type_incorrect_test.dart | 0 .../built_value/test/default_api_test.dart | 0 .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 0 .../test/disc_optional_type_correct_test.dart | 0 .../disc_optional_type_incorrect_test.dart | 0 .../test/disc_type_incorrect_test.dart | 0 .../dio/built_value/test/dog_test.dart | 0 .../dio/built_value/test/entity_ref_test.dart | 0 .../dio/built_value/test/entity_test.dart | 0 .../built_value/test/enum_arrays_test.dart | 0 .../dio/built_value/test/enum_test_test.dart | 0 .../dio/built_value/test/extensible_test.dart | 0 .../dio/built_value/test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../dio/built_value/test/foo_api_test.dart | 0 .../foo_basic_get_default_response_test.dart | 0 .../test/foo_ref_or_value_test.dart | 0 .../dio/built_value/test/foo_ref_test.dart | 0 .../dio/built_value/test/foo_test.dart | 0 .../built_value/test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 0 .../test/fruit_any_of_disc_test.dart | 0 .../test/fruit_grandparent_disc_test.dart | 0 .../test/fruit_inline_disc_one_of1_test.dart | 0 .../test/fruit_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_disc_test.dart | 0 ...fruit_inline_inline_disc_one_of1_test.dart | 0 ...inline_inline_disc_one_of_one_of_test.dart | 0 .../fruit_inline_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_inline_disc_test.dart | 0 .../test/fruit_one_of_disc_test.dart | 0 .../built_value/test/fruit_req_disc_test.dart | 0 .../dio/built_value/test/fruit_test.dart | 0 .../dio/built_value/test/fruit_type_test.dart | 0 .../built_value/test/fruit_variant1_test.dart | 0 .../built_value/test/giga_one_of_test.dart | 0 .../built_value/test/grape_variant1_test.dart | 0 .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../dio/built_value/test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../built_value/test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../dio/built_value/test/model_file_test.dart | 0 .../dio/built_value/test/model_list_test.dart | 0 .../built_value/test/model_return_test.dart | 0 .../dio/built_value/test/name_test.dart | 0 .../built_value/test/nullable_class_test.dart | 0 .../built_value/test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 0 .../test/one_of_primitive_child_test.dart | 0 .../dio/built_value/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../dio/built_value/test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../dio/built_value/test/parent_test.dart | 0 .../dio/built_value/test/pasta_test.dart | 0 .../dio/built_value/test/pet_api_test.dart | 0 .../dio/built_value/test/pet_test.dart | 0 .../built_value/test/pizza_speziale_test.dart | 0 .../dio/built_value/test/pizza_test.dart | 0 .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../dio/built_value/test/store_api_test.dart | 0 .../dio/built_value/test/tag_test.dart | 0 .../dio/built_value/test/user_api_test.dart | 0 .../dio/built_value/test/user_test.dart | 0 .../dio/built_value_tests/.gitignore | 0 .../dio/built_value_tests/README.md | 2 +- .../built_value_tests/analysis_options.yaml | 0 .../dio/built_value_tests/pubspec.yaml | 0 .../dio/built_value_tests/puby.yaml | 0 .../test/api/authentication_test.dart | 0 .../test/api/fake_api_test.dart | 0 .../test/api/pet_api_test.dart | 0 .../test/api/store_api_test.dart | 0 .../built_value_tests/test/api_util_test.dart | 0 .../test/model/date_serializer_test.dart | 0 .../test/model/date_test.dart | 0 .../dio/json_serializable/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/FILES | 117 +- .../.openapi-generator/VERSION | 0 .../dio/json_serializable/README.md | 3 - .../json_serializable/analysis_options.yaml | 0 .../dio/json_serializable/build.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../dio/json_serializable/doc/Addressable.md | 0 .../doc/AllOfWithSingleRef.md | 0 .../dio/json_serializable/doc/Animal.md | 2 +- .../json_serializable/doc/AnotherFakeApi.md | 0 .../dio/json_serializable/doc/ApiResponse.md | 0 .../dio/json_serializable/doc/Apple.md | 0 .../json_serializable/doc/AppleAllOfDisc.md | 0 .../doc/AppleGrandparentDisc.md | 0 .../json_serializable/doc/AppleOneOfDisc.md | 0 .../dio/json_serializable/doc/AppleReqDisc.md | 0 .../json_serializable/doc/AppleVariant1.md | 0 .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../doc/ArrayOfNumberOnly.md | 0 .../dio/json_serializable/doc/ArrayTest.md | 0 .../dio/json_serializable/doc/Banana.md | 0 .../json_serializable/doc/BananaAllOfDisc.md | 0 .../doc/BananaGrandparentDisc.md | 0 .../json_serializable/doc/BananaOneOfDisc.md | 0 .../json_serializable/doc/BananaReqDisc.md | 0 .../dio/json_serializable/doc/Bar.md | 0 .../dio/json_serializable/doc/BarApi.md | 2 +- .../dio/json_serializable/doc/BarCreate.md | 0 .../dio/json_serializable/doc/BarRef.md | 0 .../json_serializable/doc/BarRefOrValue.md | 0 .../json_serializable/doc/Capitalization.md | 0 .../dio/json_serializable/doc/Cat.md | 2 +- .../dio/json_serializable/doc/Category.md | 2 +- .../dio/json_serializable/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 0 .../doc/ComposedDiscOptionalTypeCorrect.md | 0 .../ComposedDiscOptionalTypeInconsistent.md | 0 .../doc/ComposedDiscOptionalTypeIncorrect.md | 0 .../doc/ComposedDiscRequiredInconsistent.md | 0 .../doc/ComposedDiscTypeInconsistent.md | 0 .../doc/ComposedDiscTypeIncorrect.md | 0 .../dio/json_serializable/doc/DefaultApi.md | 12 +- .../json_serializable/doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 0 .../doc/DiscOptionalTypeCorrect.md | 0 .../doc/DiscOptionalTypeIncorrect.md | 0 .../doc/DiscTypeIncorrect.md | 0 .../dio/json_serializable/doc/Dog.md | 2 +- .../dio/json_serializable/doc/Entity.md | 0 .../dio/json_serializable/doc/EntityRef.md | 0 .../dio/json_serializable/doc/EnumArrays.md | 0 .../dio/json_serializable/doc/EnumTest.md | 0 .../dio/json_serializable/doc/Extensible.md | 0 .../dio/json_serializable/doc/FakeApi.md | 70 +- .../doc/FakeClassnameTags123Api.md | 0 .../doc/FileSchemaTestClass.md | 0 .../dio/json_serializable/doc/Foo.md | 0 .../dio/json_serializable/doc/FooApi.md | 4 +- .../doc/FooBasicGetDefaultResponse.md | 0 .../dio/json_serializable/doc/FooRef.md | 0 .../json_serializable/doc/FooRefOrValue.md | 0 .../dio/json_serializable/doc/FormatTest.md | 0 .../dio/json_serializable/doc/Fruit.md | 0 .../json_serializable/doc/FruitAllOfDisc.md | 0 .../json_serializable/doc/FruitAnyOfDisc.md | 0 .../doc/FruitGrandparentDisc.md | 0 .../json_serializable/doc/FruitInlineDisc.md | 0 .../doc/FruitInlineDiscOneOf.md | 0 .../doc/FruitInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDisc.md | 0 .../doc/FruitInlineInlineDiscOneOf.md | 0 .../doc/FruitInlineInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDiscOneOfOneOf.md | 0 .../json_serializable/doc/FruitOneOfDisc.md | 0 .../dio/json_serializable/doc/FruitReqDisc.md | 0 .../dio/json_serializable/doc/FruitType.md | 0 .../json_serializable/doc/FruitVariant1.md | 0 .../dio/json_serializable/doc/GigaOneOf.md | 0 .../json_serializable/doc/GrapeVariant1.md | 0 .../json_serializable/doc/HasOnlyReadOnly.md | 0 .../doc/HealthCheckResult.md | 0 .../dio/json_serializable/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../json_serializable/doc/Model200Response.md | 0 .../dio/json_serializable/doc/ModelClient.md | 0 .../json_serializable/doc/ModelEnumClass.md | 0 .../dio/json_serializable/doc/ModelFile.md | 0 .../dio/json_serializable/doc/ModelList.md | 0 .../dio/json_serializable/doc/ModelReturn.md | 0 .../dio/json_serializable/doc/Name.md | 0 .../json_serializable/doc/NullableClass.md | 0 .../dio/json_serializable/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 0 .../doc/OneOfPrimitiveChild.md | 0 .../dio/json_serializable/doc/Order.md | 0 .../json_serializable/doc/OuterComposite.md | 0 .../dio/json_serializable/doc/OuterEnum.md | 0 .../doc/OuterEnumDefaultValue.md | 0 .../json_serializable/doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dio/json_serializable/doc/Parent.md | 0 .../dio/json_serializable/doc/Pasta.md | 0 .../dio/json_serializable/doc/Pet.md | 0 .../dio/json_serializable/doc/PetApi.md | 4 +- .../dio/json_serializable/doc/Pizza.md | 0 .../json_serializable/doc/PizzaSpeziale.md | 0 .../json_serializable/doc/ReadOnlyFirst.md | 0 .../json_serializable/doc/SingleRefType.md | 0 .../json_serializable/doc/SpecialModelName.md | 0 .../dio/json_serializable/doc/StoreApi.md | 0 .../dio/json_serializable/doc/Tag.md | 0 .../dio/json_serializable/doc/User.md | 0 .../dio/json_serializable/doc/UserApi.md | 0 .../dio/json_serializable/lib/apis.dart | 0 .../dio/json_serializable/lib/models.dart | 4 - .../dio/json_serializable/lib/openapi.dart | 0 .../lib/src/api/another_fake_api.dart | 21 +- .../lib/src/api/bar_api.dart | 44 +- .../lib/src/api/default_api.dart | 261 +--- .../lib/src/api/fake_api.dart | 1314 +++++++++++------ .../src/api/fake_classname_tags123_api.dart | 63 +- .../lib/src/api/foo_api.dart | 179 +-- .../lib/src/api/pet_api.dart | 156 +- .../lib/src/api/store_api.dart | 243 +-- .../lib/src/api/user_api.dart | 74 +- .../json_serializable/lib/src/api_client.dart | 0 .../json_serializable/lib/src/api_util.dart | 28 + .../lib/src/auth/_exports.dart | 0 .../lib/src/auth/api_key_auth.dart | 0 .../json_serializable/lib/src/auth/auth.dart | 0 .../lib/src/auth/basic_auth.dart | 0 .../lib/src/auth/bearer_auth.dart | 0 .../json_serializable/lib/src/auth/oauth.dart | 0 .../model/additional_properties_class.dart | 0 .../lib/src/model/addressable.dart | 0 .../lib/src/model/all_of_with_single_ref.dart | 0 .../lib/src/model/animal.dart | 4 +- .../lib/src/model/api_response.dart | 0 .../lib/src/model/apple.dart | 0 .../lib/src/model/apple_all_of_disc.dart | 0 .../lib/src/model/apple_grandparent_disc.dart | 0 .../lib/src/model/apple_one_of_disc.dart | 0 .../lib/src/model/apple_req_disc.dart | 0 .../lib/src/model/apple_variant1.dart | 0 .../model/array_of_array_of_number_only.dart | 0 .../lib/src/model/array_of_number_only.dart | 0 .../lib/src/model/array_test.dart | 0 .../lib/src/model/banana.dart | 0 .../lib/src/model/banana_all_of_disc.dart | 0 .../src/model/banana_grandparent_disc.dart | 0 .../lib/src/model/banana_one_of_disc.dart | 0 .../lib/src/model/banana_req_disc.dart | 0 .../json_serializable/lib/src/model/bar.dart | 0 .../lib/src/model/bar_create.dart | 0 .../lib/src/model/bar_ref.dart | 0 .../lib/src/model/bar_ref_or_value.dart | 0 .../lib/src/model/capitalization.dart | 0 .../json_serializable/lib/src/model/cat.dart | 4 +- .../lib/src/model/category.dart | 4 +- .../lib/src/model/class_model.dart | 0 ...composed_disc_missing_from_properties.dart | 0 .../composed_disc_optional_type_correct.dart | 0 ...posed_disc_optional_type_inconsistent.dart | 0 ...composed_disc_optional_type_incorrect.dart | 0 .../composed_disc_required_inconsistent.dart | 0 .../composed_disc_type_inconsistent.dart | 0 .../model/composed_disc_type_incorrect.dart | 0 .../lib/src/model/deprecated_object.dart | 0 .../model/disc_missing_from_properties.dart | 0 .../src/model/disc_optional_type_correct.dart | 0 .../model/disc_optional_type_incorrect.dart | 0 .../lib/src/model/disc_type_incorrect.dart | 0 .../json_serializable/lib/src/model/dog.dart | 4 +- .../lib/src/model/entity.dart | 0 .../lib/src/model/entity_ref.dart | 0 .../lib/src/model/enum_arrays.dart | 0 .../lib/src/model/enum_test.dart | 0 .../lib/src/model/extensible.dart | 0 .../lib/src/model/file_schema_test_class.dart | 0 .../json_serializable/lib/src/model/foo.dart | 0 .../model/foo_basic_get_default_response.dart | 0 .../lib/src/model/foo_ref.dart | 0 .../lib/src/model/foo_ref_or_value.dart | 0 .../lib/src/model/format_test.dart | 0 .../lib/src/model/fruit.dart | 0 .../lib/src/model/fruit_all_of_disc.dart | 0 .../lib/src/model/fruit_any_of_disc.dart | 3 +- .../lib/src/model/fruit_grandparent_disc.dart | 0 .../lib/src/model/fruit_inline_disc.dart | 0 .../src/model/fruit_inline_disc_one_of.dart | 0 .../src/model/fruit_inline_disc_one_of1.dart | 0 .../src/model/fruit_inline_inline_disc.dart | 0 .../fruit_inline_inline_disc_one_of.dart | 0 .../fruit_inline_inline_disc_one_of1.dart | 0 ...ruit_inline_inline_disc_one_of_one_of.dart | 0 .../lib/src/model/fruit_one_of_disc.dart | 0 .../lib/src/model/fruit_req_disc.dart | 0 .../lib/src/model/fruit_type.dart | 0 .../lib/src/model/fruit_variant1.dart | 0 .../lib/src/model/giga_one_of.dart | 0 .../lib/src/model/grape_variant1.dart | 0 .../lib/src/model/has_only_read_only.dart | 0 .../lib/src/model/health_check_result.dart | 0 .../lib/src/model/map_test.dart | 0 ...rties_and_additional_properties_class.dart | 0 .../lib/src/model/model200_response.dart | 0 .../lib/src/model/model_client.dart | 0 .../lib/src/model/model_enum_class.dart | 0 .../lib/src/model/model_file.dart | 0 .../lib/src/model/model_list.dart | 0 .../lib/src/model/model_return.dart | 0 .../json_serializable/lib/src/model/name.dart | 0 .../lib/src/model/nullable_class.dart | 0 .../lib/src/model/number_only.dart | 0 .../model/object_with_deprecated_fields.dart | 0 .../lib/src/model/one_of_primitive_child.dart | 0 .../lib/src/model/order.dart | 0 .../lib/src/model/outer_composite.dart | 0 .../lib/src/model/outer_enum.dart | 0 .../src/model/outer_enum_default_value.dart | 0 .../lib/src/model/outer_enum_integer.dart | 0 .../outer_enum_integer_default_value.dart | 0 .../outer_object_with_enum_property.dart | 0 .../lib/src/model/parent.dart | 0 .../lib/src/model/pasta.dart | 0 .../json_serializable/lib/src/model/pet.dart | 0 .../lib/src/model/pizza.dart | 0 .../lib/src/model/pizza_speziale.dart | 0 .../lib/src/model/read_only_first.dart | 0 .../lib/src/model/single_ref_type.dart | 0 .../lib/src/model/special_model_name.dart | 0 .../json_serializable/lib/src/model/tag.dart | 0 .../json_serializable/lib/src/model/user.dart | 0 .../lib/src/repository_base.dart | 9 +- .../lib/src/repository_impl.dart | 350 +++++ .../dio/json_serializable/pom.xml | 0 .../dio/json_serializable/pubspec.yaml | 2 +- .../additional_properties_class_test.dart | 0 .../test/addressable_test.dart | 0 .../test/all_of_with_single_ref_test.dart | 0 .../json_serializable/test/animal_test.dart | 2 +- .../test/another_fake_api_test.dart | 0 .../test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 0 .../test/apple_grandparent_disc_test.dart | 0 .../test/apple_one_of_disc_test.dart | 0 .../test/apple_req_disc_test.dart | 0 .../json_serializable/test/apple_test.dart | 0 .../test/apple_variant1_test.dart | 0 .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 0 .../test/banana_grandparent_disc_test.dart | 0 .../test/banana_one_of_disc_test.dart | 0 .../test/banana_req_disc_test.dart | 0 .../json_serializable/test/banana_test.dart | 0 .../json_serializable/test/bar_api_test.dart | 0 .../test/bar_create_test.dart | 0 .../test/bar_ref_or_value_test.dart | 0 .../json_serializable/test/bar_ref_test.dart | 0 .../dio/json_serializable/test/bar_test.dart | 0 .../test/capitalization_test.dart | 0 .../dio/json_serializable/test/cat_test.dart | 2 +- .../json_serializable/test/category_test.dart | 2 +- .../test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 0 ...posed_disc_optional_type_correct_test.dart | 0 ..._disc_optional_type_inconsistent_test.dart | 0 ...sed_disc_optional_type_incorrect_test.dart | 0 ...posed_disc_required_inconsistent_test.dart | 0 .../composed_disc_type_inconsistent_test.dart | 0 .../composed_disc_type_incorrect_test.dart | 0 .../test/default_api_test.dart | 0 .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 0 .../test/disc_optional_type_correct_test.dart | 0 .../disc_optional_type_incorrect_test.dart | 0 .../test/disc_type_incorrect_test.dart | 0 .../dio/json_serializable/test/dog_test.dart | 2 +- .../test/entity_ref_test.dart | 0 .../json_serializable/test/entity_test.dart | 0 .../test/enum_arrays_test.dart | 0 .../test/enum_test_test.dart | 0 .../test/extensible_test.dart | 0 .../json_serializable/test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../json_serializable/test/foo_api_test.dart | 0 .../foo_basic_get_default_response_test.dart | 0 .../test/foo_ref_or_value_test.dart | 0 .../json_serializable/test/foo_ref_test.dart | 0 .../dio/json_serializable/test/foo_test.dart | 0 .../test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 0 .../test/fruit_any_of_disc_test.dart | 0 .../test/fruit_grandparent_disc_test.dart | 0 .../test/fruit_inline_disc_one_of1_test.dart | 0 .../test/fruit_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_disc_test.dart | 0 ...fruit_inline_inline_disc_one_of1_test.dart | 0 ...inline_inline_disc_one_of_one_of_test.dart | 0 .../fruit_inline_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_inline_disc_test.dart | 0 .../test/fruit_one_of_disc_test.dart | 0 .../test/fruit_req_disc_test.dart | 0 .../json_serializable/test/fruit_test.dart | 0 .../test/fruit_type_test.dart | 0 .../test/fruit_variant1_test.dart | 0 .../test/giga_one_of_test.dart | 0 .../test/grape_variant1_test.dart | 0 .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../json_serializable/test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../test/model_file_test.dart | 0 .../test/model_list_test.dart | 0 .../test/model_return_test.dart | 0 .../dio/json_serializable/test/name_test.dart | 0 .../test/nullable_class_test.dart | 0 .../test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 0 .../test/one_of_primitive_child_test.dart | 0 .../json_serializable/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../json_serializable/test/parent_test.dart | 0 .../json_serializable/test/pasta_test.dart | 0 .../json_serializable/test/pet_api_test.dart | 0 .../dio/json_serializable/test/pet_test.dart | 0 .../test/pizza_speziale_test.dart | 0 .../json_serializable/test/pizza_test.dart | 0 .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../test/store_api_test.dart | 0 .../dio/json_serializable/test/tag_test.dart | 0 .../json_serializable/test/user_api_test.dart | 0 .../dio/json_serializable/test/user_test.dart | 0 website/i18n/en.json | 4 + 864 files changed, 6149 insertions(+), 7344 deletions(-) rename bin/configs/{dart-dio-built_value-v3.yaml => dart-next-dio-built_value-v3.yaml} (68%) rename bin/configs/{dart-dio-json_serializable-v3.yaml => dart-next-dio-json_serializable-v3.yaml} (100%) create mode 100644 docs/generators/dart-next.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java rename modules/openapi-generator/src/main/resources/{dart => dart-next}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/analysis_options.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/api.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/api_doc.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/api_test.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/class.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/dart-keywords.txt (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/enum.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/header.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/lib.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/lib_api_exports.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/lib_model_exports.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/api_client.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/api_doc.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/api_test.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/api_util.mustache (71%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/api_key_auth.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/auth.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/auth_exports.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/basic_auth.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/bearer_auth.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/libraries/dio/auth/oauth.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/model.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/model_test.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/object_doc.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/pubspec.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class.mustache (65%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class_concrete.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class_discriminator.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class_header.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class_members.mustache (94%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/class_serializer.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/date.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/date_serializer.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/deserialize_properties.mustache (96%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/enum.mustache (85%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/enum_inline.mustache (85%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/offset_date_serializer.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/repository_construction.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/repository_impl.mustache (78%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/serializers.mustache (77%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/built_value/test_instance.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/build.yaml.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/class.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/dart_constructor.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/enum.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/enum_inline.mustache (100%) rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/repository_construction.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/json_serializable/test_instance.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache rename modules/openapi-generator/src/main/resources/{dart => dart-next}/serialization/repository_base.mustache (85%) create mode 100644 modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart-next/types/required.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/analysis_options.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache delete mode 100755 modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache delete mode 100644 modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeBigDecimalMap200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fake_big_decimal_map200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_big_decimal_map200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeBigDecimalMap200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fake_big_decimal_map200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_big_decimal_map200_response_test.dart rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/.gitignore (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/.openapi-generator-ignore (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/.openapi-generator/FILES (65%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/.openapi-generator/VERSION (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/README.md (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Addressable.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AllOfWithSingleRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Animal.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AnotherFakeApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ApiResponse.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Apple.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AppleAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AppleGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AppleOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AppleReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/AppleVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ArrayTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Banana.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BananaAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BananaGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BananaOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BananaReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Bar.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BarApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BarCreate.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BarRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/BarRefOrValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Capitalization.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Cat.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Category.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ClassModel.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscMissingFromProperties.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscRequiredInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscTypeInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ComposedDiscTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DefaultApi.md (96%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DeprecatedObject.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DiscMissingFromProperties.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DiscOptionalTypeCorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DiscOptionalTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/DiscTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Dog.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Entity.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/EntityRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/EnumArrays.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/EnumTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Extensible.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FakeApi.md (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FakeClassnameTags123Api.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FileSchemaTestClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Foo.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FooApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FooBasicGetDefaultResponse.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FooRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FooRefOrValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FormatTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Fruit.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitAnyOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineDiscOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineDiscOneOf1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineInlineDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineInlineDiscOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitType.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/FruitVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/GigaOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/GrapeVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/HasOnlyReadOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/HealthCheckResult.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/MapTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Model200Response.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ModelClient.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ModelEnumClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ModelFile.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ModelList.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ModelReturn.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Name.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/NullableClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/NumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ObjectWithDeprecatedFields.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OneOfPrimitiveChild.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Order.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterComposite.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterEnum.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterEnumDefaultValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterEnumInteger.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/OuterObjectWithEnumProperty.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Parent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Pasta.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Pet.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/PetApi.md (98%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Pizza.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/PizzaSpeziale.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/ReadOnlyFirst.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/SingleRefType.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/SpecialModelName.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/StoreApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/Tag.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/User.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/doc/UserApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/apis.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/models.dart (96%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/openapi.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/another_fake_api.dart (73%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/bar_api.dart (60%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/default_api.dart (62%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/fake_api.dart (81%) rename samples/openapi3/client/petstore/{dart-dio/dio/json_serializable => dart-next/dio/built_value}/lib/src/api/fake_classname_tags123_api.dart (77%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/foo_api.dart (64%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/pet_api.dart (56%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/store_api.dart (61%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api/user_api.dart (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api_client.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/api_util.dart (70%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/_exports.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/api_key_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/basic_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/bearer_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/auth/oauth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/date_serializer.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/additional_properties_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/addressable.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/all_of_with_single_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/animal.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/api_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple_all_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/apple_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/array_of_array_of_number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/array_of_number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/array_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/banana.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/banana_all_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/banana_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/banana_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/banana_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/bar.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/bar_create.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/bar_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/bar_ref_or_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/capitalization.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/cat.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/category.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/class_model.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/date.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/deprecated_object.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/disc_missing_from_properties.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/disc_optional_type_correct.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/disc_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/dog.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/entity.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/entity_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/enum_arrays.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/enum_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/extensible.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/file_schema_test_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/foo.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/foo_basic_get_default_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/foo_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/foo_ref_or_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/format_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_all_of_disc.dart (100%) create mode 100644 samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_type.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/fruit_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/giga_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/grape_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/has_only_read_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/health_check_result.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/map_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model200_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model_client.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model_enum_class.dart (95%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model_file.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model_list.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/model_return.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/name.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/nullable_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/object_with_deprecated_fields.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/one_of_primitive_child.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/order.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_composite.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_enum.dart (95%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_enum_default_value.dart (94%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_enum_integer.dart (94%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/outer_object_with_enum_property.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/parent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/pasta.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/pet.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/pizza.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/pizza_speziale.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/read_only_first.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/single_ref_type.dart (94%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/special_model_name.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/tag.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/model/user.dart (100%) rename samples/openapi3/client/petstore/{dart-dio/dio/json_serializable => dart-next/dio/built_value}/lib/src/repository_base.dart (89%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/repository_impl.dart (79%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/lib/src/serializers.dart (76%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/pom.xml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/pubspec.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/addressable_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/all_of_with_single_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/animal_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/another_fake_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/api_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/apple_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/array_of_array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/array_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/banana_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/banana_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/banana_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/banana_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/banana_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/bar_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/bar_create_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/bar_ref_or_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/bar_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/bar_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/capitalization_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/cat_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/category_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/class_model_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_missing_from_properties_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_optional_type_correct_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_required_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_type_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/composed_disc_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/default_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/deprecated_object_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/disc_missing_from_properties_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/disc_optional_type_correct_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/disc_optional_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/disc_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/dog_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/entity_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/entity_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/enum_arrays_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/enum_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/extensible_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fake_classname_tags123_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/file_schema_test_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/foo_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/foo_basic_get_default_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/foo_ref_or_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/foo_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/foo_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/format_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_any_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_disc_one_of1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_disc_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_inline_inline_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_type_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/fruit_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/giga_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/grape_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/has_only_read_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/health_check_result_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/map_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model200_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model_client_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model_enum_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model_file_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model_list_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/model_return_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/name_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/nullable_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/object_with_deprecated_fields_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/one_of_primitive_child_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/order_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_composite_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_enum_default_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_enum_integer_default_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_enum_integer_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_enum_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/outer_object_with_enum_property_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/parent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/pasta_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/pet_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/pizza_speziale_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/pizza_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/read_only_first_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/single_ref_type_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/special_model_name_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/store_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/tag_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/user_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value/test/user_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/.gitignore (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/README.md (77%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/pubspec.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/puby.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/api/authentication_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/api/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/api/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/api/store_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/api_util_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/model/date_serializer_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/built_value_tests/test/model/date_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/.gitignore (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/.openapi-generator-ignore (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/.openapi-generator/FILES (65%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/.openapi-generator/VERSION (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/README.md (99%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/analysis_options.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/build.yaml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Addressable.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AllOfWithSingleRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Animal.md (87%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AnotherFakeApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ApiResponse.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Apple.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AppleAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AppleGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AppleOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AppleReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/AppleVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ArrayOfNumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ArrayTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Banana.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BananaAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BananaGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BananaOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BananaReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Bar.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BarApi.md (97%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BarCreate.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BarRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/BarRefOrValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Capitalization.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Cat.md (88%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Category.md (88%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ClassModel.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DefaultApi.md (96%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DeprecatedObject.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DiscMissingFromProperties.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DiscOptionalTypeCorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/DiscTypeIncorrect.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Dog.md (88%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Entity.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/EntityRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/EnumArrays.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/EnumTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Extensible.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FakeApi.md (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FakeClassnameTags123Api.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FileSchemaTestClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Foo.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FooApi.md (97%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FooBasicGetDefaultResponse.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FooRef.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FooRefOrValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FormatTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Fruit.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitAllOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitAnyOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitGrandparentDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineDiscOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineDiscOneOf1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineInlineDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitOneOfDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitReqDisc.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitType.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/FruitVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/GigaOneOf.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/GrapeVariant1.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/HasOnlyReadOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/HealthCheckResult.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/MapTest.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Model200Response.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ModelClient.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ModelEnumClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ModelFile.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ModelList.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ModelReturn.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Name.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/NullableClass.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/NumberOnly.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ObjectWithDeprecatedFields.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OneOfPrimitiveChild.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Order.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterComposite.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterEnum.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterEnumDefaultValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterEnumInteger.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/OuterObjectWithEnumProperty.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Parent.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Pasta.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Pet.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/PetApi.md (98%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Pizza.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/PizzaSpeziale.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/ReadOnlyFirst.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/SingleRefType.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/SpecialModelName.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/StoreApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/Tag.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/User.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/doc/UserApi.md (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/apis.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/models.dart (96%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/openapi.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/another_fake_api.dart (90%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/bar_api.dart (76%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/default_api.dart (70%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/fake_api.dart (77%) rename samples/openapi3/client/petstore/{dart-dio/dio/built_value => dart-next/dio/json_serializable}/lib/src/api/fake_classname_tags123_api.dart (71%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/foo_api.dart (56%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/pet_api.dart (90%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/store_api.dart (65%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api/user_api.dart (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api_client.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/api_util.dart (70%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/_exports.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/api_key_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/basic_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/bearer_auth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/auth/oauth.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/additional_properties_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/addressable.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/animal.dart (95%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/api_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple_all_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/apple_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/array_of_number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/array_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/banana.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/banana_all_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/banana_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/banana_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/bar.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/bar_create.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/bar_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/bar_ref_or_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/capitalization.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/cat.dart (96%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/category.dart (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/class_model.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/deprecated_object.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/disc_type_incorrect.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/dog.dart (95%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/entity.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/entity_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/enum_arrays.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/enum_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/extensible.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/file_schema_test_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/foo.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/foo_ref.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/foo_ref_or_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/format_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart (88%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_req_disc.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_type.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/fruit_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/giga_one_of.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/grape_variant1.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/has_only_read_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/health_check_result.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/map_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model200_response.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model_client.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model_enum_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model_file.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model_list.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/model_return.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/name.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/nullable_class.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/number_only.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/one_of_primitive_child.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/order.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_composite.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_enum.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_enum_default_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_enum_integer.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/parent.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/pasta.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/pet.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/pizza.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/pizza_speziale.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/read_only_first.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/single_ref_type.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/special_model_name.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/tag.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/lib/src/model/user.dart (100%) rename samples/openapi3/client/petstore/{dart-dio/dio/built_value => dart-next/dio/json_serializable}/lib/src/repository_base.dart (89%) create mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/pom.xml (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/pubspec.yaml (93%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/addressable_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/all_of_with_single_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/animal_test.dart (89%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/another_fake_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/api_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/apple_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/array_of_array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/array_of_number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/array_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/banana_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/banana_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/banana_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/banana_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/banana_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/bar_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/bar_create_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/bar_ref_or_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/bar_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/bar_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/capitalization_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/cat_test.dart (90%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/category_test.dart (87%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/class_model_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/composed_disc_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/default_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/deprecated_object_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/disc_missing_from_properties_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/disc_optional_type_correct_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/disc_optional_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/disc_type_incorrect_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/dog_test.dart (90%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/entity_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/entity_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/enum_arrays_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/enum_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/extensible_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fake_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fake_classname_tags123_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/file_schema_test_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/foo_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/foo_basic_get_default_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/foo_ref_or_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/foo_ref_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/foo_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/format_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_all_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_any_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_grandparent_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_inline_inline_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_one_of_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_req_disc_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_type_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/fruit_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/giga_one_of_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/grape_variant1_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/has_only_read_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/health_check_result_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/map_test_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model200_response_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model_client_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model_enum_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model_file_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model_list_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/model_return_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/name_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/nullable_class_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/number_only_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/object_with_deprecated_fields_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/one_of_primitive_child_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/order_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_composite_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_enum_default_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_enum_integer_default_value_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_enum_integer_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_enum_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/outer_object_with_enum_property_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/parent_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/pasta_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/pet_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/pet_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/pizza_speziale_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/pizza_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/read_only_first_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/single_ref_type_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/special_model_name_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/store_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/tag_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/user_api_test.dart (100%) rename samples/openapi3/client/petstore/{dart-dio => dart-next}/dio/json_serializable/test/user_test.dart (100%) diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 4d9f501e1446..4b271407fa5e 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -151,6 +151,12 @@ "Client: Dart" ] }, + { + "input": "dart-next-petstore.sh", + "matches": [ + "Client: Dart" + ] + }, { "input": "dart-petstore.sh", "matches": [ diff --git a/bin/configs/dart-dio-built_value-v3.yaml b/bin/configs/dart-next-dio-built_value-v3.yaml similarity index 68% rename from bin/configs/dart-dio-built_value-v3.yaml rename to bin/configs/dart-next-dio-built_value-v3.yaml index b68fe1267488..6b7a8bbc6755 100644 --- a/bin/configs/dart-dio-built_value-v3.yaml +++ b/bin/configs/dart-next-dio-built_value-v3.yaml @@ -1,7 +1,7 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/dio/built_value +generatorName: dart-next +outputDir: samples/openapi3/client/petstore/dart-next/dio/built_value inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml -templateDir: modules/openapi-generator/src/main/resources/dart +templateDir: modules/openapi-generator/src/main/resources/dart-next typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/bin/configs/dart-dio-json_serializable-v3.yaml b/bin/configs/dart-next-dio-json_serializable-v3.yaml similarity index 100% rename from bin/configs/dart-dio-json_serializable-v3.yaml rename to bin/configs/dart-next-dio-json_serializable-v3.yaml diff --git a/docs/generators.md b/docs/generators.md index af92241c4842..33e322d81496 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -21,6 +21,7 @@ The following generators are available: * [csharp-netcore](generators/csharp-netcore.md) * [dart](generators/dart.md) * [dart-dio](generators/dart-dio.md) +* [dart-next](generators/dart-next.md) * [eiffel](generators/eiffel.md) * [elixir](generators/elixir.md) * [elm](generators/elm.md) diff --git a/docs/generators/README.md b/docs/generators/README.md index 648de9673e73..44da3d748762 100644 --- a/docs/generators/README.md +++ b/docs/generators/README.md @@ -15,6 +15,7 @@ The following generators are available: * [csharp-netcore](csharp-netcore.md) * [dart](dart.md) * [dart-dio](dart-dio.md) +* [dart-next](dart-next.md) * [eiffel](eiffel.md) * [elixir](elixir.md) * [elm](elm.md) diff --git a/docs/generators/dart-next.md b/docs/generators/dart-next.md new file mode 100644 index 000000000000..34a93fc164f7 --- /dev/null +++ b/docs/generators/dart-next.md @@ -0,0 +1,256 @@ +--- +title: Documentation for the dart-next Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dart-next | pass this to the generate command after -g | +| generator stability | STABLE | | +| generator type | CLIENT | | +| generator language | Dart | | +| generator default templating engine | mustache | | +| helpTxt | Generates a Dart client library. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|dateLibrary|Specify Date library|
**core**
[DEFAULT] Dart core library (DateTime)
**timemachine**
Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
|core| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|pubAuthor|Author name in generated pubspec| |Author| +|pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage| +|pubDescription|Description in generated pubspec| |OpenAPI API client| +|pubHomepage|Homepage in generated pubspec| |homepage| +|pubLibrary|Library name in generated code| |openapi.api| +|pubName|Name in generated pubspec| |openapi| +|pubPublishTo|Publish_to in generated pubspec| |null| +|pubRepository|Repository in generated pubspec| |null| +|pubVersion|Version in generated pubspec| |1.0.0| +|serializationLibrary|Specify serialization library|
**built_value**
[DEFAULT] built_value
**json_serializable**
[BETA] json_serializable
|built_value| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src| +|useEnumExtension|Allow the 'x-enum-values' extension for enums| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | + + +## LANGUAGE PRIMITIVES + +
    +
  • String
  • +
  • bool
  • +
  • double
  • +
  • int
  • +
  • num
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • as
  • +
  • assert
  • +
  • async
  • +
  • await
  • +
  • break
  • +
  • case
  • +
  • catch
  • +
  • class
  • +
  • const
  • +
  • continue
  • +
  • covariant
  • +
  • default
  • +
  • deferred
  • +
  • do
  • +
  • dynamic
  • +
  • else
  • +
  • enum
  • +
  • export
  • +
  • extends
  • +
  • extension
  • +
  • external
  • +
  • factory
  • +
  • false
  • +
  • final
  • +
  • finally
  • +
  • for
  • +
  • function
  • +
  • get
  • +
  • hide
  • +
  • if
  • +
  • implements
  • +
  • import
  • +
  • in
  • +
  • inout
  • +
  • interface
  • +
  • is
  • +
  • late
  • +
  • library
  • +
  • mixin
  • +
  • native
  • +
  • new
  • +
  • null
  • +
  • of
  • +
  • on
  • +
  • operator
  • +
  • out
  • +
  • part
  • +
  • patch
  • +
  • required
  • +
  • rethrow
  • +
  • return
  • +
  • set
  • +
  • show
  • +
  • source
  • +
  • static
  • +
  • super
  • +
  • switch
  • +
  • sync
  • +
  • this
  • +
  • throw
  • +
  • true
  • +
  • try
  • +
  • typedef
  • +
  • var
  • +
  • void
  • +
  • while
  • +
  • with
  • +
  • yield
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✓|ToolingExtension +|UserAgent|✓|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✓|OAS3 +|allOf|✓|OAS2,OAS3 +|anyOf|✓|OAS3 +|oneOf|✓|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 +|SignatureAuth|✗|OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 51a8b4bdeae8..91798df50af8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -500,7 +500,7 @@ public String toDefaultValue(Schema schema) { return null; } if (ModelUtils.isStringSchema(schema)) { - return "'" + schema.getDefault().toString().replace("'", "\\'") + "'"; + return "r'" + schema.getDefault().toString().replace("'", "\\'") + "'"; } return schema.getDefault().toString(); } @@ -602,35 +602,6 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) { return property; } - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { - final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - for (CodegenResponse r : op.responses) { - // By default, only set types are automatically added to operation imports, not sure why. - // Add all container type imports here, by default 'dart:core' imports are skipped - // but other sub-classes may require specific container type imports. - if (r.containerType != null && typeMapping().containsKey(r.containerType)) { - final String value = typeMapping().get(r.containerType); - if (needToImport(value)) { - op.imports.add(value); - } - } - } - for (CodegenParameter p : op.allParams) { - if (p.isContainer) { - final String type = p.isArray ? "array" : "map"; - if (typeMapping().containsKey(type)) { - final String value = typeMapping().get(type); - // Also add container imports for parameters. - if (needToImport(value)) { - op.imports.add(value); - } - } - } - } - return op; - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { super.postProcessOperationsWithModels(objs, allModels); @@ -733,7 +704,7 @@ public String toEnumValue(String value, String datatype) { "int".equalsIgnoreCase(datatype)) { return value; } else { - return "'" + escapeText(value) + "'"; + return "r'" + escapeText(value) + "'"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 40edd69ed377..fa52316dd11d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -19,11 +19,18 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenResponse; import org.openapitools.codegen.SupportingFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.servers.Server; + import java.util.HashMap; +import java.util.List; import java.util.Map; public class DartClientCodegen extends AbstractDartCodegen { @@ -47,6 +54,35 @@ public DartClientCodegen() { sourceFolder = ""; } + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { + final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + for (CodegenResponse r : op.responses) { + // By default, only set types are automatically added to operation imports, not sure why. + // Add all container type imports here, by default 'dart:core' imports are skipped + // but other sub-classes may require specific container type imports. + if (r.containerType != null && typeMapping().containsKey(r.containerType)) { + final String value = typeMapping().get(r.containerType); + if (needToImport(value)) { + op.imports.add(value); + } + } + } + for (CodegenParameter p : op.allParams) { + if (p.isContainer) { + final String type = p.isArray ? "array" : "map"; + if (typeMapping().containsKey(type)) { + final String value = typeMapping().get(type); + // Also add container imports for parameters. + if (needToImport(value)) { + op.imports.add(value); + } + } + } + } + return op; + } + @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index d998caa13a8b..588b82b84c08 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -16,16 +16,33 @@ package org.openapitools.codegen.languages; -import com.google.common.collect.Sets; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Discriminator; -import io.swagger.v3.oas.models.media.Schema; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenDiscriminator; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.TemplateManager; import org.openapitools.codegen.api.TemplatePathLocator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -45,13 +62,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.sql.Array; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; +import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; -import static org.openapitools.codegen.utils.StringUtils.underscore; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Discriminator; +import io.swagger.v3.oas.models.media.Schema; public class DartDioClientCodegen extends AbstractDartCodegen { @@ -423,6 +440,9 @@ private void configureDateLibrary(String srcFolder) { @Override public String toDefaultValue(Schema schema) { if (schema.getDefault() != null) { + if (schema.getEnum() != null) { + return super.toDefaultValue(schema); + } if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { if (ModelUtils.isArraySchema(schema)) { if (ModelUtils.isSet(schema)) { @@ -434,6 +454,7 @@ public String toDefaultValue(Schema schema) { return "MapBuilder()"; } } + if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) { // this is currently not supported and would create compile errors return null; @@ -446,6 +467,48 @@ public String toDefaultValue(Schema schema) { return null; } + @Override + public String toDefaultParameterValue(Schema schema) { + var result = super.toDefaultParameterValue(schema); + return result; + } + + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + super.updateCodegenPropertyEnum(var); + var enumName = var.getEnumName(); + if (enumName != null) { + if (var.defaultValue != null) { + var allowable = var.getAllowableValues(); + if (allowable != null) { + var matchingMap = (ArrayList) allowable.get("enumVars"); + String matchingName = null; + for (Object enumMember : matchingMap) { + if (!(enumMember instanceof HashMap)) { + continue; + } + var castedEnumMember = (HashMap) enumMember; + var name = (String) castedEnumMember.get("name"); + var value = castedEnumMember.get("value"); + if (value.equals(var.defaultValue)) { + matchingName = name; + break; + } + } + if (matchingName != null) { + var newDefaultValue = enumName + "." + matchingName; + var oldDefaultValue = var.getDefaultValue(); + LOGGER.info("Modifying enum {} with default value {} to {}", enumName, oldDefaultValue, + newDefaultValue); + var.setDefaultValue(newDefaultValue); + } + } + + } + } + } + + @Override public ModelsMap postProcessModels(ModelsMap objs) { objs = super.postProcessModels(objs); @@ -483,6 +546,16 @@ private void syncRootTypesWithInnerVars(Map objs) { } } + @Override + public CodegenProperty fromProperty(String name, Schema p, boolean required, + boolean schemaIsFromAdditionalProperties) { + CodegenProperty result = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties); + if (result.containerType != null && typeMapping.containsKey(result.containerType)) { + result.containerType = typeMapping.get(result.containerType); + } + return result; + } + private void syncRootTypesWithInnerVars(Map objs, CodegenModel model) { List allVars = new ArrayList<>(); allVars.addAll(((Collection) model.vendorExtensions.get(kSelfAndAncestorOnlyProps))); @@ -719,23 +792,12 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // that need a custom serializer builder factory added. final CodegenProperty items = property.items; if (items.getAdditionalProperties() != null) { - addBuiltValueSerializer(new BuiltValueSerializer( - items.isArray, - items.getUniqueItems(), - items.isMap, - items.items.isNullable, - items.getAdditionalProperties().dataType)); + addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(items)); } } } } - private void preferSchemaBaseType(CodegenParameter param) { - if (param.baseType != null && param.getSchema() != null && !param.baseType.equals(param.getSchema().baseType)) { - param.baseType = param.getSchema().baseType; - } - } - @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { super.postProcessOperationsWithModels(objs, allModels); @@ -747,10 +809,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List rewriteImports(Set originalImports, boolean isModel) } static class BuiltValueSerializer { - + final String containerType; + final boolean isContainer; final boolean isArray; - final boolean uniqueItems; - final boolean isMap; - + final BuiltValueSerializer items; final boolean isNullable; + final String datatypeWithEnum; final String dataType; - private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, - String dataType) { + public static BuiltValueSerializer fromCodegenParameter(CodegenParameter parameter) { + if (parameter == null) { + return null; + } + return new BuiltValueSerializer(parameter.isArray, parameter.getUniqueItems(), parameter.getIsMap(), + /// Recursion to handle subtypes + fromCodegenProperty(parameter.items), + parameter.isNullable, parameter.datatypeWithEnum, parameter.dataType, parameter.containerType, + parameter.isContainer); + } + + public static BuiltValueSerializer fromCodegenProperty(CodegenProperty property) { + if (property == null) { + return null; + } + return new BuiltValueSerializer(property.isArray, property.getUniqueItems(), property.getIsMap(), + /// Recursion to handle subtypes + fromCodegenProperty(property.items), + property.isNullable, property.datatypeWithEnum, property.dataType, property.containerType, + property.isContainer); + } + + private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, BuiltValueSerializer items, + boolean isNullable, String datatypeWithEnum, String dataType, String containerType, + boolean isContainer) { this.isArray = isArray; this.uniqueItems = uniqueItems; this.isMap = isMap; + this.items = items; this.isNullable = isNullable; + this.datatypeWithEnum = datatypeWithEnum; this.dataType = dataType; + this.containerType = containerType; + this.isContainer = isContainer; + } + + public boolean isContainer() { + return isContainer; } public boolean isArray() { @@ -902,28 +981,67 @@ public boolean isMap() { return isMap; } + public BuiltValueSerializer getItems() { + return items; + } + public boolean isNullable() { return isNullable; } + public String getDatatypeWithEnum() { + return datatypeWithEnum; + } + + public String getContainerType() { + return containerType; + } + public String getDataType() { return dataType; } @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - BuiltValueSerializer that = (BuiltValueSerializer) o; - return isArray == that.isArray && uniqueItems == that.uniqueItems && isMap == that.isMap - && isNullable == that.isNullable && dataType.equals(that.dataType); + public int hashCode() { + return Objects.hash(isContainer, isArray, uniqueItems, isMap, items, isNullable, datatypeWithEnum, + dataType); } @Override - public int hashCode() { - return Objects.hash(isArray, uniqueItems, isMap, isNullable, dataType); + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + BuiltValueSerializer other = (BuiltValueSerializer) obj; + if (isContainer != other.isContainer) + return false; + if (isArray != other.isArray) + return false; + if (uniqueItems != other.uniqueItems) + return false; + if (isMap != other.isMap) + return false; + if (items == null) { + if (other.items != null) + return false; + } else if (!items.equals(other.items)) + return false; + if (isNullable != other.isNullable) + return false; + if (datatypeWithEnum == null) { + if (other.datatypeWithEnum != null) + return false; + } else if (!datatypeWithEnum.equals(other.datatypeWithEnum)) + return false; + if (dataType == null) { + if (other.dataType != null) + return false; + } else if (!dataType.equals(other.dataType)) + return false; + return true; } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java new file mode 100644 index 000000000000..b2c1239ca470 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java @@ -0,0 +1,845 @@ +package org.openapitools.codegen.languages; + +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.escape; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.GeneratorLanguage; +import org.openapitools.codegen.meta.features.ClientModificationFeature; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.meta.features.ParameterFeature; +import org.openapitools.codegen.meta.features.SchemaSupportFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.meta.features.WireFormatFeature; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.model.OperationMap; +import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.Sets; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; + +public abstract class DartNextAbstractCodegen extends DefaultCodegen { + + private final Logger LOGGER = LoggerFactory.getLogger(AbstractDartCodegen.class); + + protected static final List DEFAULT_SUPPORTED_CONTENT_TYPES = Arrays.asList( + "application/json", "application/x-www-form-urlencoded", "multipart/form-data"); + + public static final String PUB_LIBRARY = "pubLibrary"; + public static final String PUB_NAME = "pubName"; + public static final String PUB_VERSION = "pubVersion"; + public static final String PUB_DESCRIPTION = "pubDescription"; + public static final String PUB_AUTHOR = "pubAuthor"; + public static final String PUB_AUTHOR_EMAIL = "pubAuthorEmail"; + public static final String PUB_HOMEPAGE = "pubHomepage"; + public static final String PUB_REPOSITORY = "pubRepository"; + public static final String PUB_PUBLISH_TO = "pubPublishTo"; + public static final String USE_ENUM_EXTENSION = "useEnumExtension"; + + protected String pubLibrary = "openapi.api"; + protected String pubName = "openapi"; + protected String pubVersion = "1.0.0"; + protected String pubDescription = "OpenAPI API client"; + protected String pubAuthor = "Author"; + protected String pubAuthorEmail = "author@homepage"; + protected String pubHomepage = "homepage"; + protected String pubRepository = null; + protected String pubPublishTo = null; + protected boolean useEnumExtension = false; + protected String sourceFolder = "src"; + protected String libPath = "lib" + File.separator; + protected String apiDocPath = "doc" + File.separator; + protected String modelDocPath = "doc" + File.separator; + protected String apiTestPath = "test" + File.separator; + protected String modelTestPath = "test" + File.separator; + + protected Map imports = new HashMap<>(); + + public DartNextAbstractCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .securityFeatures(EnumSet.of( + SecurityFeature.OAuth2_Implicit, + SecurityFeature.BasicAuth, + SecurityFeature.BearerToken, + SecurityFeature.ApiKey + )) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .excludeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.Union, + SchemaSupportFeature.Composite + ) + .includeParameterFeatures( + ParameterFeature.Cookie + ) + .includeClientModificationFeatures( + ClientModificationFeature.BasePath + ) + .excludeWireFormatFeatures( + WireFormatFeature.XML + ) + ); + + outputFolder = "generated-code/dart"; + modelTemplateFiles.put("model.mustache", ".dart"); + apiTemplateFiles.put("api.mustache", ".dart"); + embeddedTemplateDir = templateDir = "dart2"; + apiPackage = "api"; + modelPackage = "model"; + modelDocTemplateFiles.put("object_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + + modelTestTemplateFiles.put("model_test.mustache", ".dart"); + apiTestTemplateFiles.put("api_test.mustache", ".dart"); + + final List reservedWordsList = new ArrayList<>(); + try (BufferedReader reader = new BufferedReader( + new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"), + StandardCharsets.UTF_8))) { + while (reader.ready()) { + reservedWordsList.add(reader.readLine()); + } + } catch (Exception e) { + LOGGER.error("Error reading dart keywords. Exception: {}", e.getMessage()); + } + setReservedWordsLowerCase(reservedWordsList); + + // These types return isPrimitive=true in templates + languageSpecificPrimitives = Sets.newHashSet( + "String", + "bool", + "int", + "num", + "double" + ); + + typeMapping = new HashMap<>(); + typeMapping.put("Array", "List"); + typeMapping.put("array", "List"); + typeMapping.put("map", "Map"); + typeMapping.put("List", "List"); + typeMapping.put("set", "Set"); + typeMapping.put("boolean", "bool"); + typeMapping.put("string", "String"); + typeMapping.put("char", "String"); + typeMapping.put("int", "int"); + typeMapping.put("long", "int"); + typeMapping.put("short", "int"); + typeMapping.put("number", "num"); + typeMapping.put("float", "double"); + typeMapping.put("double", "double"); + typeMapping.put("decimal", "double"); + typeMapping.put("integer", "int"); + typeMapping.put("Date", "DateTime"); + typeMapping.put("date", "DateTime"); + typeMapping.put("DateTime", "DateTime"); + typeMapping.put("file", "MultipartFile"); + typeMapping.put("binary", "MultipartFile"); + typeMapping.put("UUID", "String"); + typeMapping.put("URI", "String"); + typeMapping.put("ByteArray", "String"); + typeMapping.put("object", "Object"); + typeMapping.put("AnyType", "Object"); + + // Data types of the above values which are automatically imported + defaultIncludes = Sets.newHashSet( + "String", + "bool", + "int", + "num", + "double", + "List", + "Set", + "Map", + "DateTime", + "Object" + ); + + imports.put("String", "dart:core"); + imports.put("bool", "dart:core"); + imports.put("int", "dart:core"); + imports.put("num", "dart:core"); + imports.put("double", "dart:core"); + imports.put("List", "dart:core"); + imports.put("Set", "dart:core"); + imports.put("Map", "dart:core"); + imports.put("DateTime", "dart:core"); + imports.put("Object", "dart:core"); + imports.put("MultipartFile", "package:http/http.dart"); + + addOption(PUB_LIBRARY, "Library name in generated code", pubLibrary); + addOption(PUB_NAME, "Name in generated pubspec", pubName); + addOption(PUB_VERSION, "Version in generated pubspec", pubVersion); + addOption(PUB_DESCRIPTION, "Description in generated pubspec", pubDescription); + addOption(PUB_AUTHOR, "Author name in generated pubspec", pubAuthor); + addOption(PUB_AUTHOR_EMAIL, "Email address of the author in generated pubspec", pubAuthorEmail); + addOption(PUB_HOMEPAGE, "Homepage in generated pubspec", pubHomepage); + addOption(PUB_REPOSITORY, "Repository in generated pubspec", pubRepository); + addOption(PUB_PUBLISH_TO, "Publish_to in generated pubspec", pubPublishTo); + addOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums", String.valueOf(useEnumExtension)); + addOption(CodegenConstants.SOURCE_FOLDER, CodegenConstants.SOURCE_FOLDER_DESC, sourceFolder); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "dart"; + } + + @Override + public String getHelp() { + return "Generates a Dart 2.x client library."; + } + + @Override + public void processOpts() { + super.processOpts(); + + // Fix a couple Java notation properties + modelPackage = modelPackage.replace('.', '/'); + apiPackage = apiPackage.replace('.', '/'); + // And overwrite them in the additional properties + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + + if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + if (additionalProperties.containsKey(PUB_NAME)) { + this.setPubName((String) additionalProperties.get(PUB_NAME)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_NAME, pubName); + } + + if (additionalProperties.containsKey(PUB_LIBRARY)) { + this.setPubLibrary((String) additionalProperties.get(PUB_LIBRARY)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_LIBRARY, pubLibrary); + } + + if (additionalProperties.containsKey(PUB_VERSION)) { + this.setPubVersion((String) additionalProperties.get(PUB_VERSION)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_VERSION, pubVersion); + } + + if (additionalProperties.containsKey(PUB_DESCRIPTION)) { + this.setPubDescription((String) additionalProperties.get(PUB_DESCRIPTION)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_DESCRIPTION, pubDescription); + } + + if (additionalProperties.containsKey(PUB_AUTHOR)) { + this.setPubAuthor((String) additionalProperties.get(PUB_AUTHOR)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_AUTHOR, pubAuthor); + } + + if (additionalProperties.containsKey(PUB_AUTHOR_EMAIL)) { + this.setPubAuthorEmail((String) additionalProperties.get(PUB_AUTHOR_EMAIL)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_AUTHOR_EMAIL, pubAuthorEmail); + } + + if (additionalProperties.containsKey(PUB_HOMEPAGE)) { + this.setPubHomepage((String) additionalProperties.get(PUB_HOMEPAGE)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_HOMEPAGE, pubHomepage); + } + + if (additionalProperties.containsKey(PUB_REPOSITORY)) { + this.setPubRepository((String) additionalProperties.get(PUB_REPOSITORY)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_REPOSITORY, pubRepository); + } + + if (additionalProperties.containsKey(PUB_PUBLISH_TO)) { + this.setPubPublishTo((String) additionalProperties.get(PUB_PUBLISH_TO)); + } else { + //not set, use to be passed to template + additionalProperties.put(PUB_PUBLISH_TO, pubPublishTo); + } + + if (additionalProperties.containsKey(USE_ENUM_EXTENSION)) { + this.setUseEnumExtension(convertPropertyToBooleanAndWriteBack(USE_ENUM_EXTENSION)); + } else { + // Not set, use to be passed to template. + additionalProperties.put(USE_ENUM_EXTENSION, useEnumExtension); + } + + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { + String srcFolder = (String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER); + this.setSourceFolder(srcFolder.replace('/', File.separatorChar)); + } + additionalProperties.put(CodegenConstants.SOURCE_FOLDER, sourceFolder); + + // make api and model doc path available in mustache template + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + // check to not overwrite a custom templateDir + if (templateDir == null) { + embeddedTemplateDir = templateDir = "dart2"; + } + } + + @Override + protected boolean needToImport(String type) { + // Import everything, unless it is from dart:core. + return StringUtils.isNotBlank(type) && (!imports.containsKey(type) || !imports.get(type).equals("dart:core")); + } + + @Override + protected boolean isReservedWord(String word) { + // consider everything as reserved that is + // * a keyword + // * a word that has been mapped in the reservedWordsMappings + // * a default included type or a type include through some library + return super.isReservedWord(word) || reservedWordsMappings().containsKey(word) || defaultIncludes().contains(word); + } + + @Override + public String escapeReservedWord(String name) { + if (reservedWordsMappings().containsKey(name)) { + return reservedWordsMappings().get(name); + } + return name + "_"; + } + + @Override + public String apiFileFolder() { + return (outputFolder + File.separator + libPath + sourceFolder + File.separator + apiPackage()).replace('/', File.separatorChar); + } + + @Override + public String modelFileFolder() { + return (outputFolder + File.separator + libPath + sourceFolder + File.separator + modelPackage()).replace('/', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + apiTestPath; + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + modelTestPath; + } + + @Override + public String apiDocFileFolder() { + return outputFolder + File.separator + apiDocPath; + } + + @Override + public String modelDocFileFolder() { + return outputFolder + File.separator + modelDocPath; + } + + @Override + public String toVarName(String name) { + // replace - with _ e.g. created-at => created_at + name = name.replace("-", "_"); + + // always need to replace leading underscores first + name = name.replaceAll("^_", ""); + + // if it's all upper case, do nothing + if (name.matches("^[A-Z_]*$")) { + return name; + } + + // replace all characters that have a mapping but ignore underscores + // append an underscore to each replacement so that it can be camelized + if (name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character)))) { + name = escape(name, specialCharReplacements, Collections.singletonList("_"), "_"); + } + // remove the rest + name = sanitizeName(name); + + // camelize (lower first character) the variable name + // pet_id => petId + name = camelize(name, LOWERCASE_FIRST_LETTER); + + if (name.matches("^\\d.*")) { + name = "n" + name; + } + + if (isReservedWord(name)) { + name = escapeReservedWord(name); + } + + return name; + } + + @Override + public String toParamName(String name) { + // should be the same as variable name + return toVarName(name); + } + + @Override + public String toModelName(final String name) { + String sanitizedName = sanitizeName(name); + + if (!StringUtils.isEmpty(modelNamePrefix)) { + // add '_' so that model name can be camelized correctly + sanitizedName = modelNamePrefix + "_" + sanitizedName; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + // add '_' so that model name can be camelized correctly + sanitizedName = sanitizedName + "_" + modelNameSuffix; + } + + // camelize the model name + // phone_number => PhoneNumber + final String camelizedName = camelize(sanitizedName); + + // Check if there is a mapping that can be used + if (typeMapping().containsKey(camelizedName)) { + String typeName = typeMapping().get(camelizedName); + if (imports.containsKey(typeName)) { + // Anything with an import mapping is likely + // generator specific and can not be used as model name. + final String modelName = "Model" + camelizedName; + LOGGER.warn("{} (existing type) cannot be used as model name. Renamed to {}", camelizedName, modelName); + return modelName; + } + return typeName; + } + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + final String modelName = "Model" + camelizedName; + LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", camelizedName, modelName); + return modelName; + } + + // model name starts with number + if (camelizedName.matches("^\\d.*")) { + final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize) + LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, modelName); + return modelName; + } + + return camelizedName; + } + + @Override + public String toModelFilename(String name) { + return underscore(toModelName(name)); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiFilename(String name) { + return underscore(toApiName(name)); + } + + @Override + public String toApiTestFilename(String name) { + return toApiFilename(name) + "_test"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelFilename(name) + "_test"; + } + + @Override + public String toDefaultValue(Schema schema) { + if (ModelUtils.isMapSchema(schema) || ModelUtils.isSet(schema)) { + return "const {}"; + } + if (ModelUtils.isArraySchema(schema)) { + return "const []"; + } + + if (schema.getDefault() != null) { + if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) { + // this is currently not supported and would create compile errors + return null; + } + if (ModelUtils.isStringSchema(schema)) { + return "r'" + schema.getDefault().toString().replace("'", "\\'") + "'"; + } + return schema.getDefault().toString(); + } + return null; + } + + @Override + public String getTypeDeclaration(Schema p) { + Schema schema = unaliasSchema(p); + Schema target = ModelUtils.isGenerateAliasAsModel() ? p : schema; + if (ModelUtils.isArraySchema(target)) { + Schema items = getSchemaItems((ArraySchema) schema); + return getSchemaType(target) + "<" + getTypeDeclaration(items) + ">"; + } + if (ModelUtils.isMapSchema(target)) { + // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines + // additionalproperties: true + Schema inner = getAdditionalProperties(target); + if (inner == null) { + LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", p.getName()); + inner = new StringSchema().description("TODO default missing map inner type to string"); + p.setAdditionalProperties(inner); + } + return getSchemaType(target) + ""; + } + return super.getTypeDeclaration(p); + } + + @Override + public String getSchemaType(Schema p) { + String openAPIType = super.getSchemaType(p); + if (openAPIType == null) { + LOGGER.error("No Type defined for Schema {}", p); + } + if (typeMapping().containsKey(openAPIType)) { + return typeMapping().get(openAPIType); + } + return toModelName(openAPIType); + } + + @Override + public ModelsMap postProcessModels(ModelsMap objs) { + return postProcessModelsEnum(objs); + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + if (!model.isEnum && property.isEnum && property.getComposedSchemas() == null) { + // These are inner enums, enums which do not exist as models, just as properties. + // They are handled via the enum_inline template and are generated in the + // same file as the containing class. To prevent name clashes the inline enum classes + // are prefix with the classname of the containing class in the template. + // Here the datatypeWithEnum template variable gets updated to match that scheme. + // Also taking into account potential collection types e.g. List -> List + final String enumName = model.classname + property.enumName; + if (property.items != null) { + // inner items e.g. enums in collections, only works for one level + // but same is the case for DefaultCodegen + property.setDatatypeWithEnum(property.datatypeWithEnum.replace(property.items.datatypeWithEnum, enumName)); + property.items.setDatatypeWithEnum(enumName); + property.items.setEnumName(enumName); + } else { + // plain enum property + property.setDatatypeWithEnum(property.datatypeWithEnum.replace(property.enumName, enumName)); + } + property.setEnumName(enumName); + } + } + + @Override + public CodegenProperty fromProperty(String name, Schema p, boolean required) { + final CodegenProperty property = super.fromProperty(name, p, required); + + // Handle composed properties and it's NOT allOf with a single ref only + if (ModelUtils.isComposedSchema(p) && !(ModelUtils.isAllOf(p) && p.getAllOf().size() == 1)) { + ComposedSchema composed = (ComposedSchema) p; + + // Count the occurrences of allOf/anyOf/oneOf with exactly one child element + long count = Stream.of(composed.getAllOf(), composed.getAnyOf(), composed.getOneOf()) + .filter(list -> list != null && list.size() == 1).count(); + + if (count == 1) { + // Continue only if there is one element that matches + // and basically treat it as simple property. + Stream.of(composed.getAllOf(), composed.getAnyOf(), composed.getOneOf()) + .filter(list -> list != null && list.size() == 1) + .findFirst() + .map(list -> list.get(0).get$ref()) + .map(ModelUtils::getSimpleRef) + .map(ref -> ModelUtils.getSchemas(this.openAPI).get(ref)) + .ifPresent(schema -> { + property.isEnum = schema.getEnum() != null; + property.isModel = true; + }); + + } + } + return property; + } + + @Override + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + super.postProcessOperationsWithModels(objs, allModels); + OperationMap operations = objs.getOperations(); + if (operations != null) { + List ops = operations.getOperation(); + for (CodegenOperation op : ops) { + if (op.hasConsumes) { + if (!op.formParams.isEmpty() || op.isMultipart) { + // DefaultCodegen only sets this if the first consumes mediaType + // is application/x-www-form-urlencoded or multipart. + // Can just use the original + op.prioritizedContentTypes = op.consumes; + } else { + // Prioritize content types by moving application/json to the front + // similar to JavaCodegen + op.prioritizedContentTypes = prioritizeContentTypes(op.consumes); + String mediaType = op.prioritizedContentTypes.get(0).get("mediaType"); + if (!DEFAULT_SUPPORTED_CONTENT_TYPES.contains(mediaType)) { + LOGGER.warn("The media-type '{}' for operation '{}' is not support in the Dart generators by default.", mediaType, op.path); + } + } + } + } + } + return objs; + } + + private List> prioritizeContentTypes(List> consumes) { + if (consumes.size() <= 1) { + // no need to change any order + return consumes; + } + + List> prioritizedContentTypes = new ArrayList<>(consumes.size()); + + List> jsonVendorMimeTypes = new ArrayList<>(consumes.size()); + List> jsonMimeTypes = new ArrayList<>(consumes.size()); + + for (Map consume : consumes) { + String mediaType = consume.get("mediaType"); + if (isJsonVendorMimeType(mediaType)) { + jsonVendorMimeTypes.add(consume); + } else if (isJsonMimeType(mediaType)) { + jsonMimeTypes.add(consume); + } else { + prioritizedContentTypes.add(consume); + } + } + + prioritizedContentTypes.addAll(0, jsonMimeTypes); + prioritizedContentTypes.addAll(0, jsonVendorMimeTypes); + return prioritizedContentTypes; + } + + @Override + protected void updateEnumVarsWithExtensions(List> enumVars, Map vendorExtensions, String dataType) { + if (vendorExtensions != null && useEnumExtension && vendorExtensions.containsKey("x-enum-values")) { + // Use the x-enum-values extension for this enum + // Existing enumVars added by the default handling need to be removed first + enumVars.clear(); + + Object extension = vendorExtensions.get("x-enum-values"); + List> values = (List>) extension; + for (Map value : values) { + Map enumVar = new HashMap<>(); + enumVar.put("name", toEnumVarName((String) value.get("identifier"), dataType)); + enumVar.put("value", toEnumValue(value.get("numericValue").toString(), dataType)); + enumVar.put("isString", isDataTypeString(dataType)); + if (value.containsKey("description")) { + enumVar.put("description", value.get("description").toString()); + } + enumVars.add(enumVar); + } + } else { + super.updateEnumVarsWithExtensions(enumVars, vendorExtensions, dataType); + } + } + + @Override + public String toEnumVarName(String value, String datatype) { + if (value.length() == 0) { + return "empty"; + } + if (("number".equalsIgnoreCase(datatype) || + "double".equalsIgnoreCase(datatype) || + "int".equalsIgnoreCase(datatype)) && + value.matches("^-?\\d.*")) { + // Only rename numeric values when the datatype is numeric + // AND the name is not changed by enum extensions (matches a numeric value). + boolean isNegative = value.startsWith("-"); + return toVarName("number" + (isNegative ? "_negative" : "") + value); + } + return toVarName(value); + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("number".equalsIgnoreCase(datatype) || + "int".equalsIgnoreCase(datatype)) { + return value; + } else { + return "r'" + escapeText(value) + "'"; + } + } + + @Override + public String toOperationId(String operationId) { + operationId = super.toOperationId(operationId); + + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); + LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); + return newOperationId; + } + + // operationId starts with a number + if (operationId.matches("^\\d.*")) { + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId); + operationId = newOperationId; + } + + return operationId; + } + + public void setPubLibrary(String pubLibrary) { + this.pubLibrary = pubLibrary; + } + + public void setPubName(String pubName) { + this.pubName = pubName; + } + + public void setPubVersion(String pubVersion) { + this.pubVersion = pubVersion; + } + + public void setPubDescription(String pubDescription) { + this.pubDescription = pubDescription; + } + + public void setPubAuthor(String pubAuthor) { + this.pubAuthor = pubAuthor; + } + + public void setPubAuthorEmail(String pubAuthorEmail) { + this.pubAuthorEmail = pubAuthorEmail; + } + + public void setPubHomepage(String pubHomepage) { + this.pubHomepage = pubHomepage; + } + + public void setPubRepository(String pubRepository) { + this.pubRepository = pubRepository; + } + + public void setPubPublishTo(String pubPublishTo) { + this.pubPublishTo = pubPublishTo; + } + + public void setUseEnumExtension(boolean useEnumExtension) { + this.useEnumExtension = useEnumExtension; + } + + public void setSourceFolder(String sourceFolder) { + this.sourceFolder = sourceFolder; + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public void postProcessFile(File file, String fileType) { + super.postProcessFile(file, fileType); + if (file == null) { + return; + } + + String dartPostProcessFile = System.getenv("DART_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(dartPostProcessFile)) { + return; // skip if DART_POST_PROCESS_FILE env variable is not defined + } + + // process all files with dart extension + if ("dart".equals(FilenameUtils.getExtension(file.toString()))) { + // currently supported is "dartfmt -w" and "dart format" + String command = dartPostProcessFile + " " + file; + try { + Process p = Runtime.getRuntime().exec(command); + int exitValue = p.waitFor(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: {}", command); + } + } catch (InterruptedException | IOException e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + // Restore interrupted state + Thread.currentThread().interrupt(); + } + } + } + + @Override + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.DART; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java new file mode 100644 index 000000000000..9b0b00c5ad6b --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -0,0 +1,1072 @@ +package org.openapitools.codegen.languages; + +import static org.openapitools.codegen.utils.StringUtils.underscore; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenDiscriminator; +import org.openapitools.codegen.CodegenDiscriminator.MappedModel; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.TemplateManager; +import org.openapitools.codegen.api.TemplatePathLocator; +import org.openapitools.codegen.config.GlobalSettings; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.ClientModificationFeature; +import org.openapitools.codegen.meta.features.SchemaSupportFeature; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.model.OperationMap; +import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.templating.CommonTemplateContentLocator; +import org.openapitools.codegen.templating.GeneratorTemplateContentLocator; +import org.openapitools.codegen.templating.MustacheEngineAdapter; +import org.openapitools.codegen.templating.TemplateManagerOptions; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Discriminator; +import io.swagger.v3.oas.models.media.Schema; + + +import com.google.common.collect.Sets; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; + +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.model.OperationMap; +import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; +import java.util.stream.Stream; + +import static org.openapitools.codegen.utils.StringUtils.*; + + + +/* + * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class DartNextClientCodegen extends DartNextAbstractCodegen { + + private final Logger LOGGER = LoggerFactory.getLogger(DartDioClientCodegen.class); + + public static final String DATE_LIBRARY = "dateLibrary"; + public static final String DATE_LIBRARY_CORE = "core"; + public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; + public static final String DATE_LIBRARY_DEFAULT = DATE_LIBRARY_CORE; + + public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value"; + public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; + public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; + + public static final String NETWORKING_LIBRARY_DIO = "dio"; + public static final String NETWORKING_LIBRARY_HTTP = "http"; + public static final String NETWORKING_LIBRARY_DEFAULT = NETWORKING_LIBRARY_DIO; + + private static final String DIO_IMPORT = "package:dio/dio.dart"; + public static final String FINAL_PROPERTIES = "finalProperties"; + public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; + + private static final String CLIENT_NAME = "clientName"; + + private String dateLibrary; + + private String serializationLibrary; + + private String clientName; + + private TemplateManager templateManager; + + private Map supportedSerializationLibraries = new LinkedHashMap<>(); + + public DartNextClientCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeClientModificationFeatures( + ClientModificationFeature.Authorizations, + ClientModificationFeature.UserAgent) + .includeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.Union, + SchemaSupportFeature.Composite, + SchemaSupportFeature.allOf, + SchemaSupportFeature.oneOf, + SchemaSupportFeature.anyOf)); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.STABLE) + .build(); + + outputFolder = "generated-code/dart-next"; + embeddedTemplateDir = "dart"; + this.setTemplateDir(embeddedTemplateDir); + + supportedLibraries.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] dio"); + supportedLibraries.put(NETWORKING_LIBRARY_HTTP, "[BETA] http"); + final CliOption networkingLibraryOptions = CliOption.newString(CodegenConstants.LIBRARY, + "Specify networking library"); + networkingLibraryOptions.setEnum(supportedLibraries); + networkingLibraryOptions.setDefault(NETWORKING_LIBRARY_DEFAULT); + cliOptions.add(networkingLibraryOptions); + + supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); + supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + final CliOption serializationLibraryOptions = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, + "Specify serialization library"); + serializationLibraryOptions.setEnum(supportedSerializationLibraries); + serializationLibraryOptions.setDefault(SERIALIZATION_LIBRARY_DEFAULT); + cliOptions.add(serializationLibraryOptions); + + // Date Library Option + final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); + dateOption.setDefault(DATE_LIBRARY_DEFAULT); + + final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, + "Whether properties are marked as final when using Json Serializable for serialization"); + finalProperties.setDefault("true"); + cliOptions.add(finalProperties); + + final Map dateOptions = new HashMap<>(); + dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); + dateOptions.put(DATE_LIBRARY_TIME_MACHINE, + "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); + dateOption.setEnum(dateOptions); + cliOptions.add(dateOption); + } + + public String getDateLibrary() { + return dateLibrary; + } + + public void setDateLibrary(String library) { + this.dateLibrary = library; + } + + public String getSerializationLibrary() { + return serializationLibrary; + } + + /** + * Set serialization library template. + * + * @param serializationLibrary Serialization Library template + */ + public void setSerializationLibrary(String serializationLibrary) { + if (serializationLibrary != null && !supportedSerializationLibraries.containsKey(serializationLibrary)) { + StringBuilder sb = new StringBuilder( + "Unknown serialization library: " + serializationLibrary + "\nAvailable serialization libraries:"); + if (supportedSerializationLibraries.size() == 0) { + sb.append("\n ").append("NONE"); + } else { + for (String lib : supportedSerializationLibraries.keySet()) { + sb.append("\n ").append(lib); + } + } + throw new RuntimeException(sb.toString()); + } + this.serializationLibrary = serializationLibrary; + } + + public String getClientName() { + return clientName; + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + @Override + public String getName() { + return "dart-next"; + } + + @Override + public String getHelp() { + return "Generates a Dart Dio client library."; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { + LOGGER.info( + "Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); + LOGGER.info( + "NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + if (!additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + additionalProperties.put(CodegenConstants.LIBRARY, NETWORKING_LIBRARY_DEFAULT); + LOGGER.debug("Networking library not set, using default {}", NETWORKING_LIBRARY_DEFAULT); + } + setLibrary(additionalProperties.get(CodegenConstants.LIBRARY).toString()); + + if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { + additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DEFAULT); + LOGGER.debug("Serialization library not set, using default {}", SERIALIZATION_LIBRARY_DEFAULT); + } + setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + this.setLegacyDiscriminatorBehavior(false); + } + + if (!additionalProperties.containsKey(DATE_LIBRARY)) { + additionalProperties.put(DATE_LIBRARY, DATE_LIBRARY_DEFAULT); + LOGGER.debug("Date library not set, using default {}", DATE_LIBRARY_DEFAULT); + } + setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); + + if (!additionalProperties.containsKey(FINAL_PROPERTIES)) { + additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE)); + LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE); + } else { + additionalProperties.put(FINAL_PROPERTIES, + Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString())); + } + + if (!additionalProperties.containsKey(CLIENT_NAME)) { + final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName); + additionalProperties.put(CLIENT_NAME, name); + LOGGER.debug("Client name not set, using default {}", DATE_LIBRARY_DEFAULT); + } + setClientName(additionalProperties.get(CLIENT_NAME).toString()); + + supportingFiles.add(new SupportingFile("pubspec.mustache", "", "pubspec.yaml")); + supportingFiles.add(new SupportingFile("analysis_options.mustache", "", "analysis_options.yaml")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + + supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "apis.dart")); + supportingFiles.add(new SupportingFile("lib_model_exports.mustache", libPath, "models.dart")); + supportingFiles.add(new SupportingFile("lib.mustache", libPath, pubName + ".dart")); + + final String srcFolder = libPath + sourceFolder; + supportingFiles + .add(new SupportingFile("serialization/repository_base.mustache", srcFolder, "repository_base.dart")); + + configureNetworkingLibrary(srcFolder); + configureSerializationLibrary(srcFolder); + configureDateLibrary(srcFolder); + } + + private void configureNetworkingLibrary(String sourceFolder) { + switch (library) { + case NETWORKING_LIBRARY_DIO: + additionalProperties.put("useDio", "true"); + configureNetworkingLibraryDio(sourceFolder); + break; + default: + case NETWORKING_LIBRARY_HTTP: + additionalProperties.put("useHttp", "true"); + configureNetworkingLibraryHttp(sourceFolder); + break; + } + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), + isSkipOverwrite()); + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + templateManager = new TemplateManager( + templateManagerOptions, + getTemplatingEngine(), + new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator }); + + // A lambda which allows for easy includes of serialization library specific + // templates without having to change the main template files. + additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { + MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); + String templateFile = "libraries/" + library + "/" + fragment.execute() + ".mustache"; + Template tmpl = engine.getCompiler() + .withLoader(name -> engine.findTemplate(templateManager, name)) + .defaultValue("") + .compile(templateManager.getFullTemplateContents(templateFile)); + + fragment.executeTemplate(tmpl, writer); + }); + } + + private void configureNetworkingLibraryDio(String srcFolder) { + imports.put("MultipartFile", DIO_IMPORT); + final String dioMustacheFolder = "libraries/dio/"; + supportingFiles + .add(new SupportingFile(dioMustacheFolder + "api_client.mustache", srcFolder, "api_client.dart")); + supportingFiles.add(new SupportingFile(dioMustacheFolder + "api_util.mustache", srcFolder, "api_util.dart")); + final String authFolder = srcFolder + File.separator + "auth"; + final String authMustacheFolder = dioMustacheFolder + "auth/"; + supportingFiles + .add(new SupportingFile(authMustacheFolder + "auth_exports.mustache", authFolder, "_exports.dart")); + supportingFiles + .add(new SupportingFile(authMustacheFolder + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); + supportingFiles + .add(new SupportingFile(authMustacheFolder + "basic_auth.mustache", authFolder, "basic_auth.dart")); + supportingFiles + .add(new SupportingFile(authMustacheFolder + "bearer_auth.mustache", authFolder, "bearer_auth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "oauth.mustache", authFolder, "oauth.dart")); + supportingFiles.add(new SupportingFile(authMustacheFolder + "auth.mustache", authFolder, "auth.dart")); + } + + private void configureNetworkingLibraryHttp(String srcFolder) { + + } + + private void configureSerializationLibrary(String srcFolder) { + switch (serializationLibrary) { + case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: + additionalProperties.put("useJsonSerializable", "true"); + configureSerializationLibraryJsonSerializable(srcFolder); + break; + default: + case SERIALIZATION_LIBRARY_BUILT_VALUE: + additionalProperties.put("useBuiltValue", "true"); + configureSerializationLibraryBuiltValue(srcFolder); + break; + } + + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), + isSkipOverwrite()); + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + templateManager = new TemplateManager( + templateManagerOptions, + getTemplatingEngine(), + new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator }); + + // A lambda which allows for easy includes of serialization library specific + // templates without having to change the main template files. + additionalProperties.put("includeSerializationTemplate", (Mustache.Lambda) (fragment, writer) -> { + MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); + String templateFile = "serialization/" + serializationLibrary + "/" + fragment.execute() + ".mustache"; + Template tmpl = engine.getCompiler() + .withLoader(name -> engine.findTemplate(templateManager, name)) + .defaultValue("") + .compile(templateManager.getFullTemplateContents(templateFile)); + + fragment.executeTemplate(tmpl, writer); + }); + } + + private void configureSerializationLibraryBuiltValue(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/built_value/repository_impl.mustache", srcFolder, + "repository_impl.dart")); + supportingFiles.add( + new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); + + typeMapping.put("Array", "BuiltList"); + typeMapping.put("array", "BuiltList"); + typeMapping.put("List", "BuiltList"); + typeMapping.put("set", "BuiltSet"); + typeMapping.put("map", "BuiltMap"); + typeMapping.put("file", "Uint8List"); + typeMapping.put("binary", "Uint8List"); + typeMapping.put("object", "JsonObject"); + typeMapping.put("AnyType", "JsonObject"); + + imports.put("BuiltList", "package:built_collection/built_collection.dart"); + imports.put("BuiltSet", "package:built_collection/built_collection.dart"); + imports.put("BuiltMap", "package:built_collection/built_collection.dart"); + imports.put("JsonObject", "package:built_value/json_object.dart"); + imports.put("Uint8List", "dart:typed_data"); + } + + private void configureSerializationLibraryJsonSerializable(String srcFolder) { + supportingFiles.add(new SupportingFile("serialization/json_serializable/repository_impl.mustache", srcFolder, + "repository_impl.dart")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", + "" /* main project dir */, "build.yaml")); + + // most of these are defined in AbstractDartCodegen, we are overriding + // just the binary / file handling + languageSpecificPrimitives.add("Object"); + imports.put("Uint8List", "dart:typed_data"); + } + + private void configureDateLibrary(String srcFolder) { + switch (dateLibrary) { + case DATE_LIBRARY_TIME_MACHINE: + additionalProperties.put("useDateLibTimeMachine", "true"); + typeMapping.put("date", "OffsetDate"); + typeMapping.put("Date", "OffsetDate"); + typeMapping.put("DateTime", "OffsetDateTime"); + typeMapping.put("datetime", "OffsetDateTime"); + imports.put("OffsetDate", "package:time_machine/time_machine.dart"); + imports.put("OffsetDateTime", "package:time_machine/time_machine.dart"); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", + srcFolder, "local_date_serializer.dart")); + } + break; + default: + case DATE_LIBRARY_CORE: + additionalProperties.put("useDateLibCore", "true"); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + typeMapping.put("date", "Date"); + typeMapping.put("Date", "Date"); + importMapping.put("Date", + "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", + srcFolder + File.separator + modelPackage(), "date.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", + srcFolder, "date_serializer.dart")); + } + break; + } + } + + @Override + public String toDefaultValue(Schema schema) { + if (schema.getDefault() != null) { + if (schema.getEnum() != null) { + return super.toDefaultValue(schema); + } + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (ModelUtils.isArraySchema(schema)) { + if (ModelUtils.isSet(schema)) { + return "SetBuilder()"; + } + return "ListBuilder()"; + } + if (ModelUtils.isMapSchema(schema)) { + return "MapBuilder()"; + } + } + + if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) { + // this is currently not supported and would create compile errors + return null; + } + if (ModelUtils.isStringSchema(schema)) { + return "'" + schema.getDefault().toString().replaceAll("'", "\\'") + "'"; + } + return schema.getDefault().toString(); + } + return null; + } + + @Override + public String toDefaultParameterValue(Schema schema) { + var result = super.toDefaultParameterValue(schema); + return result; + } + + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + super.updateCodegenPropertyEnum(var); + var enumName = var.getEnumName(); + if (enumName != null) { + if (var.defaultValue != null) { + var allowable = var.getAllowableValues(); + if (allowable != null) { + var matchingMap = (ArrayList) allowable.get("enumVars"); + String matchingName = null; + for (Object enumMember : matchingMap) { + if (!(enumMember instanceof HashMap)) { + continue; + } + var castedEnumMember = (HashMap) enumMember; + var name = (String) castedEnumMember.get("name"); + var value = castedEnumMember.get("value"); + if (value.equals(var.defaultValue)) { + matchingName = name; + break; + } + } + if (matchingName != null) { + var newDefaultValue = enumName + "." + matchingName; + var oldDefaultValue = var.getDefaultValue(); + LOGGER.info("Modifying enum {} with default value {} to {}", enumName, oldDefaultValue, + newDefaultValue); + var.setDefaultValue(newDefaultValue); + } + } + + } + } + } + + + @Override + public ModelsMap postProcessModels(ModelsMap objs) { + objs = super.postProcessModels(objs); + List models = objs.getModels(); + ProcessUtils.addIndexToProperties(models, 1); + return objs; + } + + /// Gets all ancestors of a given model, and puts it in accumulator + private void getAncestors(CodegenModel cm, Map allModels, Set accumulator) { + + // get direct parents + Set directParentNames = cm.allOf; + if (directParentNames != null && !directParentNames.isEmpty()) { + for (String directParentName : directParentNames) { + if (accumulator.add(directParentName)) { + CodegenModel parent = allModels.get(directParentName); + getAncestors(parent, allModels, accumulator); + } + } + } + } + + private void syncRootTypesWithInnerVars(Map objs) { + Map allModels = new HashMap<>(); + for (ModelsMap modelsEntries : objs.values()) { + for (ModelMap modelsMap : modelsEntries.getModels()) { + CodegenModel model = modelsMap.getModel(); + allModels.put(model.getClassname(), model); + } + } + + for (CodegenModel model : allModels.values()) { + syncRootTypesWithInnerVars(allModels, model); + } + } + + @Override + public CodegenProperty fromProperty(String name, Schema p, boolean required, + boolean schemaIsFromAdditionalProperties) { + CodegenProperty result = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties); + if (result.containerType != null && typeMapping.containsKey(result.containerType)) { + result.containerType = typeMapping.get(result.containerType); + } + return result; + } + + private void syncRootTypesWithInnerVars(Map objs, CodegenModel model) { + List allVars = new ArrayList<>(); + allVars.addAll(((Collection) model.vendorExtensions.get(kSelfAndAncestorOnlyProps))); + allVars.addAll(((Collection) model.vendorExtensions.get(kSelfOnlyProps))); + allVars.addAll(((Collection) model.vendorExtensions.get(kAncestorOnlyProps))); + + for (CodegenProperty prop : allVars) { + // check if type exists in parent map + String type = prop.openApiType; + if (objs.containsKey(type)) { + // get the type + CodegenModel relatedModel = objs.get(type); + // fill the property's VendorExtensions with the type's VendorExtensions + prop.getVendorExtensions().put(kIsParent, relatedModel.getVendorExtensions().get(kIsParent)); + prop.isEnum = relatedModel.isEnum; + + } + } + } + + private final String kIsChild = "x-is-child"; + private final String kIsParent = "x-is-parent"; + private final String kIsPure = "x-is-pure"; + private final String kSelfOnlyProps = "x-self-only-props"; + private final String kHasSelfOnlyProps = "x-has-self-only-props"; + private final String kAncestorOnlyProps = "x-ancestor-only-props"; + private final String kHasAncestorOnlyProps = "x-has-ancestor-only-props"; + private final String kSelfAndAncestorOnlyProps = "x-self-and-ancestor-only-props"; + private final String kHasSelfAndAncestorOnlyProps = "x-has-self-and-ancestor-only-props"; + private final String kParentDiscriminator = "x-parent-discriminator"; + + // adapts codegen models and property to dart rules of inheritance + private void adaptToDartInheritance(Map objs) { + // get all models + Map allModels = new HashMap<>(); + for (ModelsMap modelsEntries : objs.values()) { + for (ModelMap modelsMap : modelsEntries.getModels()) { + CodegenModel model = modelsMap.getModel(); + allModels.put(model.getClassname(), model); + } + } + + // all ancestors + Set allAncestorsForAllModelsFlat = new HashSet<>(); + // maps a model to its ancestors + Map> allAncestorsForAllModels = new HashMap<>(); + for (java.util.Map.Entry cm : allModels.entrySet()) { + Set allAncestors = new HashSet<>(); + // get all ancestors + // TODO: optimize this logic ? + getAncestors(cm.getValue(), allModels, allAncestors); + // just in case, a model can't be its own ancestor + allAncestors.remove(cm.getKey()); + + allAncestorsForAllModels.put(cm.getKey(), allAncestors); + allAncestorsForAllModelsFlat.addAll(allAncestors); + } + + Set allPureClasses = new HashSet<>(); + // set isChild,isParent,isPure + for (java.util.Map.Entry cmEntry : allModels.entrySet()) { + String key = cmEntry.getKey(); + CodegenModel cm = cmEntry.getValue(); + // get all ancestors + Set allAncestors = allAncestorsForAllModels.get(key); + + // a class is a parent when it's an ancestor to another class + boolean isParent = allAncestorsForAllModelsFlat.contains(key); + // a class is a child when it has any ancestor + boolean isChild = !allAncestors.isEmpty(); + // a class is pure when it's not a child, and has no oneOf nor anyOf + boolean isPure = !isChild && (cm.oneOf == null || cm.oneOf.isEmpty()) + && (cm.anyOf == null || cm.anyOf.isEmpty()); + + cm.vendorExtensions.put(kIsChild, isChild); + cm.vendorExtensions.put(kIsParent, isParent); + cm.vendorExtensions.put(kIsPure, isPure); + if (!isParent && (cm.oneOf == null || cm.oneOf.isEmpty())) { + // discriminator has no meaning here + if (cm.discriminator != null) { + cm.vendorExtensions.put(kParentDiscriminator, cm.discriminator); + cm.discriminator = null; + } + + } + // when pure: + // vars = allVars = selfOnlyProperties = kSelfAndAncestorOnlyProps + // ancestorOnlyProps = empty + if (isPure) { + cm.vendorExtensions.put(kSelfOnlyProps, new ArrayList<>(cm.getVars())); + cm.vendorExtensions.put(kHasSelfOnlyProps, !cm.getVars().isEmpty()); + cm.vendorExtensions.put(kAncestorOnlyProps, new ArrayList()); + cm.vendorExtensions.put(kHasAncestorOnlyProps, false); + cm.vendorExtensions.put(kSelfAndAncestorOnlyProps, new ArrayList<>(cm.getVars())); + cm.vendorExtensions.put(kHasSelfAndAncestorOnlyProps, !cm.getVars().isEmpty()); + + allPureClasses.add(key); + } + } + + // handle impure models + for (java.util.Map.Entry cmEntry : allModels.entrySet()) { + String key = cmEntry.getKey(); + CodegenModel cm = cmEntry.getValue(); + if (allPureClasses.contains(key)) { + continue; + } + // get all ancestors + Set allAncestors = allAncestorsForAllModels.get(key); + + // get direct parents + // Set directParentNames = cm.allOf == null ? new HashSet<>() : + // cm.allOf; + Set compositeProperties = new HashSet<>(); + + Set compositeModelNames = new HashSet(); + compositeModelNames.addAll(ObjectUtils.firstNonNull(cm.oneOf, new HashSet<>())); + compositeModelNames.addAll(ObjectUtils.firstNonNull(cm.anyOf, new HashSet<>())); + compositeModelNames.addAll(allAncestors); + + for (String compositeModelName : compositeModelNames) { + CodegenModel model = allModels.get(compositeModelName); + if (model == null) + continue; + List allVars = ObjectUtils.firstNonNull(model.getAllVars(), new ArrayList<>()); + for (CodegenProperty prop : allVars) { + compositeProperties.add(prop.getName()); + } + } + // dart classes declare selfOnlyProperties as direct members (they exist in + // "vars") + // for pure models, this will equal vars + Map selfOnlyProperties = new HashMap<>(); + + // ancestorOnlyProperties are properties defined by all ancestors + // NOTE: oneOf,anyOf are NOT considered ancestors + // since a child in dart must implement ALL OF the parent (using implements) + Map ancestorOnlyProperties = new HashMap<>(); + + // combines both selfOnlyProperties and ancestorOnlyProperties + // this will be used by the custom serializer as "x-handled-vars" and + // "x-has-handled-vars" + Map selfAndAncestorOnlyProperties = new HashMap<>(); + + // STEP 1: calculating selfOnlyProperties + // get all vars of all ancestors and add them to ancestorPropNames + // Set _ancestorPropNames = new HashSet<>(); + for (String ancestorKey : allAncestors) { + CodegenModel ancestorCM = allModels.get(ancestorKey); + for (CodegenProperty prop : ancestorCM.getVars()) { + ancestorOnlyProperties.put(prop.getName(), prop); + } + } + for (CodegenProperty p : cm.getVars()) { + p.isInherited = ancestorOnlyProperties.containsKey(p.getName()); + if (!p.isInherited && !compositeProperties.contains(p.getName())) { + selfOnlyProperties.put(p.getName(), p); + } + } + selfAndAncestorOnlyProperties.putAll(selfOnlyProperties); + selfAndAncestorOnlyProperties.putAll(ancestorOnlyProperties); + + cm.vendorExtensions.put(kSelfOnlyProps, new ArrayList<>(selfOnlyProperties.values())); + cm.vendorExtensions.put(kHasSelfOnlyProps, !selfOnlyProperties.isEmpty()); + cm.vendorExtensions.put(kAncestorOnlyProps, new ArrayList<>(ancestorOnlyProperties.values())); + cm.vendorExtensions.put(kHasAncestorOnlyProps, !ancestorOnlyProperties.isEmpty()); + cm.vendorExtensions.put(kSelfAndAncestorOnlyProps, new ArrayList<>(selfAndAncestorOnlyProperties.values())); + cm.vendorExtensions.put(kHasSelfAndAncestorOnlyProps, !selfAndAncestorOnlyProperties.isEmpty()); + // fixes missing imports + Set interfaceImports = new HashSet(); + interfaceImports.addAll(cm.allOf); + interfaceImports.addAll(cm.oneOf); + interfaceImports.addAll(cm.anyOf); + cm.imports.addAll(rewriteImports(interfaceImports, true)); + } + } + + /// override the default behavior of createDiscriminator + /// to remove extra mappings added as a side effect of + /// setLegacyDiscriminatorBehavior(false) + /// this ensures 1-1 schema mapping instead of 1-many + @Override + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { + CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema, openAPI); + Discriminator originalDiscriminator = schema.getDiscriminator(); + if (originalDiscriminator != null) { + Map originalMapping = originalDiscriminator.getMapping(); + if (originalMapping != null && !originalMapping.isEmpty()) { + // we already have a discriminator mapping, remove everything else + for (MappedModel currentMappings : new HashSet<>(sub.getMappedModels())) { + if (originalMapping.containsKey(currentMappings.getMappingName())) { + // all good + } else { + sub.getMapping().remove(currentMappings.getMappingName()); + sub.getMappedModels().remove(currentMappings); + } + } + } + } + return sub; + } + + @Override + public Map postProcessAllModels(Map objs) { + objs = super.postProcessAllModels(objs); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + adaptToDartInheritance(objs); + syncRootTypesWithInnerVars(objs); + } + + // loop through models to update the imports + for (ModelsMap entry : objs.values()) { + for (ModelMap mo : entry.getModels()) { + CodegenModel cm = mo.getModel(); + cm.imports = rewriteImports(cm.imports, true); + cm.vendorExtensions.put("x-has-vars", !cm.vars.isEmpty()); + } + } + + return objs; + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (property.isEnum && property.getComposedSchemas() == null) { + // enums are generated with built_value and make use of BuiltSet + model.imports.add("BuiltSet"); + } + + if (property.isContainer) { + // Figure out if there are any container type additionalProperties + // that need a custom serializer builder factory added. + final CodegenProperty items = property.items; + if (items.getAdditionalProperties() != null) { + addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(items)); + } + } + } + } + + @Override + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + super.postProcessOperationsWithModels(objs, allModels); + OperationMap operations = objs.getOperations(); + List operationList = operations.getOperation(); + + Set resultImports = new HashSet<>(); + + for (CodegenOperation op : operationList) { + for (CodegenParameter param : Stream.of(op.allParams, op.bodyParams, op.formParams) + .flatMap(Collection::stream) + .collect(Collectors.toList())) { + if (((op.isMultipart && param.isFormParam) || param.isBodyParam) && (param.isBinary || param.isFile)) { + param.dataType = param.dataType.replace("Uint8List", "MultipartFile"); + // param.containerType = param.containerType.replace("Uint8List", + // "MultipartFile"); + op.imports.add("MultipartFile"); + + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + boolean skipFormModel = Boolean + .parseBoolean(GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL, "true")); + if (param.isFormParam && param.isContainer && !skipFormModel) { + // Because of skipFormModel=false, there is a model class generated which has + // "BuiltList" as property and it requires the correct + // serializer imports to be added in order to compile. + addBuiltValueSerializerImport("Uint8List"); + } + } + } + + } + // The MultipartFile handling above changes the type of some parameters from + // `UInt8List`, the default for files, to `MultipartFile`. + // + // The following block removes the required import for Uint8List if it is no + // longer in use. + if (op.allParams.stream().noneMatch(param -> param.dataType.equals("Uint8List")) + && op.responses.stream().filter(response -> response.dataType != null) + .noneMatch(response -> response.dataType.equals("Uint8List"))) { + // Remove unused imports after processing + op.imports.remove("Uint8List"); + } + + resultImports.addAll(rewriteImports(op.imports, false)); + + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + + for (CodegenParameter param : op.allParams) { + // Generate serializer factories for all container type parameters. + // But skip binary and file parameters, JSON serializers don't make sense there. + if (param.isContainer && !(param.isBinary || param.isFile)) { + addBuiltValueSerializer(BuiltValueSerializer.fromCodegenParameter(param)); + } + } + } + + if (op.returnContainer != null && !(op.isResponseBinary || op.isResponseFile)) { + addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(op.returnProperty)); + } + } + // for some reason "import" structure is changed .. + objs.put("imports", resultImports.stream().sorted().collect(Collectors.toList())); + + return objs; + } + + private void addBuiltValueSerializerImport(String type) { + additionalProperties.compute("builtValueSerializerImports", (k, v) -> { + Set imports = v == null ? Sets.newHashSet() : ((Set) v); + imports.addAll(rewriteImports(Sets.newHashSet(type), true)); + return imports; + }); + } + + /** + * Adds the serializer to the global list of custom built_value serializers. + * + * @param serializer + */ + private void addBuiltValueSerializer(BuiltValueSerializer serializer) { + additionalProperties.compute("builtValueSerializers", (k, v) -> { + Set serializers = v == null ? Sets.newHashSet() : ((Set) v); + serializers.add(serializer); + return serializers; + }); + } + + private Set rewriteImports(Set originalImports, boolean isModel) { + Set resultImports = Sets.newHashSet(); + for (String modelImport : originalImports) { + if (modelImport.startsWith("BuiltList", 0)) { + modelImport = "BuiltList"; + } else if (modelImport.startsWith("BuiltSet", 0)) { + modelImport = "BuiltSet"; + } else if (modelImport.startsWith("BuiltMap", 0)) { + modelImport = "BuiltMap"; + } + + if (imports.containsKey(modelImport)) { + String i = imports.get(modelImport); + if (Objects.equals(i, DIO_IMPORT) && !isModel) { + // Don't add imports to operations that are already imported + continue; + } + resultImports.add(i); + } else if (importMapping().containsKey(modelImport)) { + resultImports.add(importMapping().get(modelImport)); + } else if (modelImport.startsWith("dart:")) { // import dart:* directly + resultImports.add(modelImport); + } else if (modelImport.startsWith("package:")) { // e.g. package:openapi/src/model/child.dart + resultImports.add(modelImport); + } else { + resultImports.add("package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/" + + underscore(modelImport) + ".dart"); + } + } + return resultImports; + } + + static class BuiltValueSerializer { + final String containerType; + final boolean isContainer; + final boolean isArray; + final boolean uniqueItems; + final boolean isMap; + final BuiltValueSerializer items; + final boolean isNullable; + + final String datatypeWithEnum; + final String dataType; + + public static BuiltValueSerializer fromCodegenParameter(CodegenParameter parameter) { + if (parameter == null) { + return null; + } + return new BuiltValueSerializer(parameter.isArray, parameter.getUniqueItems(), parameter.getIsMap(), + /// Recursion to handle subtypes + fromCodegenProperty(parameter.items), + parameter.isNullable, parameter.datatypeWithEnum, parameter.dataType, parameter.containerType, + parameter.isContainer); + } + + public static BuiltValueSerializer fromCodegenProperty(CodegenProperty property) { + if (property == null) { + return null; + } + return new BuiltValueSerializer(property.isArray, property.getUniqueItems(), property.getIsMap(), + /// Recursion to handle subtypes + fromCodegenProperty(property.items), + property.isNullable, property.datatypeWithEnum, property.dataType, property.containerType, + property.isContainer); + } + + private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, BuiltValueSerializer items, + boolean isNullable, String datatypeWithEnum, String dataType, String containerType, + boolean isContainer) { + this.isArray = isArray; + this.uniqueItems = uniqueItems; + this.isMap = isMap; + this.items = items; + this.isNullable = isNullable; + this.datatypeWithEnum = datatypeWithEnum; + this.dataType = dataType; + this.containerType = containerType; + this.isContainer = isContainer; + } + + public boolean isContainer() { + return isContainer; + } + + public boolean isArray() { + return isArray; + } + + public boolean isUniqueItems() { + return uniqueItems; + } + + public boolean isMap() { + return isMap; + } + + public BuiltValueSerializer getItems() { + return items; + } + + public boolean isNullable() { + return isNullable; + } + + public String getDatatypeWithEnum() { + return datatypeWithEnum; + } + + public String getContainerType() { + return containerType; + } + + public String getDataType() { + return dataType; + } + + @Override + public int hashCode() { + return Objects.hash(isContainer, isArray, uniqueItems, isMap, items, isNullable, datatypeWithEnum, + dataType); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + BuiltValueSerializer other = (BuiltValueSerializer) obj; + if (isContainer != other.isContainer) + return false; + if (isArray != other.isArray) + return false; + if (uniqueItems != other.uniqueItems) + return false; + if (isMap != other.isMap) + return false; + if (items == null) { + if (other.items != null) + return false; + } else if (!items.equals(other.items)) + return false; + if (isNullable != other.isNullable) + return false; + if (datatypeWithEnum == null) { + if (other.datatypeWithEnum != null) + return false; + } else if (!datatypeWithEnum.equals(other.datatypeWithEnum)) + return false; + if (dataType == null) { + if (other.dataType != null) + return false; + } else if (!dataType.equals(other.dataType)) + return false; + return true; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 70a9b14b2446..4aa4a21402a8 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -24,6 +24,7 @@ org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpFunctionsServerCodegen org.openapitools.codegen.languages.DartClientCodegen org.openapitools.codegen.languages.DartDioClientCodegen +org.openapitools.codegen.languages.DartNextClientCodegen org.openapitools.codegen.languages.EiffelClientCodegen org.openapitools.codegen.languages.ElixirClientCodegen org.openapitools.codegen.languages.ElmClientCodegen diff --git a/modules/openapi-generator/src/main/resources/dart/README.mustache b/modules/openapi-generator/src/main/resources/dart-next/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/README.mustache rename to modules/openapi-generator/src/main/resources/dart-next/README.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart-next/analysis_options.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/analysis_options.mustache rename to modules/openapi-generator/src/main/resources/dart-next/analysis_options.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/api.mustache b/modules/openapi-generator/src/main/resources/dart-next/api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/api.mustache rename to modules/openapi-generator/src/main/resources/dart-next/api.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/api_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/api_doc.mustache rename to modules/openapi-generator/src/main/resources/dart-next/api_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/api_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/api_test.mustache rename to modules/openapi-generator/src/main/resources/dart-next/api_test.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/class.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/class.mustache rename to modules/openapi-generator/src/main/resources/dart-next/class.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt b/modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/dart-keywords.txt rename to modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt diff --git a/modules/openapi-generator/src/main/resources/dart/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/enum.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/enum.mustache rename to modules/openapi-generator/src/main/resources/dart-next/enum.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-next/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/gitignore.mustache rename to modules/openapi-generator/src/main/resources/dart-next/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/header.mustache b/modules/openapi-generator/src/main/resources/dart-next/header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/header.mustache rename to modules/openapi-generator/src/main/resources/dart-next/header.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/lib.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/lib.mustache rename to modules/openapi-generator/src/main/resources/dart-next/lib.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib_api_exports.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/lib_api_exports.mustache rename to modules/openapi-generator/src/main/resources/dart-next/lib_api_exports.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/lib_model_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/lib_model_exports.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/lib_model_exports.mustache rename to modules/openapi-generator/src/main/resources/dart-next/lib_model_exports.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache new file mode 100644 index 000000000000..11e92d04f84d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache @@ -0,0 +1,27 @@ +{{>header}} +import 'dart:async'; +import 'package:dio/dio.dart'; +{{#useBuiltValue}} +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart';{{/useBuiltValue}}{{#useJsonSerializable}} +import 'package:json_annotation/json_annotation.dart';{{/useJsonSerializable}} +import 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/api_util.dart'; +import 'package:{{pubName}}/models.dart'; +{{#operations}} +{{#imports}}import '{{.}}'; +{{/imports}} + +part '{{classFilename}}.g.dart'; + +{{>libraries/dio/api_typed}} +{{>libraries/dio/api_raw}} + +{{#operation}} +{{#allParams}} +{{>serialization/recursion_enum_inline}} +{{/allParams}} +{{/operation}} +{{/operations}} + diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_client.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_client.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache new file mode 100644 index 000000000000..dbe677b57bfd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_raw.mustache @@ -0,0 +1,94 @@ +class {{classname}}Raw { + + final Dio _dio; + + const {{classname}}Raw(this._dio); + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}}{{#defaultValue}} (Default: {{.}}) {{/defaultValue}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioException] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required String {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}Object{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}String{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{/allParams}} + Object? body, + String? requestContentType, + String? acceptContentType, + ResponseType? responseType, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; + final _options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + {{#headerParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + if (acceptContentType != null) 'Accept': acceptContentType, + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}',{{#scheme}} + 'scheme': '{{.}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + }, + contentType: requestContentType, + responseType: responseType, + validateStatus: validateStatus, + );{{#hasQueryParams}} + + final _queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/queryParams}} + };{{/hasQueryParams}} + + return await _dio.request( + _path, + data: body, + options: _options,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + } + + {{/operation}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_test.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache new file mode 100644 index 000000000000..5b7a3bcf108e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache @@ -0,0 +1,112 @@ +class {{classname}} { + + final {{classname}}Raw rawApi; + final SerializationRepositoryBase _repository; + + const {{classname}}(this.rawApi, this._repository); + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}}{{#defaultValue}} (Default: {{.}}) {{/defaultValue}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioException] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{>types/required}} {{>types/recursion_type}} {{paramName}}{{#defaultValue}} = {{{.}}}{{/defaultValue}},{{/allParams}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + {{#hasBodyOrFormParams}} + Object? _bodyData; + {{#hasFormParams}} + final _bodyMap = { + {{#formParams}} + {{^required}}if ({{{paramName}}} != null) {{/required}}r'{{{baseName}}}': encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}), + {{/formParams}} + }; + {{#isMultipart}} + _bodyData = FormData.fromMap(_bodyMap); + {{/isMultipart}} + {{^isMultipart}} + _bodyData = _bodyMap; + {{/isMultipart}} + {{/hasFormParams}} + {{#bodyParam}} + _bodyData = encodeBodyParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}); + {{/bodyParam}} + {{/hasBodyOrFormParams}} + + final _response = await rawApi.{{nickname}}( + {{#allParams}}{{#isPathParam}} + {{paramName}}: encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}),{{/isPathParam}}{{#isQueryParam}} + {{paramName}}: encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}),{{/isQueryParam}}{{#isHeaderParam}} + {{paramName}}: encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}), {{/isHeaderParam}}{{/allParams}} + {{#hasConsumes}} + body: _bodyData, + requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + cancelToken: cancelToken, + headers: headers, + extra: extra, + {{#isResponseFile}} + responseType: responseType.bytes, + {{/isResponseFile}} + validateStatus: validateStatus, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + {{#returnType}} + + {{{.}}}? _responseData; + + try { + final rawResponse = _response.data; + {{#returnProperty}} + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, {{>types/recursion_type_info}}); + {{/returnProperty}} + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response<{{{.}}}>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + );{{/returnType}}{{^returnType}} + return _response;{{/returnType}} + } + + {{/operation}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache similarity index 71% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache index 1bc33e18abee..cca5b3427a0a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache @@ -21,6 +21,29 @@ Object encodeFormParameter( return serialized; } +String encodeStringParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + return repository.serialize(value, type).toString(); +} + +Object encodeBodyParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + Object encodeQueryParameter( SerializationRepositoryBase repository, T value, @@ -58,4 +81,8 @@ ListParam encodeCollectionQueryParameter( return ListParam(serialized.toList(), format); } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +TOutput decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) { + return repository.deserialize(value, type); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/api_key_auth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/api_key_auth.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth_exports.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth_exports.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/auth_exports.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/basic_auth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/basic_auth.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/bearer_auth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/bearer_auth.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/oauth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache rename to modules/openapi-generator/src/main/resources/dart-next/libraries/dio/auth/oauth.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/model.mustache b/modules/openapi-generator/src/main/resources/dart-next/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/model.mustache rename to modules/openapi-generator/src/main/resources/dart-next/model.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-next/model_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/model_test.mustache rename to modules/openapi-generator/src/main/resources/dart-next/model_test.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-next/object_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/object_doc.mustache rename to modules/openapi-generator/src/main/resources/dart-next/object_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart-next/pubspec.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/pubspec.mustache rename to modules/openapi-generator/src/main/resources/dart-next/pubspec.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache similarity index 65% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache index 9acd5ba70a08..b917ad0c085d 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class.mustache @@ -16,4 +16,13 @@ part '{{classFilename}}.g.dart'; {{>serialization/built_value/class_serializer}}{{#vendorExtensions.x-is-parent}} {{>serialization/built_value/class_concrete}}{{/vendorExtensions.x-is-parent}} -{{>serialization/built_value/class_inline_enums}} \ No newline at end of file +{{! + Generate an enum for any variables that are declared as inline enums + isEnum is only true for inline variables that are enums. + If an enum is declared as a definition, isEnum is false and the enum is generated from the + enum.mustache template. + enumName only exists for inline enums +}} +{{#vars}} +{{>serialization/built_value/recursion_enum_inline}} +{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_concrete.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_concrete.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_concrete.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_concrete.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_discriminator.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_discriminator.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_discriminator.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_header.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_header.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_header.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache similarity index 94% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_members.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache index 0df06e1e3073..47a355ed5e1e 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_members.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_members.mustache @@ -7,7 +7,7 @@ @Deprecated('{{{name}}} has been deprecated') {{/deprecated}} @BuiltValueField(wireName: r'{{baseName}}') - {{>serialization/built_value/variable_type}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}}; + {{>types/recursion_type}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}}; {{#allowableValues}} // {{#min}}range from {{{min}}} to {{{max}}}{{/min}}{{^min}}enum {{name}}Enum { {{#values}} {{{.}}}, {{/values}} };{{/min}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/class_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/date.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/date.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/date_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/date_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/deserialize_properties.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache similarity index 96% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/deserialize_properties.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache index d64ec8086c34..d8dbfdfd4d8d 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/deserialize_properties.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/deserialize_properties.mustache @@ -15,7 +15,7 @@ final valueDes = serializers.deserialize( value, specifiedType: const {{>serialization/built_value/variable_serializer_type}}, - ) as {{>serialization/built_value/variable_type}}; + ) as {{>types/recursion_type}}; {{#isNullable}} if (valueDes == null) continue; {{/isNullable}} diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache similarity index 85% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache index 2c076da6661c..83033f367aab 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum.mustache @@ -14,7 +14,7 @@ class {{classname}} extends EnumClass { {{#description}} /// {{{.}}} {{/description}} - @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: {{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) static const {{classname}} {{name}} = _${{name}}; {{/enumVars}} {{/allowableValues}} @@ -33,4 +33,4 @@ class {{classname}} extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class {{classname}}Mixin = Object with _${{classname}}Mixin; +typedef {{classname}}Mixin = _${{classname}}Mixin; diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache similarity index 85% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum_inline.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache index 98345b6d9d6a..d1fd32192c83 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/enum_inline.mustache @@ -8,7 +8,7 @@ class {{{enumName}}} extends EnumClass { {{#description}} /// {{{.}}} {{/description}} - @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: {{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/offset_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/offset_date_serializer.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/offset_date_serializer.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/offset_date_serializer.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache new file mode 100644 index 000000000000..b6c8bb4bcc98 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/recursion_enum_inline.mustache @@ -0,0 +1,12 @@ +{{^isModel}} +{{#enumName}} +{{^isContainer}} +{{>serialization/built_value/enum_inline}} +{{/isContainer}} +{{#isContainer}} + {{#items}} +{{>serialization/built_value/recursion_enum_inline}} + {{/items}} +{{/isContainer}} +{{/enumName}} +{{/isModel}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_construction.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_construction.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_construction.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache similarity index 78% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache index 6978920951b3..d06ea0b8765d 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache @@ -25,7 +25,10 @@ class BuiltValueJsonRepository extends SerializationRepositoryBase { const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { + if (value is T) { + return value; + } return serializers.deserialize( value, specifiedType: typeInfoToFullType(targetTypeInfo), @@ -33,7 +36,10 @@ class BuiltValueJsonRepository extends SerializationRepositoryBase { } @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + if (src == null) { + return null; + } return serializers.serialize( src, specifiedType: typeInfoToFullType(inputTypeInfo), diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache similarity index 77% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/serializers.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache index bfe56d66153c..4cb672f0bc5f 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/serializers.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/serializers.mustache @@ -7,6 +7,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; +import 'package:{{pubName}}/apis.dart'; {{#useDateLibCore}}import 'package:built_value/iso_8601_date_time_serializer.dart';{{/useDateLibCore}} {{#useDateLibTimeMachine}}import 'package:time_machine/time_machine.dart'; import 'package:{{pubName}}/{{sourceFolder}}/offset_date_serializer.dart';{{/useDateLibTimeMachine}} @@ -20,14 +21,8 @@ part 'serializers.g.dart'; ]) Serializers serializers = (_$serializers.toBuilder(){{#builtValueSerializers}} ..addBuilderFactory( -{{#isArray}} - const FullType(Built{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), - () => {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}Builder<{{dataType}}>(), -{{/isArray}} -{{#isMap}} - const FullType(BuiltMap, [FullType(String), FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), - () => MapBuilder(), -{{/isMap}} + const {{>serialization/built_value/variable_serializer_type}}, + () => {{>serialization/built_value/variable_builder_type}}, ){{/builtValueSerializers}} {{#models}}{{#model}}{{#vendorExtensions.x-is-parent}}..add({{classname}}.serializer) {{/vendorExtensions.x-is-parent}}{{/model}}{{/models}}..add(const OneOfSerializer()) diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/test_instance.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/built_value/test_instance.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/test_instance.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache new file mode 100644 index 000000000000..87e6197af25f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_builder_type.mustache @@ -0,0 +1 @@ +{{#isContainer}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{#isMap}}Map{{/isMap}}Builder<{{#isMap}}String, {{/isMap}}{{#items}}{{>types/recursion_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache new file mode 100644 index 000000000000..3ebd82b55cac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/variable_serializer_type.mustache @@ -0,0 +1 @@ +FullType{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{containerType}}, [{{#isMap}}FullType(String), {{/isMap}}{{#items}}{{>serialization/built_value/variable_serializer_type}}{{/items}}]{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/build.yaml.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/build.yaml.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/build.yaml.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/class.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/class.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/class.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/dart_constructor.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/dart_constructor.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/dart_constructor.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum_inline.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/enum_inline.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/enum_inline.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_construction.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_construction.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_construction.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache new file mode 100644 index 000000000000..ec1eb6a29167 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache @@ -0,0 +1,121 @@ +import 'dart:convert'; +import 'dart:typed_data'; +import 'repository_base.dart'; +import 'package:{{pubName}}/models.dart'; + +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + + /// Transforms an object of arbitrary type [T] (whose information is passed in inputTypeInfo) to a dart primitive + @override + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + if (src == null) { + return null; + } + if (src is String) { + return src; + } + if (src is bool) { + return src; + } + if (src is DateTime) { + return src.toIso8601String(); + } + if (src is num) { + return src; + } + if (src is Uint8List) { + return src; + } + if (src is Iterable) { + return src.map((value) => serialize(value, inputTypeInfo.parameters[0], context: context)).toList(); + } + if (src is Map) { + return src.map((key,value) => MapEntry( + //Json Map keys must always be strings + serialize(key, inputTypeInfo.parameters[0], context: context).toString(), + serialize(value, inputTypeInfo.parameters[1], context: context) + )); + } + + if (context is Object? Function(Object?)) { + return context(src); + } + + try { + return (src as dynamic).toJson(); + } on NoSuchMethodError { + assert(false, + ''' + Failed to serialize the object properly, falling back to `toString()` + '''); + return src.toString(); + } + } + + /// Transforms a dart primitive to an object of arbitrary type [T] (whose information is passed in inputTypeInfo) + @override + T deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { + //Don't rely on T being accurate here, since it won't get passed for generic arguments. + if (value == null) { + return null as T; + } + final targetRootType = targetTypeInfo.root; + if (targetRootType == T) { + //short circuit if we already have the output as the input + return value as T; + } + switch (targetRootType) { + case String: + return value.toString() as T; + case double: + return (value is num ? value.toDouble() : double.tryParse(value.toString())) as T; + case int: + return (value is num ? value.toInt() : int.tryParse(value.toString())) as T; + case num: + return (value is num ? value : num.tryParse(value.toString())) as T; + case bool: + return (value is bool ? value : bool.tryParse(value.toString())) as T; + case DateTime: + return (value is DateTime ? value : DateTime.tryParse(value.toString())) as T; + case Iterable: + case List: + case Set: + if (value is! Iterable) { + throw Exception('Cannot deserialize'); + } + final mappedItems = value.map((v) => deserialize(v, targetTypeInfo.parameters[0], context: context)); + if (targetRootType == List) { + return List.from(mappedItems); + } else if (targetRootType == Set) { + return Set.from(mappedItems); + } else if (targetRootType == Iterable) { + return mappedItems; + } else { + throw Exception('Cannot deserialize'); + } + case Map: + if (value is! Map) { + throw Exception('Cannot deserialize'); + } + return value.map((k,v) => MapEntry(deserialize(k, targetTypeInfo.parameters[0], context: context),deserialize(v, targetTypeInfo.parameters[1], context: context))); + {{#models}} + {{#model}} + case {{{classname}}}: + {{#isEnum}} + //TODO: find a way to support enums + return value as T; + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value as Map) as T; + {{/isEnum}} + {{/model}} + {{/models}} + default: + if (value is T) { + return value; + } + throw Exception('Cannot deserialize'); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/test_instance.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/test_instance.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/test_instance.mustache diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache new file mode 100644 index 000000000000..30786f599443 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/recursion_enum_inline.mustache @@ -0,0 +1,12 @@ +{{^isModel}} +{{#enumName}} +{{^isContainer}} +{{#includeSerializationTemplate}}enum_inline{{/includeSerializationTemplate}} +{{/isContainer}} +{{#isContainer}} + {{#items}} +{{>serialization/recursion_enum_inline}} + {{/items}} +{{/isContainer}} +{{/enumName}} +{{/isModel}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache similarity index 85% rename from modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache rename to modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache index 4d0b9eb3fda1..c4c2def37aa6 100644 --- a/modules/openapi-generator/src/main/resources/dart/serialization/repository_base.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache @@ -1,12 +1,13 @@ /// The general rule for implementing this class is /// json == serialize(deserialize(json)) /// object == deserialize(serialize(object)) -/// It doesn't have to be json, +/// Where json in this context means a dart primitive +/// JSON = String | num | bool | null | Uint8List | List | Map abstract class SerializationRepositoryBase { const SerializationRepositoryBase(); - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context,}); + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); } /// A modified version of `built_value`'s `FullType` class, found here diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache new file mode 100644 index 000000000000..8b15970ec9aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type.mustache @@ -0,0 +1 @@ +{{#isContainer}}{{containerType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>types/recursion_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache new file mode 100644 index 000000000000..4eb44953b8df --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/types/recursion_type_info.mustache @@ -0,0 +1,9 @@ +const TypeInfo{{#isNullable}}.nullable{{/isNullable}}( + {{#isContainer}}{{containerType}}, [ + {{#isMap}}TypeInfo(String), {{/isMap}} + {{#items}}{{>types/recursion_type_info}}{{/items}}, + ]{{/isContainer}}{{^isContainer}} + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}} + {{^datatypeWithEnum}}{{{dataType}}}{{/datatypeWithEnum}} + {{/isContainer}}) + diff --git a/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache b/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache new file mode 100644 index 000000000000..bcf4538e8b3e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-next/types/required.mustache @@ -0,0 +1,15 @@ +{{! + a parameter is removed in dart json if its OAS properties are: + 1. not required + has null value + + a parameter is nullable in dart if its OAS properties are: + 1. nullable + 2. non-nullable + no default value + not required + + a parameter is required in dart if its OAS properties are: + 1. no default value + non-nullable + 2. no default value + nullable + required + + as a general rule, a required paramter can't have a default value, since it will throw a syntax error. +}} +{{^defaultValue}}{{#isNullable}}{{#required}}required{{/required}}{{/isNullable}}{{^isNullable}}required{{/isNullable}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache deleted file mode 100644 index 28ac7a46ff54..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ /dev/null @@ -1,14 +0,0 @@ -{{>header}} -import 'dart:async'; -import 'package:dio/dio.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/repository_base.dart'; -import 'package:{{pubName}}/{{sourceFolder}}/api_util.dart'; -import 'package:{{pubName}}/models.dart'; -{{#operations}} -{{#imports}}import '{{.}}'; -{{/imports}} - -{{>libraries/dio/api_typed}} -{{>libraries/dio/api_raw}} - -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache deleted file mode 100644 index 550d699026cf..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_raw.mustache +++ /dev/null @@ -1,232 +0,0 @@ -class {{classname}}Raw { - - final Dio _dio; - - const {{classname}}Raw(this._dio); - - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required String {{paramName}},{{/isPathParam}}{{#isQueryParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}Object{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}String{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{/allParams}} - Object? body, - String? requestContentType, - String? acceptContentType, - ResponseType? responseType, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{{paramName}}}.toString()){{/pathParams}}; - final _options = Options( - method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', - headers: { - {{#httpUserAgent}} - r'User-Agent': r'{{{.}}}', - {{/httpUserAgent}} - {{#headerParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, - {{/headerParams}} - if (acceptContentType != null) 'Accept': acceptContentType, - ...?headers, - }, - extra: { - 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} - {{#authMethods}}{ - 'type': '{{type}}',{{#scheme}} - 'scheme': '{{.}}',{{/scheme}} - 'name': '{{name}}',{{#isApiKey}} - 'keyName': '{{keyParamName}}', - 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} - },{{/authMethods}} - ],{{/hasAuthMethods}} - ...?extra, - }, - contentType: requestContentType, - responseType: responseType, - validateStatus: validateStatus, - );{{#hasQueryParams}} - - final _queryParameters = { - {{#queryParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, - {{/queryParams}} - };{{/hasQueryParams}} - - return await _dio.request( - _path, - data: body, - options: _options,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - } - - {{/operation}} -} - -/* -class {{classname}} { - - final Dio _dio; - -{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} - - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioException] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}.toString()){{/pathParams}}; - final _options = Options( - method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', - {{#isResponseFile}} - responseType: ResponseType.bytes, - {{/isResponseFile}} - headers: { - {{#httpUserAgent}} - r'User-Agent': r'{{{.}}}', - {{/httpUserAgent}} - {{#headerParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, - {{/headerParams}} - ...?headers, - }, - extra: { - 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} - {{#authMethods}}{ - 'type': '{{type}}',{{#scheme}} - 'scheme': '{{.}}',{{/scheme}} - 'name': '{{name}}',{{#isApiKey}} - 'keyName': '{{keyParamName}}', - 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} - },{{/authMethods}} - ],{{/hasAuthMethods}} - ...?extra, - },{{#hasConsumes}} - contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} - validateStatus: validateStatus, - );{{#hasQueryParams}} - - final _queryParameters = { - {{#queryParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, - {{/queryParams}} - };{{/hasQueryParams}}{{#hasBodyOrFormParams}} - - dynamic _bodyData; - - try { -{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - }{{/hasBodyOrFormParams}} - - final _response = await _dio.request( - _path,{{#hasBodyOrFormParams}} - data: _bodyData,{{/hasBodyOrFormParams}} - options: _options,{{#hasQueryParams}} - queryParameters: _queryParameters,{{/hasQueryParams}} - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - {{#returnType}} - - {{{.}}}? _responseData; - - try { -{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response<{{{returnType}}}>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - );{{/returnType}}{{^returnType}} - return _response;{{/returnType}} - } - -*/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache deleted file mode 100644 index 153a34b6edb8..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_typed.mustache +++ /dev/null @@ -1,133 +0,0 @@ -class {{classname}} { - - final {{classname}}Raw rawApi; - final SerializationRepositoryBase _repository; - - const {{classname}}(this.rawApi, this._repository); - - {{#operation}} - /// {{summary}}{{^summary}}{{nickname}}{{/summary}} - /// {{notes}} - /// - /// Parameters: - {{#allParams}} - /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} - {{/allParams}} - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} - /// Throws [DioError] if API call or serialization fails - {{#externalDocs}} - /// {{description}} - /// Also see [{{summary}} Documentation]({{url}}) - {{/externalDocs}} - {{#isDeprecated}} - @Deprecated('This operation has been deprecated') - {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} - {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - {{#hasBodyOrFormParams}} - - Object? _bodyData; - {{#hasFormParams}} - {{#isMultipart}} - _bodyData = FormData.fromMap({ - {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_base_type_info}}){{/isFile}}, - {{/formParams}} - }); - {{/isMultipart}} - {{^isMultipart}} - _bodyData = { - {{#formParams}} - {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_base_type_info}}), - {{/formParams}} - }; - {{/isMultipart}} - {{/hasFormParams}} - {{#bodyParam}} - {{#isPrimitiveType}} - _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; - {{/isPrimitiveType}} - {{^isPrimitiveType}} - _bodyData = {{^required}}{{paramName}} == null ? null : {{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}); - {{/isPrimitiveType}} - {{/bodyParam}} - {{/hasBodyOrFormParams}} - - final _response = await rawApi.{{nickname}}( - {{#allParams}}{{#isPathParam}} - {{paramName}}: _repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString(),{{/isPathParam}}{{#isQueryParam}} - {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_base_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}) ,{{/isQueryParam}}{{#isHeaderParam}} - {{paramName}}: {{^required}}{{^isNullable}}{{{paramName}}} == null ? null : {{/isNullable}}{{/required}}_repository.serialize({{paramName}}, {{>types/recursion_base_type_info}}).toString(), {{/isHeaderParam}}{{/allParams}} - {{#hasConsumes}} - body: _bodyData, - requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} - cancelToken: cancelToken, - headers: headers, - extra: extra, - {{#isResponseFile}} - responseType: responseType.bytes, - {{/isResponseFile}} - validateStatus: validateStatus, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - {{#returnType}} - - {{{.}}}? _responseData; - - try { - final rawResponse = _response.data; - {{#isResponseFile}} - _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; - {{/isResponseFile}} - {{^isResponseFile}} - {{#returnProperty}} - _responseData = rawResponse == null ? null : _repository.deserialize( - rawResponse, - {{>types/recursion_base_type_info}}, - ); - {{/returnProperty}} - {{/isResponseFile}} - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response<{{{.}}}>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - );{{/returnType}}{{^returnType}} - return _response;{{/returnType}} - } - - {{/operation}} -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache deleted file mode 100644 index cab1887c577e..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/README.mustache +++ /dev/null @@ -1,145 +0,0 @@ -# {{{pubName}}} -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{{appVersion}}} -{{#artifactVersion}} -- Package version: {{{.}}} -{{/artifactVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{{generatedDate}}} -{{/hideGenerationTimestamp}} -- Build package: {{{generatorClass}}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements - -Dart 2.12 or later - -## Installation & Usage - -### Github -If this Dart package is published to Github, add the following dependency to your pubspec.yaml -``` -dependencies: - {{{pubName}}}: - git: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git -``` - -### Local -To use the package in your local drive, add the following dependency to your pubspec.yaml -``` -dependencies: - {{{pubName}}}: - path: /path/to/{{{pubName}}} -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:{{{pubName}}}/api.dart'; -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} -// TODO Configure HTTP basic authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; -{{/isBasicBasic}} -{{#isBasicBearer}} -// TODO Configure HTTP Bearer authorization: {{{name}}} -// Case 1. Use String Token -//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); -// Case 2. Use Function which generate token. -// String yourTokenGeneratorFunction() { ... } -//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); -{{/isBasicBearer}} -{{/isBasic}} -{{#isApiKey}} -// TODO Configure API key authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; -{{/isApiKey}} -{{#isOAuth}} -// TODO Configure OAuth2 access token for authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} - -final api_instance = {{{classname}}}(); -{{#allParams}} -final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); - {{#returnType}} - print(result); - {{/returnType}} -} catch (e) { - print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{{modelDocPath}}}/{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} -### {{{name}}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} -- **Type**: HTTP Basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: HTTP Bearer authentication -{{/isBasicBearer}} -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/analysis_options.mustache deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache deleted file mode 100644 index c6289c2b7662..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api.mustache +++ /dev/null @@ -1,194 +0,0 @@ -{{>header}} -{{>part_of}} -{{#operations}} - -class {{{classname}}} { - {{{classname}}}([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - {{#operation}} - - {{#summary}} - /// {{{.}}} - {{/summary}} - {{#notes}} - {{#summary}} - /// - {{/summary}} - /// {{{notes}}} - /// - /// Note: This method returns the HTTP [Response]. - {{/notes}} - {{^notes}} - {{#summary}} - /// - /// Note: This method returns the HTTP [Response]. - {{/summary}} - {{^summary}} - /// Performs an HTTP '{{{httpMethod}}} {{{path}}}' operation and returns the [Response]. - {{/summary}} - {{/notes}} - {{#hasParams}} - {{#summary}} - /// - {{/summary}} - {{^summary}} - {{#notes}} - /// - {{/notes}} - {{/summary}} - /// Parameters: - /// - {{/hasParams}} - {{#allParams}} - /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: - {{#description}} - /// {{{.}}} - {{/description}} - {{^-last}} - /// - {{/-last}} - {{/allParams}} - Future {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}}? {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { - // ignore: prefer_const_declarations - final path = r'{{{path}}}'{{#pathParams}} - .replaceAll({{=<% %>=}}'{<% baseName %>}'<%={{ }}=%>, {{{paramName}}}{{^isString}}.toString(){{/isString}}){{/pathParams}}; - - // ignore: prefer_final_locals - Object? postBody{{#bodyParam}} = {{{paramName}}}{{/bodyParam}}; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - {{#hasQueryParams}} - - {{#queryParams}} - {{^required}} - if ({{{paramName}}} != null) { - {{/required}} - queryParams.addAll(_queryParams('{{{collectionFormat}}}', '{{{baseName}}}', {{{paramName}}})); - {{^required}} - } - {{/required}} - {{/queryParams}} - {{/hasQueryParams}} - {{#hasHeaderParams}} - - {{#headerParams}} - {{#required}} - headerParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); - {{/required}} - {{^required}} - if ({{{paramName}}} != null) { - headerParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); - } - {{/required}} - {{/headerParams}} - {{/hasHeaderParams}} - - const contentTypes = [{{#prioritizedContentTypes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/prioritizedContentTypes}}]; - - {{#isMultipart}} - bool hasFields = false; - final mp = MultipartRequest('{{{httpMethod}}}', Uri.parse(path)); - {{#formParams}} - {{^isFile}} - if ({{{paramName}}} != null) { - hasFields = true; - mp.fields[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); - } - {{/isFile}} - {{#isFile}} - if ({{{paramName}}} != null) { - hasFields = true; - mp.fields[r'{{{baseName}}}'] = {{{paramName}}}.field; - mp.files.add({{{paramName}}}); - } - {{/isFile}} - {{/formParams}} - if (hasFields) { - postBody = mp; - } - {{/isMultipart}} - {{^isMultipart}} - {{#formParams}} - {{^isFile}} - if ({{{paramName}}} != null) { - formParams[r'{{{baseName}}}'] = parameterToString({{{paramName}}}); - } - {{/isFile}} - {{/formParams}} - {{/isMultipart}} - - return apiClient.invokeAPI( - path, - '{{{httpMethod}}}', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - {{#summary}} - /// {{{.}}} - {{/summary}} - {{#notes}} - {{#summary}} - /// - {{/summary}} - /// {{{notes}}} - {{/notes}} - {{#hasParams}} - {{#summary}} - /// - {{/summary}} - {{^summary}} - {{#notes}} - /// - {{/notes}} - {{/summary}} - /// Parameters: - /// - {{/hasParams}} - {{#allParams}} - /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: - {{#description}} - /// {{{.}}} - {{/description}} - {{^-last}} - /// - {{/-last}} - {{/allParams}} - Future<{{#returnType}}{{{.}}}?{{/returnType}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}}? {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { - final response = await {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{{paramName}}}: {{{paramName}}},{{^-last}} {{/-last}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - {{#returnType}} - // When a remote server returns no body with a status of 204, we shall not decode it. - // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" - // FormatException when trying to decode an empty string. - if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { - {{#native_serialization}} - {{#isArray}} - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, '{{{returnType}}}') as List) - .cast<{{{returnBaseType}}}>() - .{{#uniqueItems}}toSet(){{/uniqueItems}}{{^uniqueItems}}toList(growable: false){{/uniqueItems}}; - {{/isArray}} - {{^isArray}} - {{#isMap}} - return {{{returnType}}}.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}'),); - {{/isMap}} - {{^isMap}} - return await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}',) as {{{returnType}}}; - {{/isMap}}{{/isArray}}{{/native_serialization}} - } - return null; - {{/returnType}} - } - {{/operation}} -} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache deleted file mode 100644 index b340a9745757..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_client.mustache +++ /dev/null @@ -1,251 +0,0 @@ -{{>header}} -{{>part_of}} -class ApiClient { - ApiClient({this.basePath = '{{{basePath}}}', this.authentication,}); - - final String basePath; - final Authentication? authentication; - - var _client = Client(); - final _defaultHeaderMap = {}; - - /// Returns the current HTTP [Client] instance to use in this class. - /// - /// The return value is guaranteed to never be null. - Client get client => _client; - - /// Requests to use a new HTTP [Client] in this class. - set client(Client newClient) { - _client = newClient; - } - - Map get defaultHeaderMap => _defaultHeaderMap; - - void addDefaultHeader(String key, String value) { - _defaultHeaderMap[key] = value; - } - - // We don't use a Map for queryParams. - // If collectionFormat is 'multi', a key might appear multiple times. - Future invokeAPI( - String path, - String method, - List queryParams, - Object? body, - Map headerParams, - Map formParams, - String? contentType, - ) async { - await authentication?.applyToParams(queryParams, headerParams); - - headerParams.addAll(_defaultHeaderMap); - if (contentType != null) { - headerParams['Content-Type'] = contentType; - } - - final urlEncodedQueryParams = queryParams.map((param) => '$param'); - final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : ''; - final uri = Uri.parse('$basePath$path$queryString'); - - try { - // Special case for uploading a single file which isn't a 'multipart/form-data'. - if ( - body is MultipartFile && (contentType == null || - !contentType.toLowerCase().startsWith('multipart/form-data')) - ) { - final request = StreamedRequest(method, uri); - request.headers.addAll(headerParams); - request.contentLength = body.length; - body.finalize().listen( - request.sink.add, - onDone: request.sink.close, - // ignore: avoid_types_on_closure_parameters - onError: (Object error, StackTrace trace) => request.sink.close(), - cancelOnError: true, - ); - final response = await _client.send(request); - return Response.fromStream(response); - } - - if (body is MultipartRequest) { - final request = MultipartRequest(method, uri); - request.fields.addAll(body.fields); - request.files.addAll(body.files); - request.headers.addAll(body.headers); - request.headers.addAll(headerParams); - final response = await _client.send(request); - return Response.fromStream(response); - } - - final msgBody = contentType == 'application/x-www-form-urlencoded' - ? formParams - : await serializeAsync(body); - final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; - - switch(method) { - case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,); - case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,); - case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,); - case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,); - case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,); - case 'GET': return await _client.get(uri, headers: nullableHeaderParams,); - } - } on SocketException catch (error, trace) { - throw ApiException.withInner( - HttpStatus.badRequest, - 'Socket operation failed: $method $path', - error, - trace, - ); - } on TlsException catch (error, trace) { - throw ApiException.withInner( - HttpStatus.badRequest, - 'TLS/SSL communication failed: $method $path', - error, - trace, - ); - } on IOException catch (error, trace) { - throw ApiException.withInner( - HttpStatus.badRequest, - 'I/O operation failed: $method $path', - error, - trace, - ); - } on ClientException catch (error, trace) { - throw ApiException.withInner( - HttpStatus.badRequest, - 'HTTP connection failed: $method $path', - error, - trace, - ); - } on Exception catch (error, trace) { - throw ApiException.withInner( - HttpStatus.badRequest, - 'Exception occurred: $method $path', - error, - trace, - ); - } - - throw ApiException( - HttpStatus.badRequest, - 'Invalid HTTP operation: $method $path', - ); - } -{{#native_serialization}} - - Future deserializeAsync(String json, String targetType, {bool growable = false,}) async => - // ignore: deprecated_member_use_from_same_package - deserialize(json, targetType, growable: growable); - - @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') - dynamic deserialize(String json, String targetType, {bool growable = false,}) { - // Remove all spaces. Necessary for regular expressions as well. - targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments - - // If the expected target type is String, nothing to do... - return targetType == 'String' - ? json - : _deserialize(jsonDecode(json), targetType, growable: growable); - } -{{/native_serialization}} - - // ignore: deprecated_member_use_from_same_package - Future serializeAsync(Object? value) async => serialize(value); - - @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') - String serialize(Object? value) => value == null ? '' : json.encode(value); - -{{#native_serialization}} - static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) { - try { - switch (targetType) { - case 'String': - return value is String ? value : value.toString(); - case 'int': - return value is int ? value : int.parse('$value'); - case 'double': - return value is double ? value : double.parse('$value'); - case 'bool': - if (value is bool) { - return value; - } - final valueString = '$value'.toLowerCase(); - return valueString == 'true' || valueString == '1'; - case 'DateTime': - return value is DateTime ? value : DateTime.tryParse(value); - {{#models}} - {{#model}} - case '{{{classname}}}': - {{#isEnum}} - {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} - {{/isEnum}} - {{^isEnum}} - return {{{classname}}}.fromJson(value); - {{/isEnum}} - {{/model}} - {{/models}} - default: - dynamic match; - if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { - return value - .map((dynamic v) => _deserialize(v, match, growable: growable,)) - .toList(growable: growable); - } - if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) { - return value - .map((dynamic v) => _deserialize(v, match, growable: growable,)) - .toSet(); - } - if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) { - return Map.fromIterables( - value.keys.cast(), - value.values.map((dynamic v) => _deserialize(v, match, growable: growable,)), - ); - } - } - } on Exception catch (error, trace) { - throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); - } - throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); - } -{{/native_serialization}} -} -{{#native_serialization}} - -/// Primarily intended for use in an isolate. -class DeserializationMessage { - const DeserializationMessage({ - required this.json, - required this.targetType, - this.growable = false, - }); - - /// The JSON value to deserialize. - final String json; - - /// Target type to deserialize to. - final String targetType; - - /// Whether to make deserialized lists or maps growable. - final bool growable; -} - -/// Primarily intended for use in an isolate. -Future deserializeAsync(DeserializationMessage message) async { - // Remove all spaces. Necessary for regular expressions as well. - final targetType = message.targetType.replaceAll(' ', ''); - - // If the expected target type is String, nothing to do... - return targetType == 'String' - ? message.json - : ApiClient._deserialize( - jsonDecode(message.json), - targetType, - growable: message.growable, - ); -} -{{/native_serialization}} - -/// Primarily intended for use in an isolate. -Future serializeAsync(Object? value) async => value == null ? '' : json.encode(value); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache deleted file mode 100644 index 3332ff1f205d..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_doc.mustache +++ /dev/null @@ -1,96 +0,0 @@ -# {{{pubName}}}.api.{{{classname}}}{{#description}} -{{{.}}}{{/description}} - -## Load the API package -```dart -import 'package:{{{pubName}}}/api.dart'; -``` - -All URIs are relative to *{{{basePath}}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -# **{{{operationId}}}** -> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -### Example -```dart -import 'package:{{{pubName}}}/api.dart'; -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} -// TODO Configure HTTP basic authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; -{{/isBasicBasic}} -{{#isBasicBearer}} -// TODO Configure HTTP Bearer authorization: {{{name}}} -// Case 1. Use String Token -//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN'); -// Case 2. Use Function which generate token. -// String yourTokenGeneratorFunction() { ... } -//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction); -{{/isBasicBearer}} -{{/isBasic}} -{{#isApiKey}} -// TODO Configure API key authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; -{{/isApiKey}} -{{#isOAuth}} -// TODO Configure OAuth2 access token for authorization: {{{name}}} -//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} - -final api_instance = {{{classname}}}(); -{{#allParams}} -final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); - {{#returnType}} - print(result); - {{/returnType}} -} catch (e) { - print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n'); -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{{returnBaseType}}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache deleted file mode 100644 index aeb7aa9ce226..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_exception.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{>header}} -{{>part_of}} -class ApiException implements Exception { - ApiException(this.code, this.message); - - ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); - - int code = 0; - String? message; - Exception? innerException; - StackTrace? stackTrace; - - @override - String toString() { - if (message == null) { - return 'ApiException'; - } - if (innerException == null) { - return 'ApiException $code: $message'; - } - return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; - } -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache deleted file mode 100644 index ec98b7d1d741..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_helper.mustache +++ /dev/null @@ -1,100 +0,0 @@ -{{>header}} -{{>part_of}} -class QueryParam { - const QueryParam(this.name, this.value); - - final String name; - final String value; - - @override - String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; -} - -// Ported from the Java version. -Iterable _queryParams(String collectionFormat, String name, dynamic value,) { - // Assertions to run in debug mode only. - assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); - - final params = []; - - if (value is List) { - if (collectionFormat == 'multi') { - return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); - } - - // Default collection format is 'csv'. - if (collectionFormat.isEmpty) { - collectionFormat = 'csv'; // ignore: parameter_assignments - } - - final delimiter = _delimiters[collectionFormat] ?? ','; - - params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); - } else if (value != null) { - params.add(QueryParam(name, parameterToString(value))); - } - - return params; -} - -/// Format the given parameter object into a [String]. -String parameterToString(dynamic value) { - if (value == null) { - return ''; - } - if (value is DateTime) { - return value.toUtc().toIso8601String(); - } - {{#models}} - {{#model}} - {{#isEnum}} - if (value is {{{classname}}}) { -{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}} - } - {{/isEnum}} - {{/model}} - {{/models}} - return value.toString(); -} - -/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' -/// content type. Otherwise, returns the decoded body as decoded by dart:http package. -Future _decodeBodyBytes(Response response) async { - final contentType = response.headers['content-type']; - return contentType != null && contentType.toLowerCase().startsWith('application/json') - ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes) - : response.body; -} - -/// Returns a valid [T] value found at the specified Map [key], null otherwise. -T? mapValueOfType(dynamic map, String key) { - final dynamic value = map is Map ? map[key] : null; - return value is T ? value : null; -} - -/// Returns a valid Map found at the specified Map [key], null otherwise. -Map? mapCastOfType(dynamic map, String key) { - final dynamic value = map is Map ? map[key] : null; - return value is Map ? value.cast() : null; -} - -/// Returns a valid [DateTime] found at the specified Map [key], null otherwise. -DateTime? mapDateTime(dynamic map, String key, [String? pattern]) { - final dynamic value = map is Map ? map[key] : null; - if (value != null) { - int? millis; - if (value is int) { - millis = value; - } else if (value is String) { - if (pattern == _dateEpochMarker) { - millis = int.tryParse(value); - } else { - return DateTime.tryParse(value); - } - } - if (millis != null) { - return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true); - } - } - return null; -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache deleted file mode 100644 index 442885a38ae6..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/api_test.mustache +++ /dev/null @@ -1,29 +0,0 @@ -{{>header}} -import 'package:{{{pubName}}}/api.dart'; -import 'package:test/test.dart'; - -{{#operations}} - -/// tests for {{{classname}}} -void main() { - // final instance = {{{classname}}}(); - - group('tests for {{{classname}}}', () { - {{#operation}} - {{#summary}} - // {{{.}}} - // - {{/summary}} - {{#notes}} - // {{{.}}} - // - {{/notes}} - //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async - test('test {{{operationId}}}', () async { - - }); - - {{/operation}} - }); -} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache deleted file mode 100644 index 2fcebda4ea46..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/apilib.mustache +++ /dev/null @@ -1,33 +0,0 @@ -{{>header}} -{{#pubLibrary}}library {{{.}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} - -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -import 'package:http/http.dart'; -import 'package:intl/intl.dart'; -import 'package:meta/meta.dart'; - -part 'api_client.dart'; -part 'api_helper.dart'; -part 'api_exception.dart'; -part 'auth/authentication.dart'; -part 'auth/api_key_auth.dart'; -part 'auth/oauth.dart'; -part 'auth/http_basic_auth.dart'; -part 'auth/http_bearer_auth.dart'; - -{{#apiInfo}}{{#apis}}part 'api/{{{classFilename}}}.dart'; -{{/apis}}{{/apiInfo}} -{{#models}}{{#model}}part 'model/{{{classFilename}}}.dart'; -{{/model}}{{/models}} - -const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; -const _dateEpochMarker = 'epoch'; -final _dateFormatter = DateFormat('yyyy-MM-dd'); -final _regList = RegExp(r'^List<(.*)>$'); -final _regSet = RegExp(r'^Set<(.*)>$'); -final _regMap = RegExp(r'^Map$'); - -ApiClient defaultApiClient = ApiClient(); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache deleted file mode 100644 index 4b8f707eeb5f..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/api_key_auth.mustache +++ /dev/null @@ -1,30 +0,0 @@ -{{>header}} -{{>part_of}} -class ApiKeyAuth implements Authentication { - ApiKeyAuth(this.location, this.paramName); - - final String location; - final String paramName; - - String apiKeyPrefix = ''; - String apiKey = ''; - - @override - Future applyToParams(List queryParams, Map headerParams,) async { - final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; - - if (paramValue.isNotEmpty) { - if (location == 'query') { - queryParams.add(QueryParam(paramName, paramValue)); - } else if (location == 'header') { - headerParams[paramName] = paramValue; - } else if (location == 'cookie') { - headerParams.update( - 'Cookie', - (existingCookie) => '$existingCookie; $paramName=$paramValue', - ifAbsent: () => '$paramName=$paramValue', - ); - } - } - } -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache deleted file mode 100644 index 6eff61ede0ec..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/authentication.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{{>header}} -{{>part_of}} -// ignore: one_member_abstracts -abstract class Authentication { - /// Apply authentication settings to header and query params. - Future applyToParams(List queryParams, Map headerParams); -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache deleted file mode 100644 index 3799d9d04658..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/header.mustache +++ /dev/null @@ -1,9 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache deleted file mode 100644 index c83d037c7991..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_basic_auth.mustache +++ /dev/null @@ -1,16 +0,0 @@ -{{>header}} -{{>part_of}} -class HttpBasicAuth implements Authentication { - HttpBasicAuth({this.username = '', this.password = ''}); - - String username; - String password; - - @override - Future applyToParams(List queryParams, Map headerParams,) async { - if (username.isNotEmpty && password.isNotEmpty) { - final credentials = '$username:$password'; - headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; - } - } -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache deleted file mode 100644 index 6c1d3c0e843d..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/http_bearer_auth.mustache +++ /dev/null @@ -1,39 +0,0 @@ -{{>header}} -{{>part_of}} -typedef HttpBearerAuthProvider = String Function(); - -class HttpBearerAuth implements Authentication { - HttpBearerAuth(); - - dynamic _accessToken; - - dynamic get accessToken => _accessToken; - - set accessToken(dynamic accessToken) { - if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { - throw ArgumentError('accessToken value must be either a String or a String Function().'); - } - _accessToken = accessToken; - } - - @override - Future applyToParams(List queryParams, Map headerParams,) async { - if (_accessToken == null) { - return; - } - - String accessToken; - - if (_accessToken is String) { - accessToken = _accessToken; - } else if (_accessToken is HttpBearerAuthProvider) { - accessToken = _accessToken!(); - } else { - return; - } - - if (accessToken.isNotEmpty) { - headerParams['Authorization'] = 'Bearer $accessToken'; - } - } -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache deleted file mode 100644 index 0e65baa4c637..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/oauth.mustache +++ /dev/null @@ -1,14 +0,0 @@ -{{>header}} -{{>part_of}} -class OAuth implements Authentication { - OAuth({this.accessToken = ''}); - - String accessToken; - - @override - Future applyToParams(List queryParams, Map headerParams,) async { - if (accessToken.isNotEmpty) { - headerParams['Authorization'] = 'Bearer $accessToken'; - } - } -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache deleted file mode 100644 index d31ade250360..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/auth/part_of.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache deleted file mode 100644 index dc5dfec5f2a7..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/dart_constructor.mustache +++ /dev/null @@ -1,10 +0,0 @@ - /// Returns a new [{{{classname}}}] instance. - {{{classname}}}({ - {{#vars}} - {{! - A field is required in Dart when it is - required && !defaultValue in OAS - }} - {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, - {{/vars}} - }); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache deleted file mode 100755 index 0e3776ae6dd4..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache deleted file mode 100644 index 1be28ced0940..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/gitignore.mustache +++ /dev/null @@ -1,17 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -.dart_tool/ -.packages -build/ -pubspec.lock # Except for application packages - -doc/api/ - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache deleted file mode 100644 index 3799d9d04658..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/header.mustache +++ /dev/null @@ -1,9 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache deleted file mode 100644 index 306c54e417e6..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/model.mustache +++ /dev/null @@ -1,16 +0,0 @@ -{{>header}} -{{>part_of}} -{{#models}} -{{#model}} -{{#isEnum}} -{{#native_serialization}} -{{>serialization/native/native_enum}} -{{/native_serialization}} -{{/isEnum}} -{{^isEnum}} -{{#native_serialization}} -{{>serialization/native/native_class}} -{{/native_serialization}} -{{/isEnum}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache deleted file mode 100644 index 53facddb67be..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/model_test.mustache +++ /dev/null @@ -1,29 +0,0 @@ -{{>header}} -{{#models}} -{{#model}} -import 'package:{{{pubName}}}/api.dart'; -import 'package:test/test.dart'; - -// tests for {{{classname}}} -void main() { - {{^isEnum}} - // final instance = {{{classname}}}(); - {{/isEnum}} - - group('test {{{classname}}}', () { - {{#vars}} - {{#description}} - // {{{.}}} - {{/description}} - // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} - test('to test the property `{{{name}}}`', () async { - - }); - - {{/vars}} - - }); - -} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache deleted file mode 100644 index 441b2c7bd1bb..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/object_doc.mustache +++ /dev/null @@ -1,16 +0,0 @@ -{{#models}}{{#model}}# {{{pubName}}}.model.{{{classname}}} - -## Load the model package -```dart -import 'package:{{{pubName}}}/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache deleted file mode 100644 index d31ade250360..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/part_of.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache deleted file mode 100644 index 0b054d73d5c2..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/pubspec.mustache +++ /dev/null @@ -1,25 +0,0 @@ -# -# AUTO-GENERATED FILE, DO NOT MODIFY! -# - -name: '{{{pubName}}}' -version: '{{{pubVersion}}}' -description: '{{{pubDescription}}}' -homepage: '{{{pubHomepage}}}' -{{#pubRepository}} -repository: {{.}} -{{/pubRepository}} -{{#pubPublishTo}} -publish_to: {{.}} -{{/pubPublishTo}} -environment: - sdk: '>=2.12.0 <3.0.0' -dependencies: - http: '>=0.13.0 <0.14.0' - intl: '^0.17.0' - meta: '^1.1.8' -dev_dependencies: - test: '>=1.16.0 <1.18.0' -{{#json_serializable}} - build_runner: '^1.10.9' - json_serializable: '^3.5.1'{{/json_serializable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache deleted file mode 100644 index a8a6273cf280..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_class.mustache +++ /dev/null @@ -1,301 +0,0 @@ -class {{{classname}}} { -{{>dart_constructor}} -{{#vars}} - {{#description}} - /// {{{.}}} - {{/description}} - {{^isEnum}} - {{#minimum}} - {{#description}} - /// - {{/description}} - /// Minimum value: {{{.}}} - {{/minimum}} - {{#maximum}} - {{#description}} - {{^minimum}} - /// - {{/minimum}} - {{/description}} - /// Maximum value: {{{.}}} - {{/maximum}} - {{^isNullable}} - {{^required}} - {{^defaultValue}} - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - {{/defaultValue}} - {{/required}} - {{/isNullable}} - {{/isEnum}} - {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; - -{{/vars}} - @override - bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && - {{#vars}} - other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} - {{/vars}} - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - {{#vars}} - ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} - {{/vars}} - - @override - String toString() => '{{{classname}}}[{{#vars}}{{{name}}}=${{{name}}}{{^-last}}, {{/-last}}{{/vars}}]'; - - Map toJson() { - final json = {}; - {{#vars}} - {{#isNullable}} - if (this.{{{name}}} != null) { - {{/isNullable}} - {{^isNullable}} - {{^required}} - {{^defaultValue}} - if (this.{{{name}}} != null) { - {{/defaultValue}} - {{/required}} - {{/isNullable}} - {{#isDateTime}} - {{#pattern}} - json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' - ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); - {{/pattern}} - {{^pattern}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); - {{/pattern}} - {{/isDateTime}} - {{#isDate}} - {{#pattern}} - json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' - ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); - {{/pattern}} - {{^pattern}} - json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); - {{/pattern}} - {{/isDate}} - {{^isDateTime}} - {{^isDate}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!{{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; - {{/isDate}} - {{/isDateTime}} - {{#isNullable}} - } else { - json[r'{{{baseName}}}'] = null; - } - {{/isNullable}} - {{^isNullable}} - {{^required}} - {{^defaultValue}} - } else { - json[r'{{{baseName}}}'] = null; - } - {{/defaultValue}} - {{/required}} - {{/isNullable}} - {{/vars}} - return json; - } - - /// Returns a new [{{{classname}}}] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static {{{classname}}}? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), 'Required key "{{{classname}}}[$key]" is missing from JSON.'); - assert(json[key] != null, 'Required key "{{{classname}}}[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return {{{classname}}}( - {{#vars}} - {{#isDateTime}} - {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isDateTime}} - {{#isDate}} - {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isDate}} - {{^isDateTime}} - {{^isDate}} - {{#complexType}} - {{#isArray}} - {{#items.isArray}} - {{{name}}}: json[r'{{{baseName}}}'] is List - ? (json[r'{{{baseName}}}'] as List).map((e) => - {{#items.complexType}} - {{items.complexType}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}} - {{/items.complexType}} - {{^items.complexType}} - e == null ? {{#items.isNullable}}null{{/items.isNullable}}{{^items.isNullable}}const <{{items.items.dataType}}>[]{{/items.isNullable}} : (e as List).cast<{{items.items.dataType}}>() - {{/items.complexType}} - ).toList() - : {{#isNullable}}null{{/isNullable}}{{^isNullable}}const []{{/isNullable}}, - {{/items.isArray}} - {{^items.isArray}} - {{{name}}}: {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}}, - {{/items.isArray}} - {{/isArray}} - {{^isArray}} - {{#isMap}} - {{#items.isArray}} - {{{name}}}: json[r'{{{baseName}}}'] == null - ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} - {{#items.complexType}} - : {{items.complexType}}.mapListFromJson(json[r'{{{baseName}}}']), - {{/items.complexType}} - {{^items.complexType}} - : mapCastOfType(json, r'{{{baseName}}}'), - {{/items.complexType}} - {{/items.isArray}} - {{^items.isArray}} - {{#items.isMap}} - {{#items.complexType}} - {{{name}}}: {{items.complexType}}.mapFromJson(json[r'{{{baseName}}}']), - {{/items.complexType}} - {{^items.complexType}} - {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/items.complexType}} - {{/items.isMap}} - {{^items.isMap}} - {{#items.complexType}} - {{{name}}}: {{{items.complexType}}}.mapFromJson(json[r'{{{baseName}}}']), - {{/items.complexType}} - {{^items.complexType}} - {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/items.complexType}} - {{/items.isMap}} - {{/items.isArray}} - {{/isMap}} - {{^isMap}} - {{#isBinary}} - {{{name}}}: null, // No support for decoding binary content from JSON - {{/isBinary}} - {{^isBinary}} - {{{name}}}: {{{complexType}}}.fromJson(json[r'{{{baseName}}}']){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isBinary}} - {{/isMap}} - {{/isArray}} - {{/complexType}} - {{^complexType}} - {{#isArray}} - {{#isEnum}} - {{{name}}}: {{{items.datatypeWithEnum}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}}, - {{/isEnum}} - {{^isEnum}} - {{{name}}}: json[r'{{{baseName}}}'] is Iterable - ? (json[r'{{{baseName}}}'] as Iterable).cast<{{{items.datatype}}}>().{{#uniqueItems}}toSet(){{/uniqueItems}}{{^uniqueItems}}toList(growable: false){{/uniqueItems}} - : {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}, - {{/isEnum}} - {{/isArray}} - {{^isArray}} - {{#isMap}} - {{{name}}}: mapCastOfType(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isMap}} - {{^isMap}} - {{#isNumber}} - {{{name}}}: json[r'{{{baseName}}}'] == null - ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} - : {{{datatypeWithEnum}}}.parse(json[r'{{{baseName}}}'].toString()), - {{/isNumber}} - {{^isNumber}} - {{^isEnum}} - {{{name}}}: mapValueOfType<{{{datatypeWithEnum}}}>(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isEnum}} - {{#isEnum}} - {{{name}}}: {{{enumName}}}.fromJson(json[r'{{{baseName}}}']){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, - {{/isEnum}} - {{/isNumber}} - {{/isMap}} - {{/isArray}} - {{/complexType}} - {{/isDate}} - {{/isDateTime}} - {{/vars}} - ); - } - return null; - } - - static List<{{{classname}}}> listFromJson(dynamic json, {bool growable = false,}) { - final result = <{{{classname}}}>[]; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = {{{classname}}}.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = {{{classname}}}.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of {{{classname}}}-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = {{{classname}}}.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { -{{#vars}} - {{#required}} - '{{{baseName}}}', - {{/required}} -{{/vars}} - }; -} -{{#vars}} - {{^isModel}} - {{#isEnum}} - {{^isContainer}} - -{{>serialization/native/native_enum_inline}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} - -{{>serialization/native/native_enum_inline}} - {{/mostInnerItems}} - {{/isContainer}} - {{/isEnum}} - {{/isModel}} -{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache deleted file mode 100644 index 84217b702b9e..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum.mustache +++ /dev/null @@ -1,81 +0,0 @@ -{{#description}}/// {{{.}}}{{/description}} -class {{{classname}}} { - /// Instantiate a new enum with the provided [value]. - const {{{classname}}}._(this.value); - - /// The underlying value of this enum member. - final {{{dataType}}} value; - - @override - String toString() => {{#isString}}value{{/isString}}{{^isString}}value.toString(){{/isString}}; - - {{{dataType}}} toJson() => value; - - {{#allowableValues}} - {{#enumVars}} - static const {{{name}}} = {{{classname}}}._({{#isString}}r{{/isString}}{{{value}}}); - {{/enumVars}} - {{/allowableValues}} - - /// List of all possible values in this [enum][{{{classname}}}]. - static const values = <{{{classname}}}>[ - {{#allowableValues}} - {{#enumVars}} - {{{name}}}, - {{/enumVars}} - {{/allowableValues}} - ]; - - static {{{classname}}}? fromJson(dynamic value) => {{{classname}}}TypeTransformer().decode(value); - - static List<{{{classname}}}> listFromJson(dynamic json, {bool growable = false,}) { - final result = <{{{classname}}}>[]; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = {{{classname}}}.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [{{{classname}}}] to {{{dataType}}}, -/// and [decode] dynamic data back to [{{{classname}}}]. -class {{{classname}}}TypeTransformer { - factory {{{classname}}}TypeTransformer() => _instance ??= const {{{classname}}}TypeTransformer._(); - - const {{{classname}}}TypeTransformer._(); - - {{{dataType}}} encode({{{classname}}} data) => data.value; - - /// Decodes a [dynamic value][data] to a {{{classname}}}. - /// - /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, - /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] - /// cannot be decoded successfully, then an [UnimplementedError] is thrown. - /// - /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, - /// and users are still using an old app with the old code. - {{{classname}}}? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - {{#allowableValues}} - {{#enumVars}} - case {{#isString}}r{{/isString}}{{{value}}}: return {{{classname}}}.{{{name}}}; - {{/enumVars}} - {{/allowableValues}} - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [{{{classname}}}TypeTransformer] instance. - static {{{classname}}}TypeTransformer? _instance; -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache deleted file mode 100644 index 1fe4428dcb31..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/serialization/native/native_enum_inline.mustache +++ /dev/null @@ -1,81 +0,0 @@ -{{#description}}/// {{{.}}}{{/description}} -class {{{enumName}}} { - /// Instantiate a new enum with the provided [value]. - const {{{enumName}}}._(this.value); - - /// The underlying value of this enum member. - final {{{dataType}}} value; - - @override - String toString() => {{#isString}}value{{/isString}}{{^isString}}value.toString(){{/isString}}; - - {{{dataType}}} toJson() => value; - - {{#allowableValues}} - {{#enumVars}} - static const {{{name}}} = {{{enumName}}}._({{#isString}}r{{/isString}}{{{value}}}); - {{/enumVars}} - {{/allowableValues}} - - /// List of all possible values in this [enum][{{{enumName}}}]. - static const values = <{{{enumName}}}>[ - {{#allowableValues}} - {{#enumVars}} - {{{name}}}, - {{/enumVars}} - {{/allowableValues}} - ]; - - static {{{enumName}}}? fromJson(dynamic value) => {{{enumName}}}TypeTransformer().decode(value); - - static List<{{{enumName}}}> listFromJson(dynamic json, {bool growable = false,}) { - final result = <{{{enumName}}}>[]; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = {{{enumName}}}.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [{{{enumName}}}] to {{{dataType}}}, -/// and [decode] dynamic data back to [{{{enumName}}}]. -class {{{enumName}}}TypeTransformer { - factory {{{enumName}}}TypeTransformer() => _instance ??= const {{{enumName}}}TypeTransformer._(); - - const {{{enumName}}}TypeTransformer._(); - - {{{dataType}}} encode({{{enumName}}} data) => data.value; - - /// Decodes a [dynamic value][data] to a {{{enumName}}}. - /// - /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, - /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] - /// cannot be decoded successfully, then an [UnimplementedError] is thrown. - /// - /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, - /// and users are still using an old app with the old code. - {{{enumName}}}? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - {{#allowableValues}} - {{#enumVars}} - case {{#isString}}r{{/isString}}{{{value}}}: return {{{enumName}}}.{{{name}}}; - {{/enumVars}} - {{/allowableValues}} - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [{{{enumName}}}TypeTransformer] instance. - static {{{enumName}}}TypeTransformer? _instance; -} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache deleted file mode 100644 index 2774ccbba0e9..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/libraries/http/travis.mustache +++ /dev/null @@ -1,14 +0,0 @@ -# -# AUTO-GENERATED FILE, DO NOT MODIFY! -# -# https://docs.travis-ci.com/user/languages/dart/ -# -language: dart -dart: -# Install a specific stable release -- "2.12" -install: -- pub get - -script: -- pub run test diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache deleted file mode 100644 index 1105c1b70b10..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/class_inline_enums.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{! - Generate an enum for any variables that are declared as inline enums - isEnum is only true for inline variables that are enums. - If an enum is declared as a definition, isEnum is false and the enum is generated from the - enum.mustache template. - enumName only exists for inline enums -}} -{{#vars}} - {{^isModel}} - {{#enumName}} - {{^isContainer}} - -{{>serialization/built_value/enum_inline}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} - -{{>serialization/built_value/enum_inline}} - {{/mostInnerItems}} - {{/isContainer}} - {{/enumName}} - {{/isModel}} -{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache deleted file mode 100644 index c76dde39a9c9..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_serializer_type.mustache +++ /dev/null @@ -1 +0,0 @@ -FullType{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{baseType}}, [{{#isMap}}FullType(String), {{/isMap}}{{#items}}{{>serialization/built_value/variable_serializer_type}}{{/items}}]{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache deleted file mode 100644 index 136545525cac..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/serialization/built_value/variable_type.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache deleted file mode 100644 index f3e9445798f9..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/serialization/json_serializable/repository_impl.mustache +++ /dev/null @@ -1,75 +0,0 @@ -import 'dart:convert'; -import 'dart:typed_data'; -import 'repository_base.dart'; -import 'package:{{pubName}}/models.dart'; - -class JsonSerializableRepository extends SerializationRepositoryBase { - JsonSerializableRepository(); - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return jsonEncode(src); - } - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - Object valueParsed; - if (context == 'decodedJson') { - //if we are deserializing a decoded json, don't decode it again. - valueParsed = value; - } else { - valueParsed = jsonDecode(value.toString()) as Object; - } - switch (targetTypeInfo.root) { - case String: - return valueParsed as T; - case int: - return (valueParsed is num ? valueParsed.toInt() : int.parse(valueParsed.toString())) as T; - case bool: - if (valueParsed is bool) { - return valueParsed as T; - } - final valueString = valueParsed.toString().toLowerCase(); - return (valueString == 'true' || valueString == '1') as T; - case double: - return (valueParsed is num ? valueParsed.toDouble() : double.parse(valueParsed.toString())) as T; - {{! TODO: add support for DateTime? }} - {{#models}} - {{#model}} - case {{{classname}}}: - {{#isEnum}} - {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(valueParsed);{{/native_serialization}} - {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, valueParsed);{{/json_serializable}} - {{/isEnum}} - {{^isEnum}} - return {{{classname}}}.fromJson(valueParsed as Map) as T; - {{/isEnum}} - {{/model}} - {{/models}} - default: - RegExpMatch? match; - - if (valueParsed is List && (match = _regList.firstMatch(targetTypeInfo)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return valueParsed - .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) - .toList(growable: growable) as T; - } - if (valueParsed is Set && (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return valueParsed - .map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)) - .toSet() as T; - } - if (valueParsed is Map && (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - valueParsed.keys, - valueParsed.values.map((dynamic v) => deserialize(v, targetTypeInfo, growable: growable)), - ) as T; - } - break; - } - throw Exception('Cannot deserialize'); - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type.mustache deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache b/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache deleted file mode 100644 index 00306c3fe3c4..000000000000 --- a/modules/openapi-generator/src/main/resources/dart/types/recursion_base_type_info.mustache +++ /dev/null @@ -1,10 +0,0 @@ -{{! Prefer working with schemas}} -const TypeInfo{{#isNullable}}.nullable{{/isNullable}}( - {{#isContainer}}{{baseType}}, [ - {{#isMap}}TypeInfo(String), {{/isMap}} - {{#items}}{{>types/recursion_base_type_info}}{{/items}}, - ]{{/isContainer}}{{^isContainer}} - {{#baseType}}{{{.}}}{{/baseType}} - {{^baseType}}{{{dataType}}}{{/baseType}} - {{/isContainer}}) - diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java index 1967ceb66724..6bd4b3685bb0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java @@ -121,6 +121,6 @@ public void verifyDartDioGeneratorRuns() throws IOException { files.forEach(File::deleteOnExit); TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "lib/src/api.dart"); + TestUtils.ensureContainsFile(files, output, "lib/apis.dart"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java new file mode 100644 index 000000000000..8611a8040de0 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientCodegenTest.java @@ -0,0 +1,126 @@ +/* + * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.dart.next; + +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.Generator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.languages.DartNextClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +public class DartNextClientCodegenTest { + + @Test + public void testInitialConfigValues() throws Exception { + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assert.assertTrue(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testInitialFeatures() { + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.processOpts(); + + Assert.assertNotNull(codegen.getFeatureSet().getSecurityFeatures()); + Assert.assertFalse(codegen.getFeatureSet().getSecurityFeatures().isEmpty()); + } + + @Test + public void testSettersForConfigValues() throws Exception { + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); + } + + @Test + public void testKeywords() { + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + + List reservedWordsList = new ArrayList<>(); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8)); + while(reader.ready()) { reservedWordsList.add(reader.readLine()); } + reader.close(); + } catch (Exception e) { + String errorString = String.format(Locale.ROOT, "Error reading dart keywords: %s", e); + Assert.fail(errorString, e); + } + + Assert.assertTrue(reservedWordsList.size() > 20); + Assert.assertEquals(codegen.reservedWords().size(), reservedWordsList.size()); + for(String keyword : reservedWordsList) { + // reserved words are stored in lowercase + Assert.assertTrue(codegen.reservedWords().contains(keyword.toLowerCase(Locale.ROOT)), String.format(Locale.ROOT, "%s, part of %s, was not found in %s", keyword, reservedWordsList, codegen.reservedWords().toString())); + } + } + + @Test + public void verifyDartNextGeneratorRuns() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("dart-next") + .setGitUserId("my-user") + .setGitRepoId("my-repo") + .setPackageName("my-package") + .setInputSpec("src/test/resources/3_0/petstore.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + ClientOptInput opts = configurator.toClientOptInput(); + + Generator generator = new DefaultGenerator().opts(opts); + List files = generator.generate(); + files.forEach(File::deleteOnExit); + + TestUtils.ensureContainsFile(files, output, "README.md"); + TestUtils.ensureContainsFile(files, output, "lib/apis.dart"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java new file mode 100644 index 000000000000..bc49b234cebf --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextClientOptionsTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.dart.next; + +import org.openapitools.codegen.AbstractOptionsTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.DartNextClientCodegen; +import org.openapitools.codegen.options.DartNextClientOptionsProvider; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class DartNextClientOptionsTest extends AbstractOptionsTest { + private DartNextClientCodegen clientCodegen = mock(DartNextClientCodegen.class, mockSettings); + + public DartNextClientOptionsTest() { + super(new DartNextClientOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(DartNextClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setPubLibrary(DartNextClientOptionsProvider.PUB_LIBRARY_VALUE); + verify(clientCodegen).setPubName(DartNextClientOptionsProvider.PUB_NAME_VALUE); + verify(clientCodegen).setPubVersion(DartNextClientOptionsProvider.PUB_VERSION_VALUE); + verify(clientCodegen).setPubDescription(DartNextClientOptionsProvider.PUB_DESCRIPTION_VALUE); + verify(clientCodegen).setPubAuthor(DartNextClientOptionsProvider.PUB_AUTHOR_VALUE); + verify(clientCodegen).setPubAuthorEmail(DartNextClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); + verify(clientCodegen).setPubHomepage(DartNextClientOptionsProvider.PUB_HOMEPAGE_VALUE); + verify(clientCodegen).setPubRepository(DartNextClientOptionsProvider.PUB_REPOSITORY_VALUE); + verify(clientCodegen).setPubPublishTo(DartNextClientOptionsProvider.PUB_PUBLISH_TO_VALUE); + verify(clientCodegen).setSourceFolder(DartNextClientOptionsProvider.SOURCE_FOLDER_VALUE); + verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartNextClientOptionsProvider.USE_ENUM_EXTENSION)); + verify(clientCodegen).setDateLibrary(DartNextClientCodegen.DATE_LIBRARY_DEFAULT); + verify(clientCodegen).setLibrary(DartNextClientCodegen.NETWORKING_LIBRARY_DEFAULT); + verify(clientCodegen).setSerializationLibrary(DartNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartNextClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java new file mode 100644 index 000000000000..8a9066ab208a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java @@ -0,0 +1,495 @@ +/* + * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.dart.next; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.*; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.DartNextClientCodegen; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@SuppressWarnings("static-method") +public class DartNextModelTest { + + @Test(description = "convert a simple model") + public void simpleModelTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema()) + .addProperties("name", new StringSchema()) + .addProperties("createdAt", new DateTimeSchema()) + .addRequiredItem("id") + .addRequiredItem("name"); + final DefaultCodegen codegen = new DartNextClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 3); + // {{imports}} is not used in template + //Assert.assertEquals(cm.imports.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "int"); + Assert.assertEquals(property1.name, "id"); + Assert.assertNull(property1.defaultValue); + Assert.assertEquals(property1.baseType, "int"); + Assert.assertTrue(property1.required); + Assert.assertTrue(property1.isPrimitiveType); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.dataType, "String"); + Assert.assertEquals(property2.name, "name"); + Assert.assertNull(property2.defaultValue); + Assert.assertEquals(property2.baseType, "String"); + Assert.assertTrue(property2.required); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertFalse(property2.isContainer); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(property3.complexType, "DateTime"); + Assert.assertEquals(property3.dataType, "DateTime"); + Assert.assertEquals(property3.name, "createdAt"); + Assert.assertNull(property3.defaultValue); + Assert.assertEquals(property3.baseType, "DateTime"); + Assert.assertFalse(property3.required); + Assert.assertFalse(property3.isContainer); + } + + @Test(description = "convert a simple dart-dit model with datelibrary") + public void simpleModelWithTimeMachineTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema()) + .addProperties("name", new StringSchema()) + .addProperties("createdAt", new DateTimeSchema()) + .addProperties("birthDate", new DateSchema()) + .addRequiredItem("id") + .addRequiredItem("name"); + + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_TIME_MACHINE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 4); + // {{imports}} is not used in template + //Assert.assertEquals(cm.imports.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "int"); + Assert.assertEquals(property1.name, "id"); + Assert.assertNull(property1.defaultValue); + Assert.assertEquals(property1.baseType, "int"); + Assert.assertTrue(property1.required); + Assert.assertTrue(property1.isPrimitiveType); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.dataType, "String"); + Assert.assertEquals(property2.name, "name"); + Assert.assertNull(property2.defaultValue); + Assert.assertEquals(property2.baseType, "String"); + Assert.assertTrue(property2.required); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertFalse(property2.isContainer); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(property3.complexType, "OffsetDateTime"); + Assert.assertEquals(property3.dataType, "OffsetDateTime"); + Assert.assertEquals(property3.name, "createdAt"); + Assert.assertNull(property3.defaultValue); + Assert.assertEquals(property3.baseType, "OffsetDateTime"); + Assert.assertFalse(property3.required); + Assert.assertFalse(property3.isContainer); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(property4.complexType, "OffsetDate"); + Assert.assertEquals(property4.dataType, "OffsetDate"); + Assert.assertEquals(property4.name, "birthDate"); + Assert.assertNull(property4.defaultValue); + Assert.assertEquals(property4.baseType, "OffsetDate"); + Assert.assertFalse(property4.required); + Assert.assertFalse(property4.isContainer); + } + + @Test(description = "convert a model with list property") + public void listPropertyTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema()) + .addProperties("urls", new ArraySchema() + .items(new StringSchema())) + .addRequiredItem("id"); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 2); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "int"); + Assert.assertEquals(property1.name, "id"); + Assert.assertNull(property1.defaultValue); + Assert.assertEquals(property1.baseType, "int"); + Assert.assertTrue(property1.required); + Assert.assertTrue(property1.isPrimitiveType); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "urls"); + Assert.assertEquals(property2.dataType, "BuiltList"); + Assert.assertEquals(property2.name, "urls"); + Assert.assertEquals(property2.baseType, "BuiltList"); + Assert.assertEquals(property2.containerType, "array"); + Assert.assertFalse(property2.required); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertTrue(property2.isContainer); + } + + @Test(description = "convert a model with set property") + public void setPropertyTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema()) + .addProperties("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true)) + .addRequiredItem("id"); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 2); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "int"); + Assert.assertEquals(property1.name, "id"); + Assert.assertNull(property1.defaultValue); + Assert.assertEquals(property1.baseType, "int"); + Assert.assertTrue(property1.required); + Assert.assertTrue(property1.isPrimitiveType); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "urls"); + Assert.assertEquals(property2.dataType, "BuiltSet"); + Assert.assertEquals(property2.name, "urls"); + Assert.assertEquals(property2.baseType, "BuiltSet"); + Assert.assertEquals(property2.containerType, "set"); + Assert.assertFalse(property2.required); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertTrue(property2.isContainer); + } + + @Test(description = "convert a model with a map property") + public void mapPropertyTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("translations", new MapSchema() + .additionalProperties(new StringSchema())) + .addRequiredItem("id"); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "translations"); + Assert.assertEquals(property1.dataType, "BuiltMap"); + Assert.assertEquals(property1.name, "translations"); + Assert.assertEquals(property1.baseType, "BuiltMap"); + Assert.assertEquals(property1.containerType, "map"); + Assert.assertFalse(property1.required); + Assert.assertTrue(property1.isContainer); + Assert.assertTrue(property1.isPrimitiveType); + } + + @Test(description = "convert a model with complex property") + public void complexPropertyTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new Schema().$ref("#/definitions/Children")); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "children"); + Assert.assertEquals(property1.dataType, "Children"); + Assert.assertEquals(property1.name, "children"); + Assert.assertEquals(property1.baseType, "Children"); + Assert.assertFalse(property1.required); + Assert.assertFalse(property1.isContainer); + } + + @Test(description = "convert a model with complex list property") + public void complexListProperty() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new ArraySchema() + .items(new Schema().$ref("#/definitions/Children"))); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "children"); + Assert.assertEquals(property1.dataType, "BuiltList"); + Assert.assertEquals(property1.name, "children"); + Assert.assertEquals(property1.baseType, "BuiltList"); + Assert.assertEquals(property1.containerType, "array"); + Assert.assertFalse(property1.required); + Assert.assertTrue(property1.isContainer); + } + + @Test(description = "convert a model with complex map property") + public void complexMapSchema() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("children", new MapSchema() + .additionalProperties(new Schema().$ref("#/definitions/Children"))); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "children"); + Assert.assertEquals(property1.complexType, "Children"); + Assert.assertEquals(property1.dataType, "BuiltMap"); + Assert.assertEquals(property1.name, "children"); + Assert.assertEquals(property1.baseType, "BuiltMap"); + Assert.assertEquals(property1.containerType, "map"); + Assert.assertFalse(property1.required); + Assert.assertTrue(property1.isContainer); + } + + @Test(description = "convert an array model") + public void arrayModelTest() { + final Schema model = new ArraySchema() + .items(new Schema().$ref("#/definitions/Children")) + .description("an array model"); + final DefaultCodegen codegen = new DartNextClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(model.getDescription(), "an array model"); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertTrue(cm.isArray); + Assert.assertEquals(cm.description, "an array model"); + Assert.assertEquals(cm.vars.size(), 0); + } + + @Test(description = "convert a map model") + public void mapModelTest() { + final Schema model = new Schema() + .description("a map model") + .additionalProperties(new Schema().$ref("#/definitions/Children")); + final DefaultCodegen codegen = new DartNextClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a map model"); + Assert.assertEquals(cm.vars.size(), 0); + } + + @DataProvider(name = "modelNames") + public static Object[][] modelNames() { + return new Object[][] { + {"EnumClass", "TestModelEnumClass"}, + {"JsonObject", "TestModelJsonObject"}, + }; + } + + @Test(dataProvider = "modelNames", description = "correctly prefix reserved model names") + public void modelNameTest(String name, String expectedName) { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new Schema(); + + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.processOpts(); + codegen.typeMapping().put("EnumClass", "TestModelEnumClass"); + codegen.typeMapping().put("JsonObject", "TestModelJsonObject"); + codegen.setOpenAPI(openAPI); + + final CodegenModel cm = codegen.fromModel(name, model); + + Assert.assertEquals(cm.name, name); + Assert.assertEquals(cm.classname, expectedName); + } + + @DataProvider(name = "modelNamesTimemachine") + public static Object[][] modelNamesTimemachine() { + return new Object[][] { + {"EnumClass", "TestModelEnumClass"}, + {"JsonObject", "TestModelJsonObject"}, + {"OffsetDate", "TestModelOffsetDate"}, + }; + } + + @Test(dataProvider = "modelNamesTimemachine", description = "correctly prefix reserved model names") + public void modelNameTestTimemachine(String name, String expectedName) { + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new Schema(); + final DartNextClientCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_TIME_MACHINE); + codegen.processOpts(); + codegen.typeMapping().put("EnumClass", "TestModelEnumClass"); + codegen.typeMapping().put("JsonObject", "TestModelJsonObject"); + codegen.typeMapping().put("OffsetDate", "TestModelOffsetDate"); + codegen.setOpenAPI(openAPI); + + final CodegenModel cm = codegen.fromModel(name, model); + + Assert.assertEquals(cm.name, name); + Assert.assertEquals(cm.classname, expectedName); + } + + @Test(description = "correctly generate collection default values") + public void collectionDefaultValues() { + final ArraySchema array = new ArraySchema(); + array.setDefault("[]"); + final Schema model = new Schema() + .description("a sample model") + .addProperties("arrayNoDefault", new ArraySchema()) + .addProperties("arrayEmptyDefault", array) + .addProperties("mapNoDefault", new MapSchema()); + final DefaultCodegen codegen = new DartNextClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); + codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); + codegen.processOpts(); + final CodegenModel cm = codegen.fromModel("sample", model); + + final CodegenProperty arrayNoDefault = cm.vars.get(0); + Assert.assertEquals(arrayNoDefault.name, "arrayNoDefault"); + Assert.assertNull(arrayNoDefault.defaultValue); + + final CodegenProperty arrayEmptyDefault = cm.vars.get(1); + Assert.assertEquals(arrayEmptyDefault.name, "arrayEmptyDefault"); + Assert.assertEquals(arrayEmptyDefault.defaultValue, "ListBuilder()"); + + final CodegenProperty mapNoDefault = cm.vars.get(2); + Assert.assertEquals(mapNoDefault.name, "mapNoDefault"); + Assert.assertNull(mapNoDefault.defaultValue); + } + + @Test(description = "correctly generate date/datetime default values, currently null") + public void dateDefaultValues() { + final DateSchema date = new DateSchema(); + date.setDefault("2021-01-01"); + final DateTimeSchema dateTime = new DateTimeSchema(); + dateTime.setDefault("2021-01-01T14:00:00Z"); + final Schema model = new Schema() + .description("a sample model") + .addProperties("date", date) + .addProperties("dateTime", dateTime) + .addProperties("mapNoDefault", new MapSchema()); + final DefaultCodegen codegen = new DartNextClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + final CodegenProperty dateDefault = cm.vars.get(0); + Assert.assertEquals(dateDefault.name, "date"); + Assert.assertNull(dateDefault.defaultValue); + + final CodegenProperty dateTimeDefault = cm.vars.get(1); + Assert.assertEquals(dateTimeDefault.name, "dateTime"); + Assert.assertNull(dateTimeDefault.defaultValue); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java new file mode 100644 index 000000000000..59f08614fc9a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartNextClientOptionsProvider.java @@ -0,0 +1,82 @@ +/* + * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.options; + +import com.google.common.collect.ImmutableMap; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.DartNextClientCodegen; + +import java.util.Map; + +public class DartNextClientOptionsProvider implements OptionsProvider { + public static final String SORT_PARAMS_VALUE = "true"; + public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; + public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; + public static final String PUB_LIBRARY_VALUE = "openapi.api"; + public static final String PUB_NAME_VALUE = "openapi"; + public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT"; + public static final String PUB_DESCRIPTION_VALUE = "OpenAPI API client dart-next"; + public static final String SOURCE_FOLDER_VALUE = "src"; + public static final String USE_ENUM_EXTENSION = "true"; + public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; + public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String PUB_AUTHOR_VALUE = "Author"; + public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; + public static final String PUB_HOMEPAGE_VALUE = "Homepage"; + public static final String PUB_REPOSITORY_VALUE = "Repository"; + public static final String PUB_PUBLISH_TO_VALUE = "Publish to"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; + + @Override + public String getLanguage() { + return "dart-next"; + } + + @Override + public Map createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) + .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) + .put(DartNextClientCodegen.PUB_LIBRARY, PUB_LIBRARY_VALUE) + .put(DartNextClientCodegen.PUB_NAME, PUB_NAME_VALUE) + .put(DartNextClientCodegen.PUB_VERSION, PUB_VERSION_VALUE) + .put(DartNextClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE) + .put(DartNextClientCodegen.PUB_AUTHOR, PUB_AUTHOR_VALUE) + .put(DartNextClientCodegen.PUB_AUTHOR_EMAIL, PUB_AUTHOR_EMAIL_VALUE) + .put(DartNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) + .put(DartNextClientCodegen.PUB_REPOSITORY, PUB_REPOSITORY_VALUE) + .put(DartNextClientCodegen.PUB_PUBLISH_TO, PUB_PUBLISH_TO_VALUE) + .put(CodegenConstants.LIBRARY, DartNextClientCodegen.NETWORKING_LIBRARY_DEFAULT) + .put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) + .put(DartNextClientCodegen.DATE_LIBRARY, DartNextClientCodegen.DATE_LIBRARY_DEFAULT) + .put(DartNextClientCodegen.FINAL_PROPERTIES, DartNextClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) + .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) + .put(DartNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) + .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") + .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} diff --git a/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml index 79e2ec2ebe1d..2116b49c5dc0 100644 --- a/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml @@ -1495,7 +1495,7 @@ components: allOf: - $ref: "#/components/schemas/FruitType" FruitAnyOfDisc: - oneOf: + anyOf: - $ref: "#/components/schemas/AppleAnyOfDisc" - $ref: "#/components/schemas/BananaAnyOfDisc" discriminator: diff --git a/pom.xml b/pom.xml index c48d3ba9f7e6..dda803807394 100644 --- a/pom.xml +++ b/pom.xml @@ -1325,6 +1325,8 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib samples/openapi3/client/petstore/dart-dio/dio/built_value samples/openapi3/client/petstore/dart-dio/dio/json_serializable + samples/openapi3/client/petstore/dart-next/dio/built_value + samples/openapi3/client/petstore/dart-next/dio/json_serializable diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md deleted file mode 100644 index b49ab2f0fe8a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAnyOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleAnyOfDisc - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md deleted file mode 100644 index 8468888bf7e1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAnyOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaAnyOfDisc - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md deleted file mode 100644 index 777e4189e4c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md deleted file mode 100644 index bfd11951e402..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeBigDecimalMap200Response.md deleted file mode 100644 index cedb487c954d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeBigDecimalMap200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FakeBigDecimalMap200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**someId** | **num** | | [optional] -**someMap** | **BuiltMap<String, num>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart deleted file mode 100644 index 7194f15f221a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_any_of_disc.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/any_of.dart'; - -part 'apple_any_of_disc.g.dart'; - -/// AppleAnyOfDisc -/// -/// Properties: -/// * [seeds] -/// * [fruitType] -@BuiltValue() -abstract class AppleAnyOfDisc - implements Built { - @BuiltValueField(wireName: r'seeds') - int get seeds; - - /// Any Of [FruitType] - AnyOf get anyOf; - - AppleAnyOfDisc._(); - - factory AppleAnyOfDisc([void updates(AppleAnyOfDiscBuilder b)]) = - _$AppleAnyOfDisc; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AppleAnyOfDiscBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AppleAnyOfDiscSerializer(); -} - -class _$AppleAnyOfDiscSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [AppleAnyOfDisc, _$AppleAnyOfDisc]; - - @override - final String wireName = r'AppleAnyOfDisc'; - - Iterable _serializeProperties( - Serializers serializers, - AppleAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'seeds'; - yield serializers.serialize( - object.seeds, - specifiedType: const FullType(int), - ); - } - - @override - Object serialize( - Serializers serializers, - AppleAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) { - final anyOf = object.anyOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - final serialized = serializers.serialize(anyOf, - specifiedType: FullType( - AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList())); - result.addAll((serialized is Map - ? serialized.entries - .map((e) => [e.key, e.value]) - .expand((e) => e) - : serialized) as Iterable); - return result; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required AppleAnyOfDiscBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'seeds': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.seeds = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - AppleAnyOfDisc deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = AppleAnyOfDiscBuilder(); - Object? anyOfDataSrc; - final targetType = const FullType(AnyOf, [ - FullType(FruitType), - ]); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - anyOfDataSrc = unhandled; - result.anyOf = serializers.deserialize(anyOfDataSrc, - specifiedType: targetType) as AnyOf; - return result.build(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart deleted file mode 100644 index f61d88291f75..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_any_of_disc.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/any_of.dart'; - -part 'banana_any_of_disc.g.dart'; - -/// BananaAnyOfDisc -/// -/// Properties: -/// * [length] -/// * [fruitType] -@BuiltValue() -abstract class BananaAnyOfDisc - implements Built { - @BuiltValueField(wireName: r'length') - int get length; - - /// Any Of [FruitType] - AnyOf get anyOf; - - BananaAnyOfDisc._(); - - factory BananaAnyOfDisc([void updates(BananaAnyOfDiscBuilder b)]) = - _$BananaAnyOfDisc; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(BananaAnyOfDiscBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BananaAnyOfDiscSerializer(); -} - -class _$BananaAnyOfDiscSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [BananaAnyOfDisc, _$BananaAnyOfDisc]; - - @override - final String wireName = r'BananaAnyOfDisc'; - - Iterable _serializeProperties( - Serializers serializers, - BananaAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'length'; - yield serializers.serialize( - object.length, - specifiedType: const FullType(int), - ); - } - - @override - Object serialize( - Serializers serializers, - BananaAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) { - final anyOf = object.anyOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - final serialized = serializers.serialize(anyOf, - specifiedType: FullType( - AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList())); - result.addAll((serialized is Map - ? serialized.entries - .map((e) => [e.key, e.value]) - .expand((e) => e) - : serialized) as Iterable); - return result; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required BananaAnyOfDiscBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'length': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.length = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - BananaAnyOfDisc deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = BananaAnyOfDiscBuilder(); - Object? anyOfDataSrc; - final targetType = const FullType(AnyOf, [ - FullType(FruitType), - ]); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - anyOfDataSrc = unhandled; - result.anyOf = serializers.deserialize(anyOfDataSrc, - specifiedType: targetType) as AnyOf; - return result.build(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart deleted file mode 100644 index 18fd5b5ec591..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,144 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat_all_of.g.dart'; - -/// CatAllOf -/// -/// Properties: -/// * [declawed] -@BuiltValue(instantiable: false) -abstract class CatAllOf { - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatAllOfSerializer(); -} - -class _$CatAllOfSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [CatAllOf]; - - @override - final String wireName = r'CatAllOf'; - - Iterable _serializeProperties( - Serializers serializers, - CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); - } - } - - @override - Object serialize( - Serializers serializers, - CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - @override - CatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, - specifiedType: FullType($CatAllOf)) as $CatAllOf; - } -} - -/// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable -@BuiltValue(instantiable: true) -abstract class $CatAllOf - implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { - $CatAllOf._(); - - factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($CatAllOfBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$CatAllOf> get serializer => _$$CatAllOfSerializer(); -} - -class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { - @override - final Iterable types = const [$CatAllOf, _$$CatAllOf]; - - @override - final String wireName = r'$CatAllOf'; - - @override - Object serialize( - Serializers serializers, - $CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(CatAllOf))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required CatAllOfBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'declawed': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.declawed = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $CatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $CatAllOfBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart deleted file mode 100644 index 28c95d93dcf2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,144 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog_all_of.g.dart'; - -/// DogAllOf -/// -/// Properties: -/// * [breed] -@BuiltValue(instantiable: false) -abstract class DogAllOf { - @BuiltValueField(wireName: r'breed') - String? get breed; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogAllOfSerializer(); -} - -class _$DogAllOfSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [DogAllOf]; - - @override - final String wireName = r'DogAllOf'; - - Iterable _serializeProperties( - Serializers serializers, - DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); - } - - @override - DogAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, - specifiedType: FullType($DogAllOf)) as $DogAllOf; - } -} - -/// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable -@BuiltValue(instantiable: true) -abstract class $DogAllOf - implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { - $DogAllOf._(); - - factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($DogAllOfBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$DogAllOf> get serializer => _$$DogAllOfSerializer(); -} - -class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { - @override - final Iterable types = const [$DogAllOf, _$$DogAllOf]; - - @override - final String wireName = r'$DogAllOf'; - - @override - Object serialize( - Serializers serializers, - $DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(DogAllOf))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required DogAllOfBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'breed': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.breed = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $DogAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $DogAllOfBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fake_big_decimal_map200_response.dart deleted file mode 100644 index ddfab9d2b56b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fake_big_decimal_map200_response.dart +++ /dev/null @@ -1,127 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'fake_big_decimal_map200_response.g.dart'; - -/// FakeBigDecimalMap200Response -/// -/// Properties: -/// * [someId] -/// * [someMap] -@BuiltValue() -abstract class FakeBigDecimalMap200Response implements Built { - @BuiltValueField(wireName: r'someId') - num? get someId; - - @BuiltValueField(wireName: r'someMap') - BuiltMap? get someMap; - - FakeBigDecimalMap200Response._(); - - factory FakeBigDecimalMap200Response([void updates(FakeBigDecimalMap200ResponseBuilder b)]) = _$FakeBigDecimalMap200Response; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FakeBigDecimalMap200ResponseBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FakeBigDecimalMap200ResponseSerializer(); -} - -class _$FakeBigDecimalMap200ResponseSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [FakeBigDecimalMap200Response, _$FakeBigDecimalMap200Response]; - - @override - final String wireName = r'FakeBigDecimalMap200Response'; - - Iterable _serializeProperties( - Serializers serializers, - FakeBigDecimalMap200Response object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.someId != null) { - yield r'someId'; - yield serializers.serialize( - object.someId, - specifiedType: const FullType(num), - ); - } - if (object.someMap != null) { - yield r'someMap'; - yield serializers.serialize( - object.someMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]), - ); - } - } - - @override - Object serialize( - Serializers serializers, - FakeBigDecimalMap200Response object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required FakeBigDecimalMap200ResponseBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'someId': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(num), - ) as num; - result.someId = valueDes; - break; - case r'someMap': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]), - ) as BuiltMap; - result.someMap.replace(valueDes); - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - FakeBigDecimalMap200Response deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FakeBigDecimalMap200ResponseBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart deleted file mode 100644 index 149c94ac2f72..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_any_of_disc.dart +++ /dev/null @@ -1,138 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/apple_any_of_disc.dart'; -import 'package:openapi/src/model/banana_any_of_disc.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; - -part 'fruit_any_of_disc.g.dart'; - -/// FruitAnyOfDisc -/// -/// Properties: -/// * [fruitType] -@BuiltValue() -abstract class FruitAnyOfDisc - implements Built { - /// One Of [AppleAnyOfDisc], [BananaAnyOfDisc] - OneOf get oneOf; - - static const String discriminatorFieldName = r'fruitType'; - - static const Map discriminatorMapping = { - r'AppleAnyOfDisc': AppleAnyOfDisc, - r'BananaAnyOfDisc': BananaAnyOfDisc, - }; - - FruitAnyOfDisc._(); - - factory FruitAnyOfDisc([void updates(FruitAnyOfDiscBuilder b)]) = - _$FruitAnyOfDisc; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FruitAnyOfDiscBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitAnyOfDiscSerializer(); -} - -extension FruitAnyOfDiscDiscriminatorExt on FruitAnyOfDisc { - String? get discriminatorValue { - if (this is AppleAnyOfDisc) { - return r'AppleAnyOfDisc'; - } - if (this is BananaAnyOfDisc) { - return r'BananaAnyOfDisc'; - } - return null; - } -} - -extension FruitAnyOfDiscBuilderDiscriminatorExt on FruitAnyOfDiscBuilder { - String? get discriminatorValue { - if (this is AppleAnyOfDiscBuilder) { - return r'AppleAnyOfDisc'; - } - if (this is BananaAnyOfDiscBuilder) { - return r'BananaAnyOfDisc'; - } - return null; - } -} - -class _$FruitAnyOfDiscSerializer - implements PrimitiveSerializer { - @override - final Iterable types = const [FruitAnyOfDisc, _$FruitAnyOfDisc]; - - @override - final String wireName = r'FruitAnyOfDisc'; - - Iterable _serializeProperties( - Serializers serializers, - FruitAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) sync* {} - - @override - Object serialize( - Serializers serializers, - FruitAnyOfDisc object, { - FullType specifiedType = FullType.unspecified, - }) { - final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; - } - - @override - FruitAnyOfDisc deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = FruitAnyOfDiscBuilder(); - Object? oneOfDataSrc; - final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitAnyOfDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; - oneOfDataSrc = serialized; - final oneOfTypes = [ - AppleAnyOfDisc, - BananaAnyOfDisc, - ]; - Object oneOfResult; - Type oneOfType; - switch (discValue) { - case r'AppleAnyOfDisc': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(AppleAnyOfDisc), - ) as AppleAnyOfDisc; - oneOfType = AppleAnyOfDisc; - break; - case r'BananaAnyOfDisc': - oneOfResult = serializers.deserialize( - oneOfDataSrc, - specifiedType: FullType(BananaAnyOfDisc), - ) as BananaAnyOfDisc; - oneOfType = BananaAnyOfDisc; - break; - default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); - } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); - return result.build(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart deleted file mode 100644 index ce0b61263756..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_any_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleAnyOfDisc -void main() { - final instance = AppleAnyOfDiscBuilder(); - // add properties to the builder and call build() - - group(AppleAnyOfDisc, () { - // int seeds - test('to test the property `seeds`', () async {}); - - // String fruitType - test('to test the property `fruitType`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart deleted file mode 100644 index 494911f8e82e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_any_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaAnyOfDisc -void main() { - final instance = BananaAnyOfDiscBuilder(); - // add properties to the builder and call build() - - group(BananaAnyOfDisc, () { - // int length - test('to test the property `length`', () async {}); - - // String fruitType - test('to test the property `fruitType`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart deleted file mode 100644 index 9e99c51f3b21..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_all_of_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for CatAllOf -void main() { - //final instance = CatAllOfBuilder(); - // add properties to the builder and call build() - - group(CatAllOf, () { - // bool declawed - test('to test the property `declawed`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart deleted file mode 100644 index 59cc36628bde..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_all_of_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DogAllOf -void main() { - //final instance = DogAllOfBuilder(); - // add properties to the builder and call build() - - group(DogAllOf, () { - // String breed - test('to test the property `breed`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_big_decimal_map200_response_test.dart deleted file mode 100644 index f316fc6038bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_big_decimal_map200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FakeBigDecimalMap200Response -void main() { - final instance = FakeBigDecimalMap200ResponseBuilder(); - // TODO add properties to the builder and call build() - - group(FakeBigDecimalMap200Response, () { - // num someId - test('to test the property `someId`', () async { - // TODO - }); - - // BuiltMap someMap - test('to test the property `someMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md deleted file mode 100644 index b49ab2f0fe8a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAnyOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleAnyOfDisc - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md deleted file mode 100644 index 8468888bf7e1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAnyOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaAnyOfDisc - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md deleted file mode 100644 index 777e4189e4c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md deleted file mode 100644 index bfd11951e402..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeBigDecimalMap200Response.md deleted file mode 100644 index 281dfc44fd8c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeBigDecimalMap200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FakeBigDecimalMap200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**someId** | **num** | | [optional] -**someMap** | **Map<String, num>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart deleted file mode 100644 index f72bede8dd8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_any_of_disc.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_any_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleAnyOfDisc { - /// Returns a new [AppleAnyOfDisc] instance. - AppleAnyOfDisc({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AppleAnyOfDisc && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory AppleAnyOfDisc.fromJson(Map json) => - _$AppleAnyOfDiscFromJson(json); - - Map toJson() => _$AppleAnyOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart deleted file mode 100644 index 6daf21610594..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_any_of_disc.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'banana_any_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BananaAnyOfDisc { - /// Returns a new [BananaAnyOfDisc] instance. - BananaAnyOfDisc({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BananaAnyOfDisc && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory BananaAnyOfDisc.fromJson(Map json) => - _$BananaAnyOfDiscFromJson(json); - - Map toJson() => _$BananaAnyOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart deleted file mode 100644 index af380b83994a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'cat_all_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class CatAllOf { - /// Returns a new [CatAllOf] instance. - CatAllOf({ - this.declawed, - }); - - @JsonKey(name: r'declawed', required: false, includeIfNull: false) - final bool? declawed; - - @override - bool operator ==(Object other) => - identical(this, other) || other is CatAllOf && other.declawed == declawed; - - @override - int get hashCode => declawed.hashCode; - - factory CatAllOf.fromJson(Map json) => - _$CatAllOfFromJson(json); - - Map toJson() => _$CatAllOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart deleted file mode 100644 index 39065be80707..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'dog_all_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DogAllOf { - /// Returns a new [DogAllOf] instance. - DogAllOf({ - this.breed, - }); - - @JsonKey(name: r'breed', required: false, includeIfNull: false) - final String? breed; - - @override - bool operator ==(Object other) => - identical(this, other) || other is DogAllOf && other.breed == breed; - - @override - int get hashCode => breed.hashCode; - - factory DogAllOf.fromJson(Map json) => - _$DogAllOfFromJson(json); - - Map toJson() => _$DogAllOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fake_big_decimal_map200_response.dart deleted file mode 100644 index 965257f0a076..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fake_big_decimal_map200_response.dart +++ /dev/null @@ -1,70 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'fake_big_decimal_map200_response.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FakeBigDecimalMap200Response { - /// Returns a new [FakeBigDecimalMap200Response] instance. - FakeBigDecimalMap200Response({ - - this.someId, - - this.someMap, - }); - - @JsonKey( - - name: r'someId', - required: false, - includeIfNull: false - ) - - - final num? someId; - - - - @JsonKey( - - name: r'someMap', - required: false, - includeIfNull: false - ) - - - final Map? someMap; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && - other.someId == someId && - other.someMap == someMap; - - @override - int get hashCode => - someId.hashCode + - someMap.hashCode; - - factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); - - Map toJson() => _$FakeBigDecimalMap200ResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart deleted file mode 100644 index bad9b16dfa05..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_impl.dart +++ /dev/null @@ -1,324 +0,0 @@ -import 'dart:convert'; -import 'dart:typed_data'; -import 'repository_base.dart'; -import 'package:openapi/models.dart'; - -class JsonSerializableRepository extends SerializationRepositoryBase { - JsonSerializableRepository(); - - @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { - return jsonEncode(src); - } - - @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { - Object valueParsed; - if (context == 'decodedJson') { - //if we are deserializing a decoded json, don't decode it again. - valueParsed = value; - } else { - valueParsed = jsonDecode(value.toString()) as Object; - } - switch (targetTypeInfo.root) { - case String: - return valueParsed as T; - case int: - return (valueParsed is num - ? valueParsed.toInt() - : int.parse(valueParsed.toString())) as T; - case bool: - if (valueParsed is bool) { - return valueParsed as T; - } - final valueString = valueParsed.toString().toLowerCase(); - return (valueString == 'true' || valueString == '1') as T; - case double: - return (valueParsed is num - ? valueParsed.toDouble() - : double.parse(valueParsed.toString())) as T; - case AdditionalPropertiesClass: - return AdditionalPropertiesClass.fromJson( - valueParsed as Map) as T; - case Addressable: - return Addressable.fromJson(valueParsed as Map) as T; - case AllOfWithSingleRef: - return AllOfWithSingleRef.fromJson(valueParsed as Map) - as T; - case Animal: - return Animal.fromJson(valueParsed as Map) as T; - case ApiResponse: - return ApiResponse.fromJson(valueParsed as Map) as T; - case Apple: - return Apple.fromJson(valueParsed as Map) as T; - case AppleAllOfDisc: - return AppleAllOfDisc.fromJson(valueParsed as Map) - as T; - case AppleAnyOfDisc: - return AppleAnyOfDisc.fromJson(valueParsed as Map) - as T; - case AppleGrandparentDisc: - return AppleGrandparentDisc.fromJson( - valueParsed as Map) as T; - case AppleOneOfDisc: - return AppleOneOfDisc.fromJson(valueParsed as Map) - as T; - case AppleReqDisc: - return AppleReqDisc.fromJson(valueParsed as Map) as T; - case AppleVariant1: - return AppleVariant1.fromJson(valueParsed as Map) as T; - case ArrayOfArrayOfNumberOnly: - return ArrayOfArrayOfNumberOnly.fromJson( - valueParsed as Map) as T; - case ArrayOfNumberOnly: - return ArrayOfNumberOnly.fromJson(valueParsed as Map) - as T; - case ArrayTest: - return ArrayTest.fromJson(valueParsed as Map) as T; - case Banana: - return Banana.fromJson(valueParsed as Map) as T; - case BananaAllOfDisc: - return BananaAllOfDisc.fromJson(valueParsed as Map) - as T; - case BananaAnyOfDisc: - return BananaAnyOfDisc.fromJson(valueParsed as Map) - as T; - case BananaGrandparentDisc: - return BananaGrandparentDisc.fromJson( - valueParsed as Map) as T; - case BananaOneOfDisc: - return BananaOneOfDisc.fromJson(valueParsed as Map) - as T; - case BananaReqDisc: - return BananaReqDisc.fromJson(valueParsed as Map) as T; - case Bar: - return Bar.fromJson(valueParsed as Map) as T; - case BarCreate: - return BarCreate.fromJson(valueParsed as Map) as T; - case BarRef: - return BarRef.fromJson(valueParsed as Map) as T; - case BarRefOrValue: - return BarRefOrValue.fromJson(valueParsed as Map) as T; - case Capitalization: - return Capitalization.fromJson(valueParsed as Map) - as T; - case Cat: - return Cat.fromJson(valueParsed as Map) as T; - case CatAllOf: - return CatAllOf.fromJson(valueParsed as Map) as T; - case Category: - return Category.fromJson(valueParsed as Map) as T; - case ClassModel: - return ClassModel.fromJson(valueParsed as Map) as T; - case ComposedDiscMissingFromProperties: - return ComposedDiscMissingFromProperties.fromJson( - valueParsed as Map) as T; - case ComposedDiscOptionalTypeCorrect: - return ComposedDiscOptionalTypeCorrect.fromJson( - valueParsed as Map) as T; - case ComposedDiscOptionalTypeInconsistent: - return ComposedDiscOptionalTypeInconsistent.fromJson( - valueParsed as Map) as T; - case ComposedDiscOptionalTypeIncorrect: - return ComposedDiscOptionalTypeIncorrect.fromJson( - valueParsed as Map) as T; - case ComposedDiscRequiredInconsistent: - return ComposedDiscRequiredInconsistent.fromJson( - valueParsed as Map) as T; - case ComposedDiscTypeInconsistent: - return ComposedDiscTypeInconsistent.fromJson( - valueParsed as Map) as T; - case ComposedDiscTypeIncorrect: - return ComposedDiscTypeIncorrect.fromJson( - valueParsed as Map) as T; - case DeprecatedObject: - return DeprecatedObject.fromJson(valueParsed as Map) - as T; - case DiscMissingFromProperties: - return DiscMissingFromProperties.fromJson( - valueParsed as Map) as T; - case DiscOptionalTypeCorrect: - return DiscOptionalTypeCorrect.fromJson( - valueParsed as Map) as T; - case DiscOptionalTypeIncorrect: - return DiscOptionalTypeIncorrect.fromJson( - valueParsed as Map) as T; - case DiscTypeIncorrect: - return DiscTypeIncorrect.fromJson(valueParsed as Map) - as T; - case Dog: - return Dog.fromJson(valueParsed as Map) as T; - case DogAllOf: - return DogAllOf.fromJson(valueParsed as Map) as T; - case Entity: - return Entity.fromJson(valueParsed as Map) as T; - case EntityRef: - return EntityRef.fromJson(valueParsed as Map) as T; - case EnumArrays: - return EnumArrays.fromJson(valueParsed as Map) as T; - case EnumTest: - return EnumTest.fromJson(valueParsed as Map) as T; - case Extensible: - return Extensible.fromJson(valueParsed as Map) as T; - case FileSchemaTestClass: - return FileSchemaTestClass.fromJson(valueParsed as Map) - as T; - case Foo: - return Foo.fromJson(valueParsed as Map) as T; - case FooBasicGetDefaultResponse: - return FooBasicGetDefaultResponse.fromJson( - valueParsed as Map) as T; - case FooRef: - return FooRef.fromJson(valueParsed as Map) as T; - case FooRefOrValue: - return FooRefOrValue.fromJson(valueParsed as Map) as T; - case FormatTest: - return FormatTest.fromJson(valueParsed as Map) as T; - case Fruit: - return Fruit.fromJson(valueParsed as Map) as T; - case FruitAllOfDisc: - return FruitAllOfDisc.fromJson(valueParsed as Map) - as T; - case FruitAnyOfDisc: - return FruitAnyOfDisc.fromJson(valueParsed as Map) - as T; - case FruitGrandparentDisc: - return FruitGrandparentDisc.fromJson( - valueParsed as Map) as T; - case FruitInlineDisc: - return FruitInlineDisc.fromJson(valueParsed as Map) - as T; - case FruitInlineDiscOneOf: - return FruitInlineDiscOneOf.fromJson( - valueParsed as Map) as T; - case FruitInlineDiscOneOf1: - return FruitInlineDiscOneOf1.fromJson( - valueParsed as Map) as T; - case FruitInlineInlineDisc: - return FruitInlineInlineDisc.fromJson( - valueParsed as Map) as T; - case FruitInlineInlineDiscOneOf: - return FruitInlineInlineDiscOneOf.fromJson( - valueParsed as Map) as T; - case FruitInlineInlineDiscOneOf1: - return FruitInlineInlineDiscOneOf1.fromJson( - valueParsed as Map) as T; - case FruitInlineInlineDiscOneOfOneOf: - return FruitInlineInlineDiscOneOfOneOf.fromJson( - valueParsed as Map) as T; - case FruitOneOfDisc: - return FruitOneOfDisc.fromJson(valueParsed as Map) - as T; - case FruitReqDisc: - return FruitReqDisc.fromJson(valueParsed as Map) as T; - case FruitType: - return FruitType.fromJson(valueParsed as Map) as T; - case FruitVariant1: - return FruitVariant1.fromJson(valueParsed as Map) as T; - case GigaOneOf: - return GigaOneOf.fromJson(valueParsed as Map) as T; - case GrapeVariant1: - return GrapeVariant1.fromJson(valueParsed as Map) as T; - case HasOnlyReadOnly: - return HasOnlyReadOnly.fromJson(valueParsed as Map) - as T; - case HealthCheckResult: - return HealthCheckResult.fromJson(valueParsed as Map) - as T; - case MapTest: - return MapTest.fromJson(valueParsed as Map) as T; - case MixedPropertiesAndAdditionalPropertiesClass: - return MixedPropertiesAndAdditionalPropertiesClass.fromJson( - valueParsed as Map) as T; - case Model200Response: - return Model200Response.fromJson(valueParsed as Map) - as T; - case ModelClient: - return ModelClient.fromJson(valueParsed as Map) as T; - case ModelEnumClass: - case ModelFile: - return ModelFile.fromJson(valueParsed as Map) as T; - case ModelList: - return ModelList.fromJson(valueParsed as Map) as T; - case ModelReturn: - return ModelReturn.fromJson(valueParsed as Map) as T; - case Name: - return Name.fromJson(valueParsed as Map) as T; - case NullableClass: - return NullableClass.fromJson(valueParsed as Map) as T; - case NumberOnly: - return NumberOnly.fromJson(valueParsed as Map) as T; - case ObjectWithDeprecatedFields: - return ObjectWithDeprecatedFields.fromJson( - valueParsed as Map) as T; - case OneOfPrimitiveChild: - return OneOfPrimitiveChild.fromJson(valueParsed as Map) - as T; - case Order: - return Order.fromJson(valueParsed as Map) as T; - case OuterComposite: - return OuterComposite.fromJson(valueParsed as Map) - as T; - case OuterEnum: - case OuterEnumDefaultValue: - case OuterEnumInteger: - case OuterEnumIntegerDefaultValue: - case OuterObjectWithEnumProperty: - return OuterObjectWithEnumProperty.fromJson( - valueParsed as Map) as T; - case Parent: - return Parent.fromJson(valueParsed as Map) as T; - case Pasta: - return Pasta.fromJson(valueParsed as Map) as T; - case Pet: - return Pet.fromJson(valueParsed as Map) as T; - case Pizza: - return Pizza.fromJson(valueParsed as Map) as T; - case PizzaSpeziale: - return PizzaSpeziale.fromJson(valueParsed as Map) as T; - case ReadOnlyFirst: - return ReadOnlyFirst.fromJson(valueParsed as Map) as T; - case SingleRefType: - case SpecialModelName: - return SpecialModelName.fromJson(valueParsed as Map) - as T; - case Tag: - return Tag.fromJson(valueParsed as Map) as T; - case User: - return User.fromJson(valueParsed as Map) as T; - default: - RegExpMatch? match; - - if (valueParsed is List && - (match = _regList.firstMatch(targetTypeInfo)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return valueParsed - .map((dynamic v) => deserialize( - v, targetTypeInfo, - growable: growable)) - .toList(growable: growable) as T; - } - if (valueParsed is Set && - (match = _regSet.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return valueParsed - .map((dynamic v) => deserialize( - v, targetTypeInfo, - growable: growable)) - .toSet() as T; - } - if (valueParsed is Map && - (match = _regMap.firstMatch(targetType)) != null) { - targetType = match![1]!; // ignore: parameter_assignments - return Map.fromIterables( - valueParsed.keys, - valueParsed.values.map((dynamic v) => - deserialize(v, targetTypeInfo, - growable: growable)), - ) as T; - } - break; - } - throw Exception('Cannot deserialize'); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart deleted file mode 100644 index 4e07f6c62eff..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_any_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleAnyOfDisc -void main() { - final AppleAnyOfDisc? instance = /* AppleAnyOfDisc(...) */ null; - // add properties to the entity - - group(AppleAnyOfDisc, () { - // int seeds - test('to test the property `seeds`', () async {}); - - // String fruitType - test('to test the property `fruitType`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart deleted file mode 100644 index 62fbd9b26337..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_any_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaAnyOfDisc -void main() { - final BananaAnyOfDisc? instance = /* BananaAnyOfDisc(...) */ null; - // add properties to the entity - - group(BananaAnyOfDisc, () { - // int length - test('to test the property `length`', () async {}); - - // String fruitType - test('to test the property `fruitType`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart deleted file mode 100644 index eaca12c52ea8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_all_of_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for CatAllOf -void main() { - final CatAllOf? instance = /* CatAllOf(...) */ null; - // add properties to the entity - - group(CatAllOf, () { - // bool declawed - test('to test the property `declawed`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart deleted file mode 100644 index 2e4074e24392..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_all_of_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DogAllOf -void main() { - final DogAllOf? instance = /* DogAllOf(...) */ null; - // add properties to the entity - - group(DogAllOf, () { - // String breed - test('to test the property `breed`', () async {}); - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_big_decimal_map200_response_test.dart deleted file mode 100644 index 1279b8d0ff25..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_big_decimal_map200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FakeBigDecimalMap200Response -void main() { - final FakeBigDecimalMap200Response? instance = /* FakeBigDecimalMap200Response(...) */ null; - // TODO add properties to the entity - - group(FakeBigDecimalMap200Response, () { - // num someId - test('to test the property `someId`', () async { - // TODO - }); - - // Map someMap - test('to test the property `someMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.gitignore b/samples/openapi3/client/petstore/dart-next/dio/built_value/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/.gitignore rename to samples/openapi3/client/petstore/dart-next/dio/built_value/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator-ignore rename to samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES similarity index 65% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES rename to samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES index c9a0229c88b9..18008f8208c3 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES @@ -9,7 +9,6 @@ doc/AnotherFakeApi.md doc/ApiResponse.md doc/Apple.md doc/AppleAllOfDisc.md -doc/AppleAnyOfDisc.md doc/AppleGrandparentDisc.md doc/AppleOneOfDisc.md doc/AppleReqDisc.md @@ -19,7 +18,6 @@ doc/ArrayOfNumberOnly.md doc/ArrayTest.md doc/Banana.md doc/BananaAllOfDisc.md -doc/BananaAnyOfDisc.md doc/BananaGrandparentDisc.md doc/BananaOneOfDisc.md doc/BananaReqDisc.md @@ -30,7 +28,6 @@ doc/BarRef.md doc/BarRefOrValue.md doc/Capitalization.md doc/Cat.md -doc/CatAllOf.md doc/Category.md doc/ClassModel.md doc/ComposedDiscMissingFromProperties.md @@ -47,7 +44,6 @@ doc/DiscOptionalTypeCorrect.md doc/DiscOptionalTypeIncorrect.md doc/DiscTypeIncorrect.md doc/Dog.md -doc/DogAllOf.md doc/Entity.md doc/EntityRef.md doc/EnumArrays.md @@ -142,7 +138,6 @@ lib/src/model/animal.dart lib/src/model/api_response.dart lib/src/model/apple.dart lib/src/model/apple_all_of_disc.dart -lib/src/model/apple_any_of_disc.dart lib/src/model/apple_grandparent_disc.dart lib/src/model/apple_one_of_disc.dart lib/src/model/apple_req_disc.dart @@ -152,7 +147,6 @@ lib/src/model/array_of_number_only.dart lib/src/model/array_test.dart lib/src/model/banana.dart lib/src/model/banana_all_of_disc.dart -lib/src/model/banana_any_of_disc.dart lib/src/model/banana_grandparent_disc.dart lib/src/model/banana_one_of_disc.dart lib/src/model/banana_req_disc.dart @@ -162,7 +156,6 @@ lib/src/model/bar_ref.dart lib/src/model/bar_ref_or_value.dart lib/src/model/capitalization.dart lib/src/model/cat.dart -lib/src/model/cat_all_of.dart lib/src/model/category.dart lib/src/model/class_model.dart lib/src/model/composed_disc_missing_from_properties.dart @@ -179,7 +172,6 @@ lib/src/model/disc_optional_type_correct.dart lib/src/model/disc_optional_type_incorrect.dart lib/src/model/disc_type_incorrect.dart lib/src/model/dog.dart -lib/src/model/dog_all_of.dart lib/src/model/entity.dart lib/src/model/entity_ref.dart lib/src/model/enum_arrays.dart @@ -244,3 +236,112 @@ lib/src/repository_base.dart lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml +test/additional_properties_class_test.dart +test/addressable_test.dart +test/all_of_with_single_ref_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/apple_all_of_disc_test.dart +test/apple_grandparent_disc_test.dart +test/apple_one_of_disc_test.dart +test/apple_req_disc_test.dart +test/apple_test.dart +test/apple_variant1_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/banana_all_of_disc_test.dart +test/banana_grandparent_disc_test.dart +test/banana_one_of_disc_test.dart +test/banana_req_disc_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/capitalization_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/composed_disc_missing_from_properties_test.dart +test/composed_disc_optional_type_correct_test.dart +test/composed_disc_optional_type_inconsistent_test.dart +test/composed_disc_optional_type_incorrect_test.dart +test/composed_disc_required_inconsistent_test.dart +test/composed_disc_type_inconsistent_test.dart +test/composed_disc_type_incorrect_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/disc_missing_from_properties_test.dart +test/disc_optional_type_correct_test.dart +test/disc_optional_type_incorrect_test.dart +test/disc_type_incorrect_test.dart +test/dog_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/extensible_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_api_test.dart +test/foo_basic_get_default_response_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/format_test_test.dart +test/fruit_all_of_disc_test.dart +test/fruit_any_of_disc_test.dart +test/fruit_grandparent_disc_test.dart +test/fruit_inline_disc_one_of1_test.dart +test/fruit_inline_disc_one_of_test.dart +test/fruit_inline_disc_test.dart +test/fruit_inline_inline_disc_one_of1_test.dart +test/fruit_inline_inline_disc_one_of_one_of_test.dart +test/fruit_inline_inline_disc_one_of_test.dart +test/fruit_inline_inline_disc_test.dart +test/fruit_one_of_disc_test.dart +test/fruit_req_disc_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/fruit_variant1_test.dart +test/giga_one_of_test.dart +test/grape_variant1_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/one_of_primitive_child_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/parent_test.dart +test/pasta_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/.openapi-generator/VERSION rename to samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/README.md index 4dab267fb090..3ddbcd3b89f8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md @@ -65,7 +65,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- [*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md [*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar [*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic | [*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive | @@ -73,10 +72,6 @@ Class | Method | HTTP request | Description [*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 | [*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 | [*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 | -======= -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | -[*FakeApi*](doc/FakeApi.md) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md [*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | @@ -129,7 +124,6 @@ Class | Method | HTTP request | Description - [ApiResponse](doc/ApiResponse.md) - [Apple](doc/Apple.md) - [AppleAllOfDisc](doc/AppleAllOfDisc.md) - - [AppleAnyOfDisc](doc/AppleAnyOfDisc.md) - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) - [AppleOneOfDisc](doc/AppleOneOfDisc.md) - [AppleReqDisc](doc/AppleReqDisc.md) @@ -139,7 +133,6 @@ Class | Method | HTTP request | Description - [ArrayTest](doc/ArrayTest.md) - [Banana](doc/Banana.md) - [BananaAllOfDisc](doc/BananaAllOfDisc.md) - - [BananaAnyOfDisc](doc/BananaAnyOfDisc.md) - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) - [BananaOneOfDisc](doc/BananaOneOfDisc.md) - [BananaReqDisc](doc/BananaReqDisc.md) @@ -164,18 +157,11 @@ Class | Method | HTTP request | Description - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) - [Dog](doc/Dog.md) -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/README.md - - [DogAllOf](doc/DogAllOf.md) - [Entity](doc/Entity.md) - [EntityRef](doc/EntityRef.md) - [EnumArrays](doc/EnumArrays.md) - [EnumTest](doc/EnumTest.md) - [Extensible](doc/Extensible.md) -======= - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - [Foo](doc/Foo.md) - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml b/samples/openapi3/client/petstore/dart-next/dio/built_value/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-next/dio/built_value/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Addressable.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Addressable.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Addressable.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Addressable.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AllOfWithSingleRef.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Animal.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Animal.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Animal.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AnotherFakeApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ApiResponse.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Apple.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Apple.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Apple.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/AppleVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ArrayTest.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Banana.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Banana.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Banana.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BananaReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Bar.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Bar.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Bar.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarCreate.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarCreate.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarCreate.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRef.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRef.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/BarRefOrValue.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Capitalization.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Cat.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Cat.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Cat.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Category.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Category.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Category.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Category.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ClassModel.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscMissingFromProperties.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscRequiredInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscRequiredInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscRequiredInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ComposedDiscTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DefaultApi.md similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DefaultApi.md index 3834af5d03ff..27ab9220443c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DefaultApi.md @@ -31,7 +31,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.fooBasicGet(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->fooBasicGet: $e\n'); } ``` @@ -68,7 +68,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.list(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->list: $e\n'); } ``` @@ -105,7 +105,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.oneofGet(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->oneofGet: $e\n'); } ``` @@ -142,7 +142,7 @@ final JsonObject body = ; // JsonObject | try { api.test(body); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->test: $e\n'); } ``` @@ -182,7 +182,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.variant1Get(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->variant1Get: $e\n'); } ``` @@ -219,7 +219,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.variant2Get(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->variant2Get: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DeprecatedObject.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscMissingFromProperties.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeCorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscOptionalTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/DiscTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Dog.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Dog.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Dog.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Entity.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Entity.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Entity.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Entity.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EntityRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EntityRef.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EntityRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumArrays.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/EnumTest.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Extensible.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Extensible.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Extensible.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Extensible.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeApi.md similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeApi.md index d22be3734b76..a93c2ba8f348 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeApi.md @@ -9,7 +9,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | @@ -29,45 +28,6 @@ Method | HTTP request | Description [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -# **fakeBigDecimalMap** -> FakeBigDecimalMap200Response fakeBigDecimalMap() - - - -for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeBigDecimalMap(); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fakeHealthGet** > HealthCheckResult fakeHealthGet() @@ -112,7 +72,7 @@ test http signature authentication ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final Pet pet = ; // Pet | Pet object that needs to be added to the store @@ -637,15 +597,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**BuiltList<String>**](BuiltList.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**BuiltList<String>**](BuiltList.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to r'-efg'] + **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to r'-efg'] **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](BuiltList.md)| | [optional] - **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'] + **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to r'$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to r'-efg'] ### Return type @@ -671,7 +631,7 @@ Fake endpoint to test group parameters (optional) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final int requiredStringGroup = 56; // int | Required String in group parameters @@ -831,13 +791,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**BuiltList<String>**](BuiltList.md)| | - **ioutil** | [**BuiltList<String>**](BuiltList.md)| | - **http** | [**BuiltList<String>**](BuiltList.md)| | - **url** | [**BuiltList<String>**](BuiltList.md)| | - **context** | [**BuiltList<String>**](BuiltList.md)| | + **pipe** | [**BuiltList<String>**](String.md)| | + **ioutil** | [**BuiltList<String>**](String.md)| | + **http** | [**BuiltList<String>**](String.md)| | + **url** | [**BuiltList<String>**](String.md)| | + **context** | [**BuiltList<String>**](String.md)| | **allowEmpty** | **String**| | - **language** | [**BuiltMap<String, String>**](BuiltMap.md)| | [optional] + **language** | [**BuiltMap<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Foo.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Foo.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Foo.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooBasicGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooBasicGetDefaultResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooBasicGetDefaultResponse.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooBasicGetDefaultResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRef.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRef.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FooRefOrValue.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FormatTest.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Fruit.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Fruit.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Fruit.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAnyOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitAnyOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAnyOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineDiscOneOf1.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitType.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitType.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/FruitVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GigaOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GigaOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GigaOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GigaOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GrapeVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/GrapeVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GrapeVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/HealthCheckResult.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MapTest.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MapTest.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Model200Response.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelClient.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelEnumClass.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelFile.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelList.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelList.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ModelReturn.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Name.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Name.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NullableClass.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/NumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ObjectWithDeprecatedFields.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ObjectWithDeprecatedFields.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OneOfPrimitiveChild.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OneOfPrimitiveChild.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OneOfPrimitiveChild.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Order.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Order.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterComposite.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnum.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumDefaultValue.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumInteger.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterEnumIntegerDefaultValue.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/OuterObjectWithEnumProperty.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Parent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Parent.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Parent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pasta.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pasta.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pasta.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pasta.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pet.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pet.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PetApi.md similarity index 98% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PetApi.md index dfb6ff45b110..5453eed90025 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PetApi.md @@ -138,7 +138,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](BuiltList.md)| Status values that need to be considered for filter | + **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | ### Return type @@ -183,7 +183,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltSet<String>**](BuiltSet.md)| Tags to filter by | + **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by | ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pizza.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pizza.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Pizza.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pizza.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PizzaSpeziale.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/PizzaSpeziale.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PizzaSpeziale.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SingleRefType.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/SpecialModelName.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/StoreApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Tag.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/Tag.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/User.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/User.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/UserApi.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/doc/UserApi.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/apis.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/apis.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/models.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/models.dart index 00f307146d5c..16d6bf568fe1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/models.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/models.dart @@ -10,7 +10,6 @@ export 'package:openapi/src/model/animal.dart'; export 'package:openapi/src/model/api_response.dart'; export 'package:openapi/src/model/apple.dart'; export 'package:openapi/src/model/apple_all_of_disc.dart'; -export 'package:openapi/src/model/apple_any_of_disc.dart'; export 'package:openapi/src/model/apple_grandparent_disc.dart'; export 'package:openapi/src/model/apple_one_of_disc.dart'; export 'package:openapi/src/model/apple_req_disc.dart'; @@ -20,7 +19,6 @@ export 'package:openapi/src/model/array_of_number_only.dart'; export 'package:openapi/src/model/array_test.dart'; export 'package:openapi/src/model/banana.dart'; export 'package:openapi/src/model/banana_all_of_disc.dart'; -export 'package:openapi/src/model/banana_any_of_disc.dart'; export 'package:openapi/src/model/banana_grandparent_disc.dart'; export 'package:openapi/src/model/banana_one_of_disc.dart'; export 'package:openapi/src/model/banana_req_disc.dart'; @@ -30,7 +28,6 @@ export 'package:openapi/src/model/bar_ref.dart'; export 'package:openapi/src/model/bar_ref_or_value.dart'; export 'package:openapi/src/model/capitalization.dart'; export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; export 'package:openapi/src/model/category.dart'; export 'package:openapi/src/model/class_model.dart'; export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; @@ -46,7 +43,6 @@ export 'package:openapi/src/model/disc_optional_type_correct.dart'; export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; export 'package:openapi/src/model/disc_type_incorrect.dart'; export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; export 'package:openapi/src/model/entity.dart'; export 'package:openapi/src/model/entity_ref.dart'; export 'package:openapi/src/model/enum_arrays.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/openapi.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/openapi.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart similarity index 73% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart index ce362546613c..28ca0f8e189c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart @@ -4,11 +4,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; +part 'another_fake_api.g.dart'; + class AnotherFakeApi { final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,13 +33,8 @@ class AnotherFakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart - /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ -======= /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart + Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -43,42 +43,9 @@ class AnotherFakeApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/another_fake_api.dart Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); -======= - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart + _bodyData = encodeBodyParameter( + _repository, modelClient, const TypeInfo(ModelClient)); final _response = await rawApi.call123testSpecialTags( body: _bodyData, @@ -97,10 +64,8 @@ class AnotherFakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ModelClient)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -142,7 +107,7 @@ class AnotherFakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> call123testSpecialTags({ Object? body, String? requestContentType, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart similarity index 60% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart index 8f45723788e7..340e65c4594b 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart @@ -4,12 +4,17 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/bar.dart'; import 'package:openapi/src/model/bar_create.dart'; +part 'bar_api.g.dart'; + class BarApi { final BarApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,17 +33,10 @@ class BarApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart /// Returns a [Future] containing a [Response] with a [Bar] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createBar({ required BarCreate barCreate, -======= - /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioException] if API call or serialization fails - Future> createFoo({ - Foo? foo, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -47,30 +45,12 @@ class BarApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(barCreate, const TypeInfo(BarCreate)); + _bodyData = + encodeBodyParameter(_repository, barCreate, const TypeInfo(BarCreate)); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart final _response = await rawApi.createBar( body: _bodyData, requestContentType: 'application/json', -======= - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -85,10 +65,7 @@ class BarApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Bar), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Bar)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -129,19 +106,13 @@ class BarApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart /// Returns a [Future] containing a [Response] with a [Bar] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createBar({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioException] if API call or serialization fails - Future>> getAllFoos({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -173,38 +144,5 @@ class BarApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/bar_api.dart -======= - - BuiltList? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(BuiltList, [FullType(FooRefOrValue)]), - ) as BuiltList; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart } } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart similarity index 62% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart index b92b0e588729..7c9a637f1329 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart @@ -4,6 +4,9 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; @@ -14,6 +17,8 @@ import 'package:openapi/src/model/fruit_all_of_disc.dart'; import 'package:openapi/src/model/fruit_variant1.dart'; import 'package:openapi/src/model/giga_one_of.dart'; +part 'default_api.g.dart'; + class DefaultApi { final DefaultApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -31,16 +36,9 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooBasicGet({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ - required Pet pet, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart + Future> fooBasicGet({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -60,31 +58,16 @@ class DefaultApi { FooBasicGetDefaultResponse? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FooBasicGetDefaultResponse), - ); + : decodeResponse(_repository, rawResponse, + const TypeInfo(FooBasicGetDefaultResponse)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart error: error, stackTrace: stackTrace, ); @@ -113,17 +96,9 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data - /// Throws [DioError] if API call or serialization fails - Future> list({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ - required int petId, - String? apiKey, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart + Future> list({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -131,32 +106,7 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final _response = await rawApi.list( -======= - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - if (apiKey != null) r'api_key': apiKey, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -171,15 +121,12 @@ class DefaultApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(GigaOneOf), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(GigaOneOf)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -208,16 +155,9 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [Fruit] as data - /// Throws [DioError] if API call or serialization fails - Future> oneofGet({ -======= - /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioException] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required BuiltList status, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart + Future> oneofGet({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -240,10 +180,7 @@ class DefaultApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Fruit), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Fruit)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -278,18 +215,10 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> test({ JsonObject? body, -======= - /// Returns a [Future] containing a [Response] with a [BuiltSet] as data - /// Throws [DioException] if API call or serialization fails - @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required BuiltSet tags, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -298,7 +227,8 @@ class DefaultApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter( + _repository, body, const TypeInfo.nullable(JsonObject)); final _response = await rawApi.test( body: _bodyData, @@ -326,7 +256,7 @@ class DefaultApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant1Get({ CancelToken? cancelToken, Map? headers, @@ -350,10 +280,8 @@ class DefaultApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FruitVariant1), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FruitVariant1)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -387,16 +315,9 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data - /// Throws [DioError] if API call or serialization fails - Future> variant2Get({ -======= - /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ - required int petId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart + Future> variant2Get({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -404,33 +325,7 @@ class DefaultApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final _response = await rawApi.variant2Get( -======= - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -445,10 +340,8 @@ class DefaultApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FruitAllOfDisc), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FruitAllOfDisc)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -488,20 +381,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fooBasicGet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePet({ - required Pet pet, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -525,29 +411,7 @@ class DefaultApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -568,22 +432,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> list({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ - required int petId, - String? name, - String? status, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -591,11 +446,7 @@ class DefaultApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final _path = r'/oneof-primitive'; -======= - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart final _options = Options( method: r'GET', headers: { @@ -611,31 +462,7 @@ class DefaultApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - _bodyData = { - if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)), - if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -656,22 +483,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [Fruit] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> oneofGet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -679,11 +497,7 @@ class DefaultApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final _path = r'/oneof'; -======= - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart final _options = Options( method: r'GET', headers: { @@ -699,31 +513,7 @@ class DefaultApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - if (file != null) r'file': file, - }); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -733,7 +523,6 @@ class DefaultApiRaw { ); } -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// test /// /// @@ -747,7 +536,7 @@ class DefaultApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> test({ Object? body, String? requestContentType, @@ -775,26 +564,6 @@ class DefaultApiRaw { responseType: responseType, validateStatus: validateStatus, ); -======= - ApiResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ApiResponse), - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart return await _dio.request( _path, @@ -817,22 +586,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant1Get({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -840,11 +600,7 @@ class DefaultApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart final _path = r'/variant1'; -======= - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart final _options = Options( method: r'GET', headers: { @@ -860,31 +616,7 @@ class DefaultApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - r'requiredFile': requiredFile, - }); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -894,7 +626,6 @@ class DefaultApiRaw { ); } -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/default_api.dart /// variant2Get /// /// @@ -907,7 +638,7 @@ class DefaultApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant2Get({ Object? body, String? requestContentType, @@ -935,26 +666,6 @@ class DefaultApiRaw { responseType: responseType, validateStatus: validateStatus, ); -======= - ApiResponse? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(ApiResponse), - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart return await _dio.request( _path, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart similarity index 81% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart index 4b7997befee0..b915fdcde47a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart @@ -4,6 +4,9 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; @@ -19,6 +22,8 @@ import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; +part 'fake_api.g.dart'; + class FakeApi { final FakeApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -37,7 +42,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeHealthGet({ CancelToken? cancelToken, Map? headers, @@ -61,15 +66,13 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(HealthCheckResult), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(HealthCheckResult)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -102,11 +105,11 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeHttpSignatureTest({ required Pet pet, - String? query1, - String? header1, + required String query1, + required String header1, CancelToken? cancelToken, Map? headers, Map? extra, @@ -115,19 +118,16 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); final _response = await rawApi.fakeHttpSignatureTest( - query1: query1 == null - ? null - : encodeQueryParameter( - _repository, - query1, - const TypeInfo(String), - ), - header1: header1 == null - ? null - : _repository.serialize(header1, const TypeInfo(String)).toString(), + query1: encodeQueryParameter( + _repository, + query1, + const TypeInfo(String), + ), + header1: + encodeStringParameter(_repository, header1, const TypeInfo(String)), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -154,9 +154,9 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterBooleanSerialize({ - bool? body, + required bool body, CancelToken? cancelToken, Map? headers, Map? extra, @@ -165,7 +165,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(bool)); final _response = await rawApi.fakeOuterBooleanSerialize( body: _bodyData, @@ -184,15 +184,12 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(bool), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(bool)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -223,9 +220,9 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, + required OuterComposite outerComposite, CancelToken? cancelToken, Map? headers, Map? extra, @@ -234,9 +231,8 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = outerComposite == null - ? null - : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); + _bodyData = encodeBodyParameter( + _repository, outerComposite, const TypeInfo(OuterComposite)); final _response = await rawApi.fakeOuterCompositeSerialize( body: _bodyData, @@ -255,15 +251,13 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(OuterComposite), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(OuterComposite)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -294,9 +288,9 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterNumberSerialize({ - num? body, + required num body, CancelToken? cancelToken, Map? headers, Map? extra, @@ -305,7 +299,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(num)); final _response = await rawApi.fakeOuterNumberSerialize( body: _bodyData, @@ -324,15 +318,12 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(num), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(num)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -363,9 +354,9 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterStringSerialize({ - String? body, + required String body, CancelToken? cancelToken, Map? headers, Map? extra, @@ -374,7 +365,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(String)); final _response = await rawApi.fakeOuterStringSerialize( body: _bodyData, @@ -393,15 +384,12 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(String)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -432,7 +420,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakePropertyEnumIntegerSerialize({ required OuterObjectWithEnumProperty outerObjectWithEnumProperty, @@ -444,7 +432,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(outerObjectWithEnumProperty, + _bodyData = encodeBodyParameter(_repository, outerObjectWithEnumProperty, const TypeInfo(OuterObjectWithEnumProperty)); final _response = await rawApi.fakePropertyEnumIntegerSerialize( @@ -464,15 +452,13 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(OuterObjectWithEnumProperty), - ); + : decodeResponse(_repository, rawResponse, + const TypeInfo(OuterObjectWithEnumProperty)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -503,9 +489,9 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithBinary({ - MultipartFile? body, + required MultipartFile? body, CancelToken? cancelToken, Map? headers, Map? extra, @@ -514,7 +500,8 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body?.finalize(); + _bodyData = encodeBodyParameter( + _repository, body, const TypeInfo.nullable(MultipartFile)); final _response = await rawApi.testBodyWithBinary( body: _bodyData, @@ -543,7 +530,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithFileSchema({ required FileSchemaTestClass fileSchemaTestClass, CancelToken? cancelToken, @@ -554,8 +541,8 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( - fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + _bodyData = encodeBodyParameter( + _repository, fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); final _response = await rawApi.testBodyWithFileSchema( body: _bodyData, @@ -585,7 +572,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithQueryParams({ required String query, required User user, @@ -597,7 +584,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); final _response = await rawApi.testBodyWithQueryParams( query: encodeQueryParameter( @@ -631,7 +618,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testClientModel({ required ModelClient modelClient, CancelToken? cancelToken, @@ -642,7 +629,8 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter( + _repository, modelClient, const TypeInfo(ModelClient)); final _response = await rawApi.testClientModel( body: _bodyData, @@ -661,15 +649,13 @@ class FakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ModelClient)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -713,22 +699,22 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testEndpointParameters({ required num number, required double double_, required String patternWithoutDelimiter, required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - Uint8List? binary, - Date? date, - DateTime? dateTime, - String? password, - String? callback, + required int integer, + required int int32, + required int int64, + required double float, + required String string, + required Uint8List binary, + required Date date, + required DateTime dateTime, + required String password, + required String callback, CancelToken? cancelToken, Map? headers, Map? extra, @@ -737,7 +723,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = { + final _bodyMap = { if (integer != null) r'integer': encodeFormParameter(_repository, integer, const TypeInfo(int)), @@ -772,6 +758,7 @@ class FakeApi { r'callback': encodeFormParameter(_repository, callback, const TypeInfo(String)), }; + _bodyData = _bodyMap; final _response = await rawApi.testEndpointParameters( body: _bodyData, @@ -792,14 +779,14 @@ class FakeApi { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -808,17 +795,17 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testEnumParameters({ - BuiltList? enumHeaderStringArray, - String? enumHeaderString = '-efg', - BuiltList? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - BuiltList? enumQueryModelArray, - BuiltList? enumFormStringArray, - String? enumFormString, + required BuiltList enumHeaderStringArray, + EnumHeaderStringEnum enumHeaderString = EnumHeaderStringEnum.efg, + required BuiltList enumQueryStringArray, + EnumQueryStringEnum enumQueryString = EnumQueryStringEnum.efg, + required EnumQueryIntegerEnum enumQueryInteger, + required EnumQueryDoubleEnum enumQueryDouble, + required BuiltList enumQueryModelArray, + BuiltList? enumFormStringArray = [ r'$' ], + EnumFormStringEnum enumFormString = EnumFormStringEnum.efg, CancelToken? cancelToken, Map? headers, Map? extra, @@ -827,75 +814,60 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = { + final _bodyMap = { if (enumFormStringArray != null) r'enum_form_string_array': encodeFormParameter( _repository, enumFormStringArray, - const TypeInfo(String, [ - const TypeInfo(String), + const TypeInfo(BuiltList, [ + const TypeInfo(InnerEnum), ])), if (enumFormString != null) r'enum_form_string': encodeFormParameter( - _repository, enumFormString, const TypeInfo(String)), + _repository, enumFormString, const TypeInfo(EnumFormStringEnum)), }; + _bodyData = _bodyMap; final _response = await rawApi.testEnumParameters( - enumHeaderStringArray: enumHeaderStringArray == null - ? null - : _repository - .serialize( - enumHeaderStringArray, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ])) - .toString(), - enumHeaderString: enumHeaderString == null - ? null - : _repository - .serialize(enumHeaderString, const TypeInfo(String)) - .toString(), - enumQueryStringArray: enumQueryStringArray == null - ? null - : encodeQueryParameter( - _repository, - enumQueryStringArray, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.multi, - ), - enumQueryString: enumQueryString == null - ? null - : encodeQueryParameter( - _repository, - enumQueryString, - const TypeInfo(String), - ), - enumQueryInteger: enumQueryInteger == null - ? null - : encodeQueryParameter( - _repository, - enumQueryInteger, - const TypeInfo(int), - ), - enumQueryDouble: enumQueryDouble == null - ? null - : encodeQueryParameter( - _repository, - enumQueryDouble, - const TypeInfo(double), - ), - enumQueryModelArray: enumQueryModelArray == null - ? null - : encodeQueryParameter( - _repository, - enumQueryModelArray, - const TypeInfo(BuiltList, [ - const TypeInfo(ModelEnumClass), - ]), - format: ListFormat.multi, - ), + enumHeaderStringArray: encodeStringParameter( + _repository, + enumHeaderStringArray, + const TypeInfo(BuiltList, [ + const TypeInfo(EnumHeaderStringArrayEnum), + ])), + enumHeaderString: encodeStringParameter( + _repository, enumHeaderString, const TypeInfo(EnumHeaderStringEnum)), + enumQueryStringArray: encodeQueryParameter( + _repository, + enumQueryStringArray, + const TypeInfo(BuiltList, [ + const TypeInfo(EnumQueryStringArrayEnum), + ]), + format: ListFormat.multi, + ), + enumQueryString: encodeQueryParameter( + _repository, + enumQueryString, + const TypeInfo(EnumQueryStringEnum), + ), + enumQueryInteger: encodeQueryParameter( + _repository, + enumQueryInteger, + const TypeInfo(EnumQueryIntegerEnum), + ), + enumQueryDouble: encodeQueryParameter( + _repository, + enumQueryDouble, + const TypeInfo(EnumQueryDoubleEnum), + ), + enumQueryModelArray: encodeQueryParameter( + _repository, + enumQueryModelArray, + const TypeInfo(BuiltList, [ + const TypeInfo(ModelEnumClass), + ]), + format: ListFormat.multi, + ), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -927,14 +899,14 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testGroupParameters({ required int requiredStringGroup, required bool requiredBooleanGroup, required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, + required int stringGroup, + required bool booleanGroup, + required int int64Group, CancelToken? cancelToken, Map? headers, Map? extra, @@ -948,33 +920,25 @@ class FakeApi { requiredStringGroup, const TypeInfo(int), ), - requiredBooleanGroup: _repository - .serialize(requiredBooleanGroup, const TypeInfo(bool)) - .toString(), + requiredBooleanGroup: encodeStringParameter( + _repository, requiredBooleanGroup, const TypeInfo(bool)), requiredInt64Group: encodeQueryParameter( _repository, requiredInt64Group, const TypeInfo(int), ), - stringGroup: stringGroup == null - ? null - : encodeQueryParameter( - _repository, - stringGroup, - const TypeInfo(int), - ), - booleanGroup: booleanGroup == null - ? null - : _repository - .serialize(booleanGroup, const TypeInfo(bool)) - .toString(), - int64Group: int64Group == null - ? null - : encodeQueryParameter( - _repository, - int64Group, - const TypeInfo(int), - ), + stringGroup: encodeQueryParameter( + _repository, + stringGroup, + const TypeInfo(int), + ), + booleanGroup: encodeStringParameter( + _repository, booleanGroup, const TypeInfo(bool)), + int64Group: encodeQueryParameter( + _repository, + int64Group, + const TypeInfo(int), + ), cancelToken: cancelToken, headers: headers, extra: extra, @@ -999,7 +963,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testInlineAdditionalProperties({ required BuiltMap requestBody, CancelToken? cancelToken, @@ -1010,9 +974,10 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( + _bodyData = encodeBodyParameter( + _repository, requestBody, - const TypeInfo(String, [ + const TypeInfo(BuiltMap, [ TypeInfo(String), const TypeInfo(String), ])); @@ -1045,7 +1010,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testJsonFormData({ required String param, required String param2, @@ -1057,11 +1022,12 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = { + final _bodyMap = { r'param': encodeFormParameter(_repository, param, const TypeInfo(String)), r'param2': encodeFormParameter(_repository, param2, const TypeInfo(String)), }; + _bodyData = _bodyMap; final _response = await rawApi.testJsonFormData( body: _bodyData, @@ -1096,7 +1062,7 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testQueryParameterCollectionFormat({ required BuiltList pipe, required BuiltList ioutil, @@ -1104,7 +1070,7 @@ class FakeApi { required BuiltList url, required BuiltList context, required String allowEmpty, - BuiltMap? language, + required BuiltMap language, CancelToken? cancelToken, Map? headers, Map? extra, @@ -1158,16 +1124,14 @@ class FakeApi { allowEmpty, const TypeInfo(String), ), - language: language == null - ? null - : encodeQueryParameter( - _repository, - language, - const TypeInfo(BuiltMap, [ - TypeInfo(String), - const TypeInfo(String), - ]), - ), + language: encodeQueryParameter( + _repository, + language, + const TypeInfo(BuiltMap, [ + TypeInfo(String), + const TypeInfo(String), + ]), + ), cancelToken: cancelToken, headers: headers, extra: extra, @@ -1197,7 +1161,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeHealthGet({ Object? body, String? requestContentType, @@ -1251,7 +1215,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeHttpSignatureTest({ Object? query1, String? header1, @@ -1317,7 +1281,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterBooleanSerialize({ Object? body, String? requestContentType, @@ -1369,7 +1333,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterCompositeSerialize({ Object? body, String? requestContentType, @@ -1421,7 +1385,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterNumberSerialize({ Object? body, String? requestContentType, @@ -1473,7 +1437,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakeOuterStringSerialize({ Object? body, String? requestContentType, @@ -1525,7 +1489,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fakePropertyEnumIntegerSerialize({ Object? body, String? requestContentType, @@ -1577,7 +1541,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithBinary({ Object? body, String? requestContentType, @@ -1629,7 +1593,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithFileSchema({ Object? body, String? requestContentType, @@ -1682,7 +1646,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testBodyWithQueryParams({ required Object query, Object? body, @@ -1740,7 +1704,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testClientModel({ Object? body, String? requestContentType, @@ -1805,7 +1769,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testEndpointParameters({ Object? body, String? requestContentType, @@ -1855,14 +1819,14 @@ class FakeApiRaw { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1871,7 +1835,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testEnumParameters({ String? enumHeaderStringArray, String? enumHeaderString, @@ -1949,7 +1913,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testGroupParameters({ required Object requiredStringGroup, required String requiredBooleanGroup, @@ -2023,7 +1987,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testInlineAdditionalProperties({ Object? body, String? requestContentType, @@ -2076,7 +2040,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testJsonFormData({ Object? body, String? requestContentType, @@ -2134,7 +2098,7 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testQueryParameterCollectionFormat({ required Object pipe, required Object ioutil, @@ -2191,3 +2155,198 @@ class FakeApiRaw { ); } } + +class EnumHeaderStringArrayEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'>') + static const EnumHeaderStringArrayEnum greaterThan = + _$enumHeaderStringArrayEnum_greaterThan; + @BuiltValueEnumConst(wireName: r'$') + static const EnumHeaderStringArrayEnum dollar = + _$enumHeaderStringArrayEnum_dollar; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumHeaderStringArrayEnum unknownDefaultOpenApi = + _$enumHeaderStringArrayEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumHeaderStringArrayEnumSerializer; + + const EnumHeaderStringArrayEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumHeaderStringArrayEnumValues; + static EnumHeaderStringArrayEnum valueOf(String name) => + _$enumHeaderStringArrayEnumValueOf(name); +} + +class EnumHeaderStringEnum extends EnumClass { + /// Header parameter enum test (string) + @BuiltValueEnumConst(wireName: r'_abc') + static const EnumHeaderStringEnum abc = _$enumHeaderStringEnum_abc; + + /// Header parameter enum test (string) + @BuiltValueEnumConst(wireName: r'-efg') + static const EnumHeaderStringEnum efg = _$enumHeaderStringEnum_efg; + + /// Header parameter enum test (string) + @BuiltValueEnumConst(wireName: r'(xyz)') + static const EnumHeaderStringEnum leftParenthesisXyzRightParenthesis = + _$enumHeaderStringEnum_leftParenthesisXyzRightParenthesis; + + /// Header parameter enum test (string) + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumHeaderStringEnum unknownDefaultOpenApi = + _$enumHeaderStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumHeaderStringEnumSerializer; + + const EnumHeaderStringEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumHeaderStringEnumValues; + static EnumHeaderStringEnum valueOf(String name) => + _$enumHeaderStringEnumValueOf(name); +} + +class EnumQueryStringArrayEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'>') + static const EnumQueryStringArrayEnum greaterThan = + _$enumQueryStringArrayEnum_greaterThan; + @BuiltValueEnumConst(wireName: r'$') + static const EnumQueryStringArrayEnum dollar = + _$enumQueryStringArrayEnum_dollar; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumQueryStringArrayEnum unknownDefaultOpenApi = + _$enumQueryStringArrayEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumQueryStringArrayEnumSerializer; + + const EnumQueryStringArrayEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumQueryStringArrayEnumValues; + static EnumQueryStringArrayEnum valueOf(String name) => + _$enumQueryStringArrayEnumValueOf(name); +} + +class EnumQueryStringEnum extends EnumClass { + /// Query parameter enum test (string) + @BuiltValueEnumConst(wireName: r'_abc') + static const EnumQueryStringEnum abc = _$enumQueryStringEnum_abc; + + /// Query parameter enum test (string) + @BuiltValueEnumConst(wireName: r'-efg') + static const EnumQueryStringEnum efg = _$enumQueryStringEnum_efg; + + /// Query parameter enum test (string) + @BuiltValueEnumConst(wireName: r'(xyz)') + static const EnumQueryStringEnum leftParenthesisXyzRightParenthesis = + _$enumQueryStringEnum_leftParenthesisXyzRightParenthesis; + + /// Query parameter enum test (string) + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumQueryStringEnum unknownDefaultOpenApi = + _$enumQueryStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumQueryStringEnumSerializer; + + const EnumQueryStringEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumQueryStringEnumValues; + static EnumQueryStringEnum valueOf(String name) => + _$enumQueryStringEnumValueOf(name); +} + +class EnumQueryIntegerEnum extends EnumClass { + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireNumber: 1) + static const EnumQueryIntegerEnum number1 = _$enumQueryIntegerEnum_number1; + + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireNumber: -2) + static const EnumQueryIntegerEnum numberNegative2 = + _$enumQueryIntegerEnum_numberNegative2; + + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const EnumQueryIntegerEnum unknownDefaultOpenApi = + _$enumQueryIntegerEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumQueryIntegerEnumSerializer; + + const EnumQueryIntegerEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumQueryIntegerEnumValues; + static EnumQueryIntegerEnum valueOf(String name) => + _$enumQueryIntegerEnumValueOf(name); +} + +class EnumQueryDoubleEnum extends EnumClass { + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireName: r'1.1') + static const EnumQueryDoubleEnum number1Period1 = + _$enumQueryDoubleEnum_number1Period1; + + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireName: r'-1.2') + static const EnumQueryDoubleEnum numberNegative1Period2 = + _$enumQueryDoubleEnum_numberNegative1Period2; + + /// Query parameter enum test (double) + @BuiltValueEnumConst(wireName: r'11184809', fallback: true) + static const EnumQueryDoubleEnum unknownDefaultOpenApi = + _$enumQueryDoubleEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumQueryDoubleEnumSerializer; + + const EnumQueryDoubleEnum._(String name) : super(name); + + static BuiltSet get values => + _$enumQueryDoubleEnumValues; + static EnumQueryDoubleEnum valueOf(String name) => + _$enumQueryDoubleEnumValueOf(name); +} + +class InnerEnum extends EnumClass { + static Serializer get serializer => _$innerEnumSerializer; + + const InnerEnum._(String name) : super(name); + + static BuiltSet get values => _$innerEnumValues; + static InnerEnum valueOf(String name) => _$innerEnumValueOf(name); +} + +class EnumFormStringEnum extends EnumClass { + /// Form parameter enum test (string) + @BuiltValueEnumConst(wireName: r'_abc') + static const EnumFormStringEnum abc = _$enumFormStringEnum_abc; + + /// Form parameter enum test (string) + @BuiltValueEnumConst(wireName: r'-efg') + static const EnumFormStringEnum efg = _$enumFormStringEnum_efg; + + /// Form parameter enum test (string) + @BuiltValueEnumConst(wireName: r'(xyz)') + static const EnumFormStringEnum leftParenthesisXyzRightParenthesis = + _$enumFormStringEnum_leftParenthesisXyzRightParenthesis; + + /// Form parameter enum test (string) + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumFormStringEnum unknownDefaultOpenApi = + _$enumFormStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => + _$enumFormStringEnumSerializer; + + const EnumFormStringEnum._(String name) : super(name); + + static BuiltSet get values => _$enumFormStringEnumValues; + static EnumFormStringEnum valueOf(String name) => + _$enumFormStringEnumValueOf(name); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart index 48f283564f93..022dec341edd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart @@ -4,11 +4,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; +part 'fake_classname_tags123_api.g.dart'; + class FakeClassnameTags123Api { final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,13 +33,8 @@ class FakeClassnameTags123Api { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart - /// Throws [DioError] if API call or serialization fails - Future> testClassname({ -======= /// Throws [DioException] if API call or serialization fails - Future> testClassname({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -44,32 +44,12 @@ class FakeClassnameTags123Api { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter( + _repository, modelClient, const TypeInfo(ModelClient)); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart final _response = await rawApi.testClassname( body: _bodyData, requestContentType: 'application/json', -======= - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -84,10 +64,8 @@ _bodyData=jsonEncode(modelClient); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ModelClient)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -129,7 +107,7 @@ class FakeClassnameTags123ApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testClassname({ Object? body, String? requestContentType, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart similarity index 64% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart index 2ad531f165a9..6f734e3e859c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart @@ -4,13 +4,17 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; -import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/foo.dart'; import 'package:openapi/src/model/foo_ref_or_value.dart'; +part 'foo_api.g.dart'; + class FooApi { final FooApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -29,17 +33,10 @@ class FooApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioError] if API call or serialization fails - Future> createFoo({ - Foo? foo, -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ - required String orderId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart + Future> createFoo({ + required Foo foo, CancelToken? cancelToken, Map? headers, Map? extra, @@ -48,8 +45,7 @@ class FooApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = - foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); + _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo(Foo)); final _response = await rawApi.createFoo( body: _bodyData, @@ -68,15 +64,13 @@ class FooApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FooRefOrValue), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FooRefOrValue)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -105,15 +99,9 @@ class FooApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails - Future>> getAllFoos({ -======= - /// Returns a [Future] containing a [Response] with a [Map] as data /// Throws [DioException] if API call or serialization fails - Future>> getInventory({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart + Future>> getAllFoos({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -136,12 +124,12 @@ class FooApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(BuiltList, [ const TypeInfo(FooRefOrValue), - ]), - ); + ])); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -182,20 +170,13 @@ class FooApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createFoo({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ - required int orderId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -227,35 +208,6 @@ class FooApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart -======= - - Order? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart } /// GET all Foos @@ -269,20 +221,13 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Ord /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getAllFoos({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ - required Order order, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -306,27 +251,7 @@ _responseData = rawData == null ? null : deserialize(rawData, 'Ord validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(order); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart _path, data: body, options: _options, @@ -334,34 +259,5 @@ _bodyData=jsonEncode(order); onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/foo_api.dart -======= - - Order? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart } } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart similarity index 56% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart index f9ffdfd29b50..7dd6645958f2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart @@ -4,106 +4,26 @@ import 'dart:async'; import 'package:dio/dio.dart'; -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/api_response.dart'; -======= - -import 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart import 'package:openapi/src/model/pet.dart'; +part 'pet_api.g.dart'; + class PetApi { final PetApiRaw rawApi; final SerializationRepositoryBase _repository; const PetApi(this.rawApi, this._repository); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Add a new pet to the store /// -======= - /// fakeBigDecimalMap - /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FakeBigDecimalMap200Response] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeBigDecimalMap({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/BigDecimalMap'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FakeBigDecimalMap200Response? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FakeBigDecimalMap200Response', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Health check endpoint - /// ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -114,16 +34,10 @@ _responseData = rawData == null ? null : deserialize> addPet({ required Pet pet, -======= - /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeHealthGet({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -132,7 +46,7 @@ _responseData = rawData == null ? null : deserialize(rawData, 'HealthCheckResult', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart } /// Deletes a pet @@ -190,18 +76,10 @@ _responseData = rawData == null ? null : deserialize> deletePet({ required int petId, - String? apiKey, -======= - /// Throws [DioException] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + required String apiKey, CancelToken? cancelToken, Map? headers, Map? extra, @@ -209,61 +87,10 @@ _responseData = rawData == null ? null : deserialize{ - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': query1, - }; - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + apiKey: + encodeStringParameter(_repository, apiKey, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -287,17 +114,10 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required BuiltList status, -======= - /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ - bool? body, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required BuiltList status, CancelToken? cancelToken, Map? headers, Map? extra, @@ -305,52 +125,15 @@ _bodyData=jsonEncode(pet); ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final _response = await rawApi.findPetsByStatus( status: encodeQueryParameter( _repository, status, const TypeInfo(BuiltList, [ - const TypeInfo(String), + const TypeInfo(StatusEnum), ]), format: ListFormat.csv, ), -======= - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -365,12 +148,12 @@ _bodyData=jsonEncode(body); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(BuiltList, [ const TypeInfo(Pet), - ]), - ); + ])); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -405,18 +188,11 @@ _bodyData=jsonEncode(body); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [BuiltSet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') Future>> findPetsByTags({ required BuiltSet tags, -======= - /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -424,7 +200,6 @@ _bodyData=jsonEncode(body); ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final _response = await rawApi.findPetsByTags( tags: encodeQueryParameter( _repository, @@ -434,42 +209,6 @@ _bodyData=jsonEncode(body); ]), format: ListFormat.csv, ), -======= - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(outerComposite); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -484,12 +223,12 @@ _bodyData=jsonEncode(outerComposite); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(BuiltSet, [ const TypeInfo(Pet), - ]), - ); + ])); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -524,17 +263,10 @@ _bodyData=jsonEncode(outerComposite); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getPetById({ required int petId, -======= - /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterNumberSerialize({ - num? body, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -542,45 +274,8 @@ _bodyData=jsonEncode(outerComposite); ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final _response = await rawApi.getPetById( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), -======= - final _path = r'/fake/outer/number'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -595,10 +290,7 @@ _bodyData=jsonEncode(body); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Pet), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Pet)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -633,17 +325,10 @@ _bodyData=jsonEncode(body); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePet({ required Pet pet, -======= - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -651,40 +336,8 @@ _bodyData=jsonEncode(body); ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart Object? _bodyData; - _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); -======= - final _path = r'/fake/outer/string'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); final _response = await rawApi.updatePet( body: _bodyData, @@ -697,35 +350,7 @@ _bodyData=jsonEncode(body); onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return _response; -======= - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart } /// Updates a pet in the store with form data @@ -742,19 +367,12 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePetWithForm({ required int petId, - String? name, - String? status, -======= - /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioException] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + required String name, + required String status, CancelToken? cancelToken, Map? headers, Map? extra, @@ -763,16 +381,17 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = { + final _bodyMap = { if (name != null) r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), if (status != null) r'status': encodeFormParameter(_repository, status, const TypeInfo(String)), }; + _bodyData = _bodyMap; final _response = await rawApi.updatePetWithForm( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -783,26 +402,8 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return _response; } -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(outerObjectWithEnumProperty); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart /// uploads an image /// @@ -819,11 +420,11 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFile({ required int petId, - String? additionalMetadata, - MultipartFile? file, + required String additionalMetadata, + required MultipartFile file, CancelToken? cancelToken, Map? headers, Map? extra, @@ -832,15 +433,18 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = FormData.fromMap({ + final _bodyMap = { if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter( _repository, additionalMetadata, const TypeInfo(String)), - if (file != null) r'file': file, - }); + if (file != null) + r'file': encodeFormParameter( + _repository, file, const TypeInfo(MultipartFile)), + }; + _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFile( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -857,10 +461,8 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ApiResponse)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -897,19 +499,12 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, - String? additionalMetadata, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithBinary({ - MultipartFile? body, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart + required String additionalMetadata, CancelToken? cancelToken, Map? headers, Map? extra, @@ -918,15 +513,17 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = FormData.fromMap({ + final _bodyMap = { if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter( _repository, additionalMetadata, const TypeInfo(String)), - r'requiredFile': requiredFile, - }); + r'requiredFile': encodeFormParameter( + _repository, requiredFile, const TypeInfo(MultipartFile)), + }; + _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFileWithRequiredFile( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -940,29 +537,16 @@ _bodyData=jsonEncode(outerObjectWithEnumProperty); ApiResponse? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ApiResponse)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart error: error, stackTrace: stackTrace, ); @@ -999,18 +583,12 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> addPet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1039,27 +617,7 @@ class PetApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(fileSchemaTestClass); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart _path, data: body, options: _options, @@ -1083,8 +641,7 @@ _bodyData=jsonEncode(fileSchemaTestClass); /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deletePet({ required String petId, String? apiKey, @@ -1092,12 +649,6 @@ _bodyData=jsonEncode(fileSchemaTestClass); String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithQueryParams({ - required String query, - required User user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1128,32 +679,7 @@ _bodyData=jsonEncode(fileSchemaTestClass); validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return await _dio.request( -======= - final _queryParameters = { - r'query': query, - }; - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart _path, data: body, options: _options, @@ -1175,21 +701,14 @@ _bodyData=jsonEncode(user); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioException] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1218,27 +737,9 @@ _bodyData=jsonEncode(user); validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final _queryParameters = { r'status': status, }; -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart return await _dio.request( _path, @@ -1249,35 +750,6 @@ _bodyData=jsonEncode(modelClient); onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart -======= - - ModelClient? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart } /// Finds Pets by tags @@ -1292,9 +764,8 @@ _responseData = rawData == null ? null : deserialize(r /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [BuiltSet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') Future> findPetsByTags({ required Object tags, @@ -1302,25 +773,6 @@ _responseData = rawData == null ? null : deserialize(r String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - MultipartFile? binary, - DateTime? date, - DateTime? dateTime, - String? password, - String? callback, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1349,27 +801,9 @@ _responseData = rawData == null ? null : deserialize(r validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart final _queryParameters = { r'tags': tags, }; -======= - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart return await _dio.request( _path, @@ -1394,29 +828,14 @@ _responseData = rawData == null ? null : deserialize(r /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getPetById({ required String petId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testEnumParameters({ - List? enumHeaderStringArray, - String? enumHeaderString = '-efg', - List? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - List? enumQueryModelArray, - List? enumFormStringArray, - String? enumFormString, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1448,36 +867,7 @@ _responseData = rawData == null ? null : deserialize(r validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return await _dio.request( -======= - final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, - if (enumQueryString != null) r'enum_query_string': enumQueryString, - if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, - if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, - }; - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart _path, data: body, options: _options, @@ -1500,23 +890,12 @@ _responseData = rawData == null ? null : deserialize(r /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Throws [DioException] if API call or serialization fails - Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1570,19 +949,13 @@ _responseData = rawData == null ? null : deserialize(r /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePetWithForm({ required String petId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Throws [DioException] if API call or serialization fails - Future> testInlineAdditionalProperties({ - required Map requestBody, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1612,27 +985,7 @@ _responseData = rawData == null ? null : deserialize(r validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(requestBody); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart _path, data: body, options: _options, @@ -1656,22 +1009,14 @@ _bodyData=jsonEncode(requestBody); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testJsonFormData({ - required String param, - required String param2, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1701,27 +1046,7 @@ _bodyData=jsonEncode(requestBody); validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart _path, data: body, options: _options, @@ -1745,27 +1070,14 @@ _bodyData=jsonEncode(requestBody); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/pet_api.dart /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFileWithRequiredFile({ required String petId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ - required List pipe, - required List ioutil, - required List http, - required List url, - required List context, - required String allowEmpty, - Map? language, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -1805,3 +1117,23 @@ _bodyData=jsonEncode(requestBody); ); } } + +@Deprecated('StatusEnum has been deprecated') +class StatusEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'available') + static const StatusEnum available = _$statusEnum_available; + @BuiltValueEnumConst(wireName: r'pending') + static const StatusEnum pending = _$statusEnum_pending; + @BuiltValueEnumConst(wireName: r'sold') + static const StatusEnum sold = _$statusEnum_sold; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const StatusEnum unknownDefaultOpenApi = + _$statusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$statusEnumSerializer; + + const StatusEnum._(String name) : super(name); + + static BuiltSet get values => _$statusEnumValues; + static StatusEnum valueOf(String name) => _$statusEnumValueOf(name); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart similarity index 61% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart index 4f33ca0cddec..25188260c46a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart @@ -4,12 +4,17 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/order.dart'; +part 'store_api.g.dart'; + class StoreApi { final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -29,15 +34,9 @@ class StoreApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteOrder({ required String orderId, -======= - /// Throws [DioException] if API call or serialization fails - Future> createUser({ - required User user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -45,48 +44,9 @@ class StoreApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart final _response = await rawApi.deleteOrder( orderId: - _repository.serialize(orderId, const TypeInfo(String)).toString(), -======= - final _path = r'/user'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart + encodeStringParameter(_repository, orderId, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -109,16 +69,9 @@ class StoreApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [BuiltMap] as data - /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ - required BuiltList user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -138,34 +91,21 @@ class StoreApi { BuiltMap? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(BuiltMap, [ TypeInfo(String), const TypeInfo(int), - ]), - ); + ])); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart error: error, stackTrace: stackTrace, ); @@ -195,17 +135,10 @@ class StoreApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getOrderById({ required int orderId, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ - required BuiltList user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -214,7 +147,7 @@ class StoreApi { ProgressCallback? onReceiveProgress, }) async { final _response = await rawApi.getOrderById( - orderId: _repository.serialize(orderId, const TypeInfo(int)).toString(), + orderId: encodeStringParameter(_repository, orderId, const TypeInfo(int)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -226,31 +159,15 @@ class StoreApi { Order? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart error: error, stackTrace: stackTrace, ); @@ -280,17 +197,10 @@ class StoreApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> placeOrder({ required Order order, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ - required String username, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -298,23 +208,8 @@ class StoreApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart Object? _bodyData; - _bodyData = _repository.serialize(order, const TypeInfo(Order)); -======= - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart + _bodyData = encodeBodyParameter(_repository, order, const TypeInfo(Order)); final _response = await rawApi.placeOrder( body: _bodyData, @@ -333,15 +228,12 @@ class StoreApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -377,21 +269,14 @@ class StoreApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ - required String username, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -399,12 +284,8 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart final _path = r'/store/order/{order_id}' .replaceAll('{' r'order_id' '}', orderId.toString()); -======= - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart final _options = Options( method: r'DELETE', headers: { @@ -428,39 +309,6 @@ class StoreApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart -======= - - User? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(User), - ) as User; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart } /// Returns pet inventories by status @@ -474,21 +322,13 @@ class StoreApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [BuiltMap] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioException] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -527,36 +367,6 @@ class StoreApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart -======= - - String? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : rawResponse as String; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart } /// Find purchase order by ID @@ -571,20 +381,14 @@ class StoreApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getOrderById({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -631,21 +435,13 @@ class StoreApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updateUser({ - required String username, - required User user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -653,11 +449,7 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart final _path = r'/store/order'; -======= - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart final _options = Options( method: r'POST', headers: { @@ -673,29 +465,7 @@ class StoreApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/store_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart _path, data: body, options: _options, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart index 69e6a8249374..de82febad6f1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart @@ -4,12 +4,17 @@ import 'dart:async'; import 'package:dio/dio.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/user.dart'; +part 'user_api.g.dart'; + class UserApi { final UserApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -29,7 +34,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUser({ required User user, CancelToken? cancelToken, @@ -40,7 +45,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); final _response = await rawApi.createUser( body: _bodyData, @@ -69,7 +74,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithArrayInput({ required BuiltList user, CancelToken? cancelToken, @@ -80,9 +85,10 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( + _bodyData = encodeBodyParameter( + _repository, user, - const TypeInfo(User, [ + const TypeInfo(BuiltList, [ const TypeInfo(User), ])); @@ -113,7 +119,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithListInput({ required BuiltList user, CancelToken? cancelToken, @@ -124,9 +130,10 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( + _bodyData = encodeBodyParameter( + _repository, user, - const TypeInfo(User, [ + const TypeInfo(BuiltList, [ const TypeInfo(User), ])); @@ -157,7 +164,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteUser({ required String username, CancelToken? cancelToken, @@ -169,7 +176,7 @@ class UserApi { }) async { final _response = await rawApi.deleteUser( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -194,7 +201,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getUserByName({ required String username, CancelToken? cancelToken, @@ -206,7 +213,7 @@ class UserApi { }) async { final _response = await rawApi.getUserByName( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -221,15 +228,12 @@ class UserApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(User), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(User)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -261,7 +265,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> loginUser({ required String username, required String password, @@ -297,15 +301,12 @@ class UserApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(String)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -335,7 +336,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> logoutUser({ CancelToken? cancelToken, Map? headers, @@ -370,7 +371,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updateUser({ required String username, required User user, @@ -382,11 +383,11 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); final _response = await rawApi.updateUser( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -419,7 +420,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUser({ Object? body, String? requestContentType, @@ -471,7 +472,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithArrayInput({ Object? body, String? requestContentType, @@ -523,7 +524,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithListInput({ Object? body, String? requestContentType, @@ -575,7 +576,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteUser({ required String username, Object? body, @@ -629,7 +630,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getUserByName({ required String username, Object? body, @@ -684,7 +685,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> loginUser({ required Object username, required Object password, @@ -743,7 +744,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> logoutUser({ Object? body, String? requestContentType, @@ -796,7 +797,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updateUser({ required String username, Object? body, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_client.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart similarity index 70% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart index 056ba3bcd8ec..6ba61211c680 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api_util.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart @@ -21,6 +21,29 @@ Object encodeFormParameter( return serialized; } +String encodeStringParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + return repository.serialize(value, type).toString(); +} + +Object encodeBodyParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + Object encodeQueryParameter( SerializationRepositoryBase repository, T value, @@ -59,3 +82,8 @@ ListParam encodeCollectionQueryParameter( } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } + +TOutput decodeResponse( + SerializationRepositoryBase repository, TInput value, TypeInfo type) { + return repository.deserialize(value, type); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/_exports.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/api_key_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/basic_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/bearer_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/auth/oauth.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/date_serializer.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/addressable.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/all_of_with_single_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/animal.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/api_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/apple_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/array_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/banana_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_create.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/bar_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/capitalization.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/cat.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/category.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/class_model.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/date.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/date.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/date.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/deprecated_object.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_missing_from_properties.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_correct.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/disc_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/dog.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/entity_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_arrays.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/enum_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/extensible.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/file_schema_test_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_basic_get_default_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/foo_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/format_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart new file mode 100644 index 000000000000..72b65b0c3808 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart @@ -0,0 +1,75 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:openapi/src/model/apple_any_of_disc.dart'; +import 'package:openapi/src/model/banana_any_of_disc.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/any_of.dart'; + +part 'fruit_any_of_disc.g.dart'; + +/// FruitAnyOfDisc +/// +/// Properties: +/// * [fruitType] +@BuiltValue() +abstract class FruitAnyOfDisc + implements Built { + /// Any Of [FruitType] + AnyOf get anyOf; + + FruitAnyOfDisc._(); + + factory FruitAnyOfDisc([void updates(FruitAnyOfDiscBuilder b)]) = + _$FruitAnyOfDisc; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitAnyOfDiscBuilder b) => + b..fruitType = b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => + _$FruitAnyOfDiscSerializer(); +} + +class _$FruitAnyOfDiscSerializer + implements PrimitiveSerializer { + @override + final Iterable types = const [FruitAnyOfDisc, _$FruitAnyOfDisc]; + + @override + final String wireName = r'FruitAnyOfDisc'; + + Iterable _serializeProperties( + Serializers serializers, + FruitAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) sync* {} + + @override + Object serialize( + Serializers serializers, + FruitAnyOfDisc object, { + FullType specifiedType = FullType.unspecified, + }) { + final anyOf = object.anyOf; + return serializers.serialize(anyOf, + specifiedType: FullType( + AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()))!; + } + + @override + FruitAnyOfDisc deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitAnyOfDiscBuilder(); + Object? anyOfDataSrc; + return result.build(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_type.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/fruit_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/giga_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/grape_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/has_only_read_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/health_check_result.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/map_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model200_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_client.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart index 02835bd779f5..d5ec2c7c00e7 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart @@ -35,4 +35,4 @@ class ModelEnumClass extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; +typedef ModelEnumClassMixin = _$ModelEnumClassMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_file.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_list.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/model_return.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/name.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/nullable_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/object_with_deprecated_fields.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/one_of_primitive_child.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/order.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_composite.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart index bf08d4aa048d..2d9e8e780333 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart @@ -33,4 +33,4 @@ class OuterEnum extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumMixin = Object with _$OuterEnumMixin; +typedef OuterEnumMixin = _$OuterEnumMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart index 446e5c2fed2d..6e7a76ec0c2f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart @@ -35,5 +35,4 @@ class OuterEnumDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object - with _$OuterEnumDefaultValueMixin; +typedef OuterEnumDefaultValueMixin = _$OuterEnumDefaultValueMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart index d42a7baf5dbd..7489f550e6f6 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart @@ -34,4 +34,4 @@ class OuterEnumInteger extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; +typedef OuterEnumIntegerMixin = _$OuterEnumIntegerMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart index 33b46287a86b..01d7e5b9c806 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -35,5 +35,4 @@ class OuterEnumIntegerDefaultValue extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object - with _$OuterEnumIntegerDefaultValueMixin; +typedef OuterEnumIntegerDefaultValueMixin = _$OuterEnumIntegerDefaultValueMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/outer_object_with_enum_property.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/parent.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pasta.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pet.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/pizza_speziale.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/read_only_first.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart index 5324d92a7831..832e08c24a75 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart @@ -31,4 +31,4 @@ class SingleRefType extends EnumClass { /// corresponding Angular template. /// /// Trigger mixin generation by writing a line like this one next to your enum. -abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; +typedef SingleRefTypeMixin = _$SingleRefTypeMixin; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/special_model_name.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/tag.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/model/user.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart index c9630c637573..e9148e54da0d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart @@ -1,17 +1,18 @@ /// The general rule for implementing this class is /// json == serialize(deserialize(json)) /// object == deserialize(serialize(object)) -/// It doesn't have to be json, +/// Where json in this context means a dart primitive +/// JSON = String | num | bool | null | Uint8List | List | Map abstract class SerializationRepositoryBase { const SerializationRepositoryBase(); - Object serialize( + FutureOr serialize( T src, TypeInfo inputTypeInfo, { Object? context, }); - T deserialize( - Object value, + FutureOr deserialize( + Object? value, TypeInfo targetTypeInfo, { Object? context, }); diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart similarity index 79% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart index 099bd2c75d3c..41de1d5838e2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart @@ -31,7 +31,11 @@ class BuiltValueJsonRepository extends SerializationRepositoryBase { const BuiltValueJsonRepository(this.serializers); @override - T deserialize(Object value, TypeInfo targetTypeInfo, {Object? context}) { + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, + {Object? context}) { + if (value is T) { + return value; + } return serializers.deserialize( value, specifiedType: typeInfoToFullType(targetTypeInfo), @@ -39,7 +43,11 @@ class BuiltValueJsonRepository extends SerializationRepositoryBase { } @override - Object serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + FutureOr serialize(T src, TypeInfo inputTypeInfo, + {Object? context}) { + if (src == null) { + return null; + } return serializers.serialize( src, specifiedType: typeInfoToFullType(inputTypeInfo), diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart similarity index 76% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart index 852390728e2c..5f25b025c11e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart @@ -10,6 +10,7 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; +import 'package:openapi/apis.dart'; import 'package:built_value/iso_8601_date_time_serializer.dart'; import 'package:openapi/models.dart'; @@ -25,7 +26,6 @@ part 'serializers.g.dart'; ApiResponse, Apple, AppleAllOfDisc, - AppleAnyOfDisc, AppleGrandparentDisc, AppleOneOfDisc, AppleReqDisc, @@ -35,7 +35,6 @@ part 'serializers.g.dart'; ArrayTest, Banana, BananaAllOfDisc, - BananaAnyOfDisc, BananaGrandparentDisc, BananaOneOfDisc, BananaReqDisc, @@ -45,8 +44,6 @@ part 'serializers.g.dart'; BarRefOrValue, Capitalization, Cat, - CatAllOf, - $CatAllOf, Category, ClassModel, ComposedDiscMissingFromProperties, @@ -62,8 +59,6 @@ part 'serializers.g.dart'; DiscOptionalTypeIncorrect, DiscTypeIncorrect, Dog, - DogAllOf, - $DogAllOf, Entity, $Entity, EntityRef, @@ -133,49 +128,63 @@ part 'serializers.g.dart'; ]) Serializers serializers = (_$serializers.toBuilder() ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(String)]), - () => MapBuilder(), + const FullType(BuiltList, [FullType(EnumQueryStringArrayEnum)]), + () => ListBuilder, ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(User)]), - () => ListBuilder(), + const FullType(BuiltList, [FullType(EnumHeaderStringArrayEnum)]), + () => ListBuilder, ) ..addBuilderFactory( - const FullType(BuiltSet, [FullType(Pet)]), - () => SetBuilder(), + const FullType(BuiltList, [FullType(InnerEnum)]), + () => ListBuilder, ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(Pet)]), - () => ListBuilder(), + const FullType(BuiltMap, [FullType(String), FullType(String)]), + () => MapBuilder, ) ..addBuilderFactory( - const FullType(BuiltSet, [FullType(BuiltSet)]), - () => SetBuilder(), + const FullType(BuiltList, [FullType(ModelEnumClass)]), + () => ListBuilder, ) ..addBuilderFactory( const FullType(BuiltList, [FullType(FooRefOrValue)]), - () => ListBuilder(), + () => ListBuilder, + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(StatusEnum)]), + () => ListBuilder, ) ..addBuilderFactory( const FullType(BuiltMap, [FullType(String), FullType(int)]), - () => MapBuilder(), + () => MapBuilder, ) ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(BuiltMap)]), - () => MapBuilder(), + const FullType(BuiltSet, [FullType(String)]), + () => SetBuilder, + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(User)]), + () => ListBuilder, + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(Pet)]), + () => ListBuilder, ) ..addBuilderFactory( const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), + () => ListBuilder, ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(BuiltList)]), - () => ListBuilder(), + const FullType(BuiltSet, [FullType(Pet)]), + () => SetBuilder, + ) + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(String)]), + () => MapBuilder, ) ..add(Addressable.serializer) ..add(Animal.serializer) - ..add(CatAllOf.serializer) - ..add(DogAllOf.serializer) ..add(Entity.serializer) ..add(EntityRef.serializer) ..add(Extensible.serializer) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/pom.xml b/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/pom.xml rename to samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/pubspec.yaml b/samples/openapi3/client/petstore/dart-next/dio/built_value/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/pubspec.yaml rename to samples/openapi3/client/petstore/dart-next/dio/built_value/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/addressable_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/addressable_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/addressable_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/all_of_with_single_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/animal_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/animal_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/animal_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/another_fake_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/api_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/apple_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/array_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/banana_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_create_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_create_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_create_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/bar_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/capitalization_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/cat_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/cat_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/cat_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/category_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/category_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/category_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/class_model_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_missing_from_properties_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_correct_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_required_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_required_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_required_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/composed_disc_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/default_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/default_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/default_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/deprecated_object_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_missing_from_properties_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_correct_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_optional_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/disc_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/dog_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/dog_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/entity_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_arrays_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/enum_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/extensible_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/extensible_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/extensible_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fake_classname_tags123_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/file_schema_test_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_basic_get_default_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_basic_get_default_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_basic_get_default_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/foo_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/format_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_any_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_any_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_any_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_inline_inline_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_type_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/fruit_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/giga_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/giga_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/giga_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/grape_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/grape_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/grape_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/has_only_read_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/health_check_result_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/map_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model200_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_client_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_enum_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_file_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_list_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/model_return_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/name_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/nullable_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/object_with_deprecated_fields_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/object_with_deprecated_fields_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/object_with_deprecated_fields_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/one_of_primitive_child_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/one_of_primitive_child_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/one_of_primitive_child_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/order_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_composite_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_default_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_default_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_integer_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_enum_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/outer_object_with_enum_property_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/parent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/parent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/parent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pasta_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pasta_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/pasta_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pet_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_speziale_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_speziale_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_speziale_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/pizza_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/read_only_first_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/single_ref_type_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/special_model_name_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/store_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/tag_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/test/user_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/.gitignore b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/.gitignore rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/README.md b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/README.md similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/README.md rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/README.md index 7f36256df602..231f1b1ae97c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/README.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/README.md @@ -1,4 +1,4 @@ -# Manual tests for Dart-DIO (DO NOT DELETE) +# Manual tests for Dart-Next (DO NOT DELETE) These tests depend on the `build_runner` having already been run in the parent package. diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/pubspec.yaml rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/puby.yaml b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/puby.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/puby.yaml rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/puby.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/authentication_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/authentication_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/authentication_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/authentication_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/fake_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/store_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api/store_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api_util_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/api_util_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api_util_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_serializer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_serializer_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_serializer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value_tests/test/model/date_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES similarity index 65% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES index 5b1bedef564d..f578c31b9270 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES @@ -10,7 +10,6 @@ doc/AnotherFakeApi.md doc/ApiResponse.md doc/Apple.md doc/AppleAllOfDisc.md -doc/AppleAnyOfDisc.md doc/AppleGrandparentDisc.md doc/AppleOneOfDisc.md doc/AppleReqDisc.md @@ -20,7 +19,6 @@ doc/ArrayOfNumberOnly.md doc/ArrayTest.md doc/Banana.md doc/BananaAllOfDisc.md -doc/BananaAnyOfDisc.md doc/BananaGrandparentDisc.md doc/BananaOneOfDisc.md doc/BananaReqDisc.md @@ -31,7 +29,6 @@ doc/BarRef.md doc/BarRefOrValue.md doc/Capitalization.md doc/Cat.md -doc/CatAllOf.md doc/Category.md doc/ClassModel.md doc/ComposedDiscMissingFromProperties.md @@ -48,7 +45,6 @@ doc/DiscOptionalTypeCorrect.md doc/DiscOptionalTypeIncorrect.md doc/DiscTypeIncorrect.md doc/Dog.md -doc/DogAllOf.md doc/Entity.md doc/EntityRef.md doc/EnumArrays.md @@ -142,7 +138,6 @@ lib/src/model/animal.dart lib/src/model/api_response.dart lib/src/model/apple.dart lib/src/model/apple_all_of_disc.dart -lib/src/model/apple_any_of_disc.dart lib/src/model/apple_grandparent_disc.dart lib/src/model/apple_one_of_disc.dart lib/src/model/apple_req_disc.dart @@ -152,7 +147,6 @@ lib/src/model/array_of_number_only.dart lib/src/model/array_test.dart lib/src/model/banana.dart lib/src/model/banana_all_of_disc.dart -lib/src/model/banana_any_of_disc.dart lib/src/model/banana_grandparent_disc.dart lib/src/model/banana_one_of_disc.dart lib/src/model/banana_req_disc.dart @@ -162,7 +156,6 @@ lib/src/model/bar_ref.dart lib/src/model/bar_ref_or_value.dart lib/src/model/capitalization.dart lib/src/model/cat.dart -lib/src/model/cat_all_of.dart lib/src/model/category.dart lib/src/model/class_model.dart lib/src/model/composed_disc_missing_from_properties.dart @@ -178,7 +171,6 @@ lib/src/model/disc_optional_type_correct.dart lib/src/model/disc_optional_type_incorrect.dart lib/src/model/disc_type_incorrect.dart lib/src/model/dog.dart -lib/src/model/dog_all_of.dart lib/src/model/entity.dart lib/src/model/entity_ref.dart lib/src/model/enum_arrays.dart @@ -242,3 +234,112 @@ lib/src/model/user.dart lib/src/repository_base.dart lib/src/repository_impl.dart pubspec.yaml +test/additional_properties_class_test.dart +test/addressable_test.dart +test/all_of_with_single_ref_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/apple_all_of_disc_test.dart +test/apple_grandparent_disc_test.dart +test/apple_one_of_disc_test.dart +test/apple_req_disc_test.dart +test/apple_test.dart +test/apple_variant1_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/banana_all_of_disc_test.dart +test/banana_grandparent_disc_test.dart +test/banana_one_of_disc_test.dart +test/banana_req_disc_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/capitalization_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/composed_disc_missing_from_properties_test.dart +test/composed_disc_optional_type_correct_test.dart +test/composed_disc_optional_type_inconsistent_test.dart +test/composed_disc_optional_type_incorrect_test.dart +test/composed_disc_required_inconsistent_test.dart +test/composed_disc_type_inconsistent_test.dart +test/composed_disc_type_incorrect_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/disc_missing_from_properties_test.dart +test/disc_optional_type_correct_test.dart +test/disc_optional_type_incorrect_test.dart +test/disc_type_incorrect_test.dart +test/dog_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/extensible_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_api_test.dart +test/foo_basic_get_default_response_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/format_test_test.dart +test/fruit_all_of_disc_test.dart +test/fruit_any_of_disc_test.dart +test/fruit_grandparent_disc_test.dart +test/fruit_inline_disc_one_of1_test.dart +test/fruit_inline_disc_one_of_test.dart +test/fruit_inline_disc_test.dart +test/fruit_inline_inline_disc_one_of1_test.dart +test/fruit_inline_inline_disc_one_of_one_of_test.dart +test/fruit_inline_inline_disc_one_of_test.dart +test/fruit_inline_inline_disc_test.dart +test/fruit_one_of_disc_test.dart +test/fruit_req_disc_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/fruit_variant1_test.dart +test/giga_one_of_test.dart +test/grape_variant1_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/one_of_primitive_child_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/parent_test.dart +test/pasta_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md index 667d56fb65c1..31acd6e9f132 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md @@ -125,7 +125,6 @@ Class | Method | HTTP request | Description - [ApiResponse](doc/ApiResponse.md) - [Apple](doc/Apple.md) - [AppleAllOfDisc](doc/AppleAllOfDisc.md) - - [AppleAnyOfDisc](doc/AppleAnyOfDisc.md) - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) - [AppleOneOfDisc](doc/AppleOneOfDisc.md) - [AppleReqDisc](doc/AppleReqDisc.md) @@ -135,7 +134,6 @@ Class | Method | HTTP request | Description - [ArrayTest](doc/ArrayTest.md) - [Banana](doc/Banana.md) - [BananaAllOfDisc](doc/BananaAllOfDisc.md) - - [BananaAnyOfDisc](doc/BananaAnyOfDisc.md) - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) - [BananaOneOfDisc](doc/BananaOneOfDisc.md) - [BananaReqDisc](doc/BananaReqDisc.md) @@ -160,7 +158,6 @@ Class | Method | HTTP request | Description - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) - [Dog](doc/Dog.md) - - [DogAllOf](doc/DogAllOf.md) - [Entity](doc/Entity.md) - [EntityRef](doc/EntityRef.md) - [EnumArrays](doc/EnumArrays.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Addressable.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Addressable.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md similarity index 87% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md index df78e9937613..0ce3be703145 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md @@ -9,7 +9,7 @@ import 'package:openapi/openapi.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] +**color** | **String** | | [optional] [default to r'red'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Apple.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Banana.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Bar.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarApi.md similarity index 97% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarApi.md index 16e6c66fcc10..fd968c59c3ef 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarApi.md @@ -27,7 +27,7 @@ final BarCreate barCreate = ; // BarCreate | try { final response = api.createBar(barCreate); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling BarApi->createBar: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarCreate.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarCreate.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md index b7998f19f95f..4524aa88fa8c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md @@ -9,7 +9,7 @@ import 'package:openapi/openapi.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] +**color** | **String** | | [optional] [default to r'red'] **declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md index 5e51f5aa35bc..dd155ba49e62 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md @@ -9,7 +9,7 @@ import 'package:openapi/openapi.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **String** | | [default to 'default-name'] +**name** | **String** | | [default to r'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DefaultApi.md similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DefaultApi.md index 8797cbaf624c..98b18637fb2c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DefaultApi.md @@ -31,7 +31,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.fooBasicGet(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->fooBasicGet: $e\n'); } ``` @@ -68,7 +68,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.list(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->list: $e\n'); } ``` @@ -105,7 +105,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.oneofGet(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->oneofGet: $e\n'); } ``` @@ -142,7 +142,7 @@ final Object body = ; // Object | try { api.test(body); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->test: $e\n'); } ``` @@ -182,7 +182,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.variant1Get(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->variant1Get: $e\n'); } ``` @@ -219,7 +219,7 @@ final api = Openapi().getDefaultApi(); try { final response = api.variant2Get(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling DefaultApi->variant2Get: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md index 712ed082eb91..ebf151d38720 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md @@ -9,7 +9,7 @@ import 'package:openapi/openapi.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] +**color** | **String** | | [optional] [default to r'red'] **breed** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Entity.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Entity.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EntityRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EntityRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Extensible.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Extensible.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeApi.md similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeApi.md index d804d3fa924f..4c08917075bc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeApi.md @@ -9,7 +9,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | [**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint [**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | @@ -29,45 +28,6 @@ Method | HTTP request | Description [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -# **fakeBigDecimalMap** -> FakeBigDecimalMap200Response fakeBigDecimalMap() - - - -for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeBigDecimalMap(); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fakeHealthGet** > HealthCheckResult fakeHealthGet() @@ -112,7 +72,7 @@ test http signature authentication ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final Pet pet = ; // Pet | Pet object that needs to be added to the store @@ -637,15 +597,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**List<String>**](List.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**List<String>**](List.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to r'-efg'] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to r'-efg'] **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumQueryModelArray** | [**List<ModelEnumClass>**](List.md)| | [optional] - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to r'$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to r'-efg'] ### Return type @@ -671,7 +631,7 @@ Fake endpoint to test group parameters (optional) ### Example ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; final api = Openapi().getFakeApi(); final int requiredStringGroup = 56; // int | Required String in group parameters @@ -831,13 +791,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pipe** | [**List<String>**](List.md)| | - **ioutil** | [**List<String>**](List.md)| | - **http** | [**List<String>**](List.md)| | - **url** | [**List<String>**](List.md)| | - **context** | [**List<String>**](List.md)| | + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | **allowEmpty** | **String**| | - **language** | [**Map<String, String>**](Map.md)| | [optional] + **language** | [**Map<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Foo.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooApi.md similarity index 97% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooApi.md index 7e072f6130a8..ca95ad062c43 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooApi.md @@ -28,7 +28,7 @@ final Foo foo = ; // Foo | The Foo to be created try { final response = api.createFoo(foo); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling FooApi->createFoo: $e\n'); } ``` @@ -68,7 +68,7 @@ final api = Openapi().getFooApi(); try { final response = api.getAllFoos(); print(response); -} catch on DioError (e) { +} catch on DioException (e) { print('Exception when calling FooApi->getAllFoos: $e\n'); } ``` diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooBasicGetDefaultResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooBasicGetDefaultResponse.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Fruit.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAnyOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAnyOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitType.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GigaOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GigaOneOf.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GrapeVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GrapeVariant1.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ObjectWithDeprecatedFields.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OneOfPrimitiveChild.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OneOfPrimitiveChild.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Parent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Parent.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pasta.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pasta.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PetApi.md similarity index 98% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PetApi.md index 6c52f4e4147a..c25d1bd0822e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PetApi.md @@ -138,7 +138,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](List.md)| Status values that need to be considered for filter | + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | ### Return type @@ -183,7 +183,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**Set<String>**](Set.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pizza.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pizza.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PizzaSpeziale.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PizzaSpeziale.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/apis.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/apis.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart index 2916b476fde2..2192ab1bb93c 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/models.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart @@ -7,7 +7,6 @@ export 'package:openapi/src/model/animal.dart'; export 'package:openapi/src/model/api_response.dart'; export 'package:openapi/src/model/apple.dart'; export 'package:openapi/src/model/apple_all_of_disc.dart'; -export 'package:openapi/src/model/apple_any_of_disc.dart'; export 'package:openapi/src/model/apple_grandparent_disc.dart'; export 'package:openapi/src/model/apple_one_of_disc.dart'; export 'package:openapi/src/model/apple_req_disc.dart'; @@ -17,7 +16,6 @@ export 'package:openapi/src/model/array_of_number_only.dart'; export 'package:openapi/src/model/array_test.dart'; export 'package:openapi/src/model/banana.dart'; export 'package:openapi/src/model/banana_all_of_disc.dart'; -export 'package:openapi/src/model/banana_any_of_disc.dart'; export 'package:openapi/src/model/banana_grandparent_disc.dart'; export 'package:openapi/src/model/banana_one_of_disc.dart'; export 'package:openapi/src/model/banana_req_disc.dart'; @@ -27,7 +25,6 @@ export 'package:openapi/src/model/bar_ref.dart'; export 'package:openapi/src/model/bar_ref_or_value.dart'; export 'package:openapi/src/model/capitalization.dart'; export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; export 'package:openapi/src/model/category.dart'; export 'package:openapi/src/model/class_model.dart'; export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; @@ -43,7 +40,6 @@ export 'package:openapi/src/model/disc_optional_type_correct.dart'; export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; export 'package:openapi/src/model/disc_type_incorrect.dart'; export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; export 'package:openapi/src/model/entity.dart'; export 'package:openapi/src/model/entity_ref.dart'; export 'package:openapi/src/model/enum_arrays.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/openapi.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/openapi.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart index e39fc0a1d7f4..d0e3a4ef0491 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart @@ -4,11 +4,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; +part 'another_fake_api.g.dart'; + class AnotherFakeApi { final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,7 +32,7 @@ class AnotherFakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, @@ -39,7 +43,8 @@ class AnotherFakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter( + _repository, modelClient, const TypeInfo(ModelClient)); final _response = await rawApi.call123testSpecialTags( body: _bodyData, @@ -58,15 +63,13 @@ class AnotherFakeApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ModelClient)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -103,7 +106,7 @@ class AnotherFakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> call123testSpecialTags({ Object? body, String? requestContentType, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart similarity index 76% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart index b955537206cd..09dd9c754c7d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart @@ -4,12 +4,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/bar.dart'; import 'package:openapi/src/model/bar_create.dart'; +part 'bar_api.g.dart'; + class BarApi { final BarApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -29,13 +33,8 @@ class BarApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Bar] as data -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart - /// Throws [DioError] if API call or serialization fails - Future> createBar({ -======= /// Throws [DioException] if API call or serialization fails - Future> createBar({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart + Future> createBar({ required BarCreate barCreate, CancelToken? cancelToken, Map? headers, @@ -45,34 +44,12 @@ class BarApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(barCreate, const TypeInfo(BarCreate)); + _bodyData = + encodeBodyParameter(_repository, barCreate, const TypeInfo(BarCreate)); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart final _response = await rawApi.createBar( body: _bodyData, requestContentType: 'application/json', -======= - try { - const _type = FullType(BarCreate); - _bodyData = _serializers.serialize(barCreate, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart cancelToken: cancelToken, headers: headers, extra: extra, @@ -87,10 +64,7 @@ class BarApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Bar), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Bar)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -132,7 +106,7 @@ class BarApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Bar] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createBar({ Object? body, String? requestContentType, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart similarity index 70% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart index ff31b5987cc5..bd8bc185ed97 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart @@ -4,6 +4,8 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; @@ -13,6 +15,8 @@ import 'package:openapi/src/model/fruit_all_of_disc.dart'; import 'package:openapi/src/model/fruit_variant1.dart'; import 'package:openapi/src/model/giga_one_of.dart'; +part 'default_api.g.dart'; + class DefaultApi { final DefaultApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -30,16 +34,9 @@ class DefaultApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> fooBasicGet({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ - required Pet pet, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart + Future> fooBasicGet({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -59,29 +56,16 @@ class DefaultApi { FooBasicGetDefaultResponse? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FooBasicGetDefaultResponse), - ); + : decodeResponse(_repository, rawResponse, + const TypeInfo(FooBasicGetDefaultResponse)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart error: error, stackTrace: stackTrace, ); @@ -110,17 +94,9 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data - /// Throws [DioError] if API call or serialization fails - Future> list({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ - required int petId, - String? apiKey, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart + Future> list({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -143,15 +119,12 @@ _bodyData=jsonEncode(pet); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(GigaOneOf), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(GigaOneOf)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -180,16 +153,9 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [Fruit] as data - /// Throws [DioError] if API call or serialization fails - Future> oneofGet({ -======= - /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioException] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required List status, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart + Future> oneofGet({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -212,10 +178,7 @@ _bodyData=jsonEncode(pet); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Fruit), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Fruit)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -250,18 +213,10 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> test({ Object? body, -======= - /// Returns a [Future] containing a [Response] with a [Set] as data - /// Throws [DioException] if API call or serialization fails - @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required Set tags, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -270,7 +225,8 @@ _bodyData=jsonEncode(pet); ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = body; + _bodyData = + encodeBodyParameter(_repository, body, const TypeInfo.nullable(Object)); final _response = await rawApi.test( body: _bodyData, @@ -298,7 +254,7 @@ _bodyData=jsonEncode(pet); /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant1Get({ CancelToken? cancelToken, Map? headers, @@ -322,10 +278,8 @@ _bodyData=jsonEncode(pet); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FruitVariant1), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FruitVariant1)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -359,16 +313,9 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data - /// Throws [DioError] if API call or serialization fails - Future> variant2Get({ -======= - /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ - required int petId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart + Future> variant2Get({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -391,10 +338,8 @@ _bodyData=jsonEncode(pet); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FruitAllOfDisc), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FruitAllOfDisc)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -434,20 +379,13 @@ class DefaultApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> fooBasicGet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePet({ - required Pet pet, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -471,27 +409,7 @@ class DefaultApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -512,22 +430,13 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> list({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ - required int petId, - String? name, - String? status, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -551,27 +460,7 @@ _bodyData=jsonEncode(pet); validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -592,22 +481,13 @@ _bodyData=jsonEncode(pet); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [Fruit] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> oneofGet({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -631,27 +511,7 @@ _bodyData=jsonEncode(pet); validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -661,7 +521,6 @@ _bodyData=jsonEncode(pet); ); } -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// test /// /// @@ -675,7 +534,7 @@ _bodyData=jsonEncode(pet); /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> test({ Object? body, String? requestContentType, @@ -703,22 +562,6 @@ _bodyData=jsonEncode(pet); responseType: responseType, validateStatus: validateStatus, ); -======= - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart return await _dio.request( _path, @@ -741,22 +584,13 @@ _responseData = rawData == null ? null : deserialize(r /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant1Get({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -780,27 +614,7 @@ _responseData = rawData == null ? null : deserialize(r validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart _path, data: body, options: _options, @@ -810,7 +624,6 @@ _responseData = rawData == null ? null : deserialize(r ); } -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart /// variant2Get /// /// @@ -823,7 +636,7 @@ _responseData = rawData == null ? null : deserialize(r /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> variant2Get({ Object? body, String? requestContentType, @@ -851,22 +664,6 @@ _responseData = rawData == null ? null : deserialize(r responseType: responseType, validateStatus: validateStatus, ); -======= - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart return await _dio.request( _path, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart similarity index 77% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart index aff48971f8eb..c51c966f8314 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart @@ -4,6 +4,8 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; @@ -16,14 +18,17 @@ import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/user.dart'; +part 'fake_api.g.dart'; + class FakeApi { + final FakeApiRaw rawApi; final SerializationRepositoryBase _repository; const FakeApi(this.rawApi, this._repository); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -34,39 +39,43 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + /// Throws [DioException] if API call or serialization fails + Future> fakeHealthGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.fakeHealthGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(HealthCheckResult), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + HealthCheckResult + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -85,7 +94,7 @@ class FakeApi { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -99,32 +108,43 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + /// Throws [DioException] if API call or serialization fails + Future> fakeHttpSignatureTest({ required Pet pet, - String? query1, - String? header1, + required String query1, + required String header1, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.fakeHttpSignatureTest( - query1: query1 == null - ? null - : encodeQueryParameter( - _repository, - query1, - const TypeInfo(String), - ), - header1: header1 == null - ? null - : _repository.serialize(header1, const TypeInfo(String)).toString(), + + query1: encodeQueryParameter(_repository, query1, const TypeInfo( + + + String + ) + +, ), + header1: encodeStringParameter(_repository, header1, const TypeInfo( + + + String + ) + +), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -133,7 +153,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -151,20 +171,27 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ - bool? body, + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + required bool body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + bool + ) + +); final _response = await rawApi.fakeOuterBooleanSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -173,23 +200,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(bool), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + bool + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -220,22 +248,27 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + required OuterComposite outerComposite, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = outerComposite == null - ? null - : _repository.serialize(outerComposite, const TypeInfo(OuterComposite)); + _bodyData = encodeBodyParameter(_repository, outerComposite, const TypeInfo( + + + OuterComposite + ) + +); final _response = await rawApi.fakeOuterCompositeSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -244,23 +277,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(OuterComposite), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + OuterComposite + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -291,20 +325,27 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ - num? body, + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + required num body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + num + ) + +); final _response = await rawApi.fakeOuterNumberSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -313,23 +354,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); num? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(num), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + num + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -360,20 +402,27 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterStringSerialize({ + required String body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = body; + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + String + ) + +); final _response = await rawApi.fakeOuterStringSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -382,23 +431,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + String + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -429,9 +479,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails - Future> - fakePropertyEnumIntegerSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ required OuterObjectWithEnumProperty outerObjectWithEnumProperty, CancelToken? cancelToken, Map? headers, @@ -439,12 +488,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize(outerObjectWithEnumProperty, - const TypeInfo(OuterObjectWithEnumProperty)); + _bodyData = encodeBodyParameter(_repository, outerObjectWithEnumProperty, const TypeInfo( + + + OuterObjectWithEnumProperty + ) + +); final _response = await rawApi.fakePropertyEnumIntegerSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -453,23 +508,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterObjectWithEnumProperty? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(OuterObjectWithEnumProperty), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + OuterObjectWithEnumProperty + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -500,20 +556,27 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ - MultipartFile? body, + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithBinary({ + required MultipartFile? body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = body?.finalize(); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + + + MultipartFile + ) + +); final _response = await rawApi.testBodyWithBinary( + body: _bodyData, requestContentType: 'image/png', cancelToken: cancelToken, @@ -522,7 +585,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -531,7 +594,7 @@ class FakeApi { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -540,8 +603,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithFileSchema({ required FileSchemaTestClass fileSchemaTestClass, CancelToken? cancelToken, Map? headers, @@ -549,12 +612,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize( - fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + _bodyData = encodeBodyParameter(_repository, fileSchemaTestClass, const TypeInfo( + + + FileSchemaTestClass + ) + +); final _response = await rawApi.testBodyWithFileSchema( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -563,17 +632,17 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -582,8 +651,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithQueryParams({ required String query, required User user, CancelToken? cancelToken, @@ -592,16 +661,25 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.testBodyWithQueryParams( - query: encodeQueryParameter( - _repository, - query, - const TypeInfo(String), - ), + + query: encodeQueryParameter(_repository, query, const TypeInfo( + + + String + ) + +, ), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -610,7 +688,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -628,8 +706,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + /// Throws [DioException] if API call or serialization fails + Future> testClientModel({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -637,11 +715,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.testClientModel( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -650,23 +735,24 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -684,8 +770,8 @@ class FakeApi { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -710,68 +796,134 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + /// Throws [DioException] if API call or serialization fails + Future> testEndpointParameters({ required num number, required double double_, required String patternWithoutDelimiter, required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - MultipartFile? binary, - DateTime? date, - DateTime? dateTime, - String? password, - String? callback, + required int integer, + required int int32, + required int int64, + required double float, + required String string, + required MultipartFile binary, + required DateTime date, + required DateTime dateTime, + required String password, + required String callback, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = { - if (integer != null) - r'integer': - encodeFormParameter(_repository, integer, const TypeInfo(int)), - if (int32 != null) - r'int32': encodeFormParameter(_repository, int32, const TypeInfo(int)), - if (int64 != null) - r'int64': encodeFormParameter(_repository, int64, const TypeInfo(int)), - r'number': encodeFormParameter(_repository, number, const TypeInfo(num)), - if (float != null) - r'float': - encodeFormParameter(_repository, float, const TypeInfo(double)), - r'double': - encodeFormParameter(_repository, double_, const TypeInfo(double)), - if (string != null) - r'string': - encodeFormParameter(_repository, string, const TypeInfo(String)), - r'pattern_without_delimiter': encodeFormParameter( - _repository, patternWithoutDelimiter, const TypeInfo(String)), - r'byte': encodeFormParameter(_repository, byte, const TypeInfo(String)), - if (binary != null) - r'binary': encodeFormParameter( - _repository, binary, const TypeInfo(MultipartFile)), - if (date != null) - r'date': - encodeFormParameter(_repository, date, const TypeInfo(DateTime)), - if (dateTime != null) - r'dateTime': encodeFormParameter( - _repository, dateTime, const TypeInfo(DateTime)), - if (password != null) - r'password': - encodeFormParameter(_repository, password, const TypeInfo(String)), - if (callback != null) - r'callback': - encodeFormParameter(_repository, callback, const TypeInfo(String)), + final _bodyMap = { + if (integer != null) r'integer': encodeFormParameter(_repository, integer, const TypeInfo( + + + int + ) + +), + if (int32 != null) r'int32': encodeFormParameter(_repository, int32, const TypeInfo( + + + int + ) + +), + if (int64 != null) r'int64': encodeFormParameter(_repository, int64, const TypeInfo( + + + int + ) + +), + r'number': encodeFormParameter(_repository, number, const TypeInfo( + + + num + ) + +), + if (float != null) r'float': encodeFormParameter(_repository, float, const TypeInfo( + + + double + ) + +), + r'double': encodeFormParameter(_repository, double_, const TypeInfo( + + + double + ) + +), + if (string != null) r'string': encodeFormParameter(_repository, string, const TypeInfo( + + + String + ) + +), + r'pattern_without_delimiter': encodeFormParameter(_repository, patternWithoutDelimiter, const TypeInfo( + + + String + ) + +), + r'byte': encodeFormParameter(_repository, byte, const TypeInfo( + + + String + ) + +), + if (binary != null) r'binary': encodeFormParameter(_repository, binary, const TypeInfo( + + + MultipartFile + ) + +), + if (date != null) r'date': encodeFormParameter(_repository, date, const TypeInfo( + + + DateTime + ) + +), + if (dateTime != null) r'dateTime': encodeFormParameter(_repository, dateTime, const TypeInfo( + + + DateTime + ) + +), + if (password != null) r'password': encodeFormParameter(_repository, password, const TypeInfo( + + + String + ) + +), + if (callback != null) r'callback': encodeFormParameter(_repository, callback, const TypeInfo( + + + String + ) + +), }; + _bodyData = _bodyMap; final _response = await rawApi.testEndpointParameters( + body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -780,7 +932,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -790,14 +942,14 @@ class FakeApi { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -806,94 +958,118 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ - List? enumHeaderStringArray, - String? enumHeaderString = '-efg', - List? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - List? enumQueryModelArray, - List? enumFormStringArray, - String? enumFormString, + /// Throws [DioException] if API call or serialization fails + Future> testEnumParameters({ + required List enumHeaderStringArray, + EnumHeaderStringEnum enumHeaderString = r'-efg', + required List enumQueryStringArray, + EnumQueryStringEnum enumQueryString = r'-efg', + required EnumQueryIntegerEnum enumQueryInteger, + required EnumQueryDoubleEnum enumQueryDouble, + required List enumQueryModelArray, + List enumFormStringArray = r'$', + EnumFormStringEnum enumFormString = r'-efg', CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = { - if (enumFormStringArray != null) - r'enum_form_string_array': encodeFormParameter( - _repository, - enumFormStringArray, - const TypeInfo(String, [ - const TypeInfo(String), - ])), - if (enumFormString != null) - r'enum_form_string': encodeFormParameter( - _repository, enumFormString, const TypeInfo(String)), + final _bodyMap = { + if (enumFormStringArray != null) r'enum_form_string_array': encodeFormParameter(_repository, enumFormStringArray, const TypeInfo( + List, [ + + const TypeInfo( + + InnerEnum + + ) + +, + ]) + +), + if (enumFormString != null) r'enum_form_string': encodeFormParameter(_repository, enumFormString, const TypeInfo( + + EnumFormStringEnum + + ) + +), }; + _bodyData = _bodyMap; final _response = await rawApi.testEnumParameters( - enumHeaderStringArray: enumHeaderStringArray == null - ? null - : _repository - .serialize( - enumHeaderStringArray, - const TypeInfo(List, [ - const TypeInfo(String), - ])) - .toString(), - enumHeaderString: enumHeaderString == null - ? null - : _repository - .serialize(enumHeaderString, const TypeInfo(String)) - .toString(), - enumQueryStringArray: enumQueryStringArray == null - ? null - : encodeQueryParameter( - _repository, - enumQueryStringArray, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.multi, - ), - enumQueryString: enumQueryString == null - ? null - : encodeQueryParameter( - _repository, - enumQueryString, - const TypeInfo(String), - ), - enumQueryInteger: enumQueryInteger == null - ? null - : encodeQueryParameter( - _repository, - enumQueryInteger, - const TypeInfo(int), - ), - enumQueryDouble: enumQueryDouble == null - ? null - : encodeQueryParameter( - _repository, - enumQueryDouble, - const TypeInfo(double), - ), - enumQueryModelArray: enumQueryModelArray == null - ? null - : encodeQueryParameter( - _repository, - enumQueryModelArray, - const TypeInfo(List, [ - const TypeInfo(ModelEnumClass), - ]), - format: ListFormat.multi, - ), + + enumHeaderStringArray: encodeStringParameter(_repository, enumHeaderStringArray, const TypeInfo( + List, [ + + const TypeInfo( + + EnumHeaderStringArrayEnum + + ) + +, + ]) + +), + enumHeaderString: encodeStringParameter(_repository, enumHeaderString, const TypeInfo( + + EnumHeaderStringEnum + + ) + +), + enumQueryStringArray: encodeQueryParameter(_repository, enumQueryStringArray, const TypeInfo( + List, [ + + const TypeInfo( + + EnumQueryStringArrayEnum + + ) + +, + ]) + +, format: ListFormat.multi,), + enumQueryString: encodeQueryParameter(_repository, enumQueryString, const TypeInfo( + + EnumQueryStringEnum + + ) + +, ), + enumQueryInteger: encodeQueryParameter(_repository, enumQueryInteger, const TypeInfo( + + EnumQueryIntegerEnum + + ) + +, ), + enumQueryDouble: encodeQueryParameter(_repository, enumQueryDouble, const TypeInfo( + + EnumQueryDoubleEnum + + ) + +, ), + enumQueryModelArray: encodeQueryParameter(_repository, enumQueryModelArray, const TypeInfo( + List, [ + + const TypeInfo( + + ModelEnumClass + + ) + +, + ]) + +, format: ListFormat.multi,), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -902,7 +1078,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -925,67 +1101,80 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + /// Throws [DioException] if API call or serialization fails + Future> testGroupParameters({ required int requiredStringGroup, required bool requiredBooleanGroup, required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, + required int stringGroup, + required bool booleanGroup, + required int int64Group, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.testGroupParameters( - requiredStringGroup: encodeQueryParameter( - _repository, - requiredStringGroup, - const TypeInfo(int), - ), - requiredBooleanGroup: _repository - .serialize(requiredBooleanGroup, const TypeInfo(bool)) - .toString(), - requiredInt64Group: encodeQueryParameter( - _repository, - requiredInt64Group, - const TypeInfo(int), - ), - stringGroup: stringGroup == null - ? null - : encodeQueryParameter( - _repository, - stringGroup, - const TypeInfo(int), - ), - booleanGroup: booleanGroup == null - ? null - : _repository - .serialize(booleanGroup, const TypeInfo(bool)) - .toString(), - int64Group: int64Group == null - ? null - : encodeQueryParameter( - _repository, - int64Group, - const TypeInfo(int), - ), + + requiredStringGroup: encodeQueryParameter(_repository, requiredStringGroup, const TypeInfo( + + + int + ) + +, ), + requiredBooleanGroup: encodeStringParameter(_repository, requiredBooleanGroup, const TypeInfo( + + + bool + ) + +), + requiredInt64Group: encodeQueryParameter(_repository, requiredInt64Group, const TypeInfo( + + + int + ) + +, ), + stringGroup: encodeQueryParameter(_repository, stringGroup, const TypeInfo( + + + int + ) + +, ), + booleanGroup: encodeStringParameter(_repository, booleanGroup, const TypeInfo( + + + bool + ) + +), + int64Group: encodeQueryParameter(_repository, int64Group, const TypeInfo( + + + int + ) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -997,8 +1186,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + /// Throws [DioException] if API call or serialization fails + Future> testInlineAdditionalProperties({ required Map requestBody, CancelToken? cancelToken, Map? headers, @@ -1006,16 +1195,24 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = _repository.serialize( - requestBody, - const TypeInfo(String, [ - TypeInfo(String), - const TypeInfo(String), - ])); + _bodyData = encodeBodyParameter(_repository, requestBody, const TypeInfo( + Map, [ + TypeInfo(String), + const TypeInfo( + + String + + ) + +, + ]) + +); final _response = await rawApi.testInlineAdditionalProperties( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -1024,13 +1221,13 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -1043,8 +1240,8 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + /// Throws [DioException] if API call or serialization fails + Future> testJsonFormData({ required String param, required String param2, CancelToken? cancelToken, @@ -1053,15 +1250,28 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = { - r'param': encodeFormParameter(_repository, param, const TypeInfo(String)), - r'param2': - encodeFormParameter(_repository, param2, const TypeInfo(String)), + final _bodyMap = { + r'param': encodeFormParameter(_repository, param, const TypeInfo( + + + String + ) + +), + r'param2': encodeFormParameter(_repository, param2, const TypeInfo( + + + String + ) + +), }; + _bodyData = _bodyMap; final _response = await rawApi.testJsonFormData( + body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -1070,7 +1280,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -1079,13 +1289,13 @@ class FakeApi { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1094,97 +1304,131 @@ class FakeApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + /// Throws [DioException] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ required List pipe, required List ioutil, required List http, required List url, required List context, required String allowEmpty, - Map? language, + required Map language, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.testQueryParameterCollectionFormat( - pipe: encodeQueryParameter( - _repository, - pipe, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.pipes, - ), - ioutil: encodeQueryParameter( - _repository, - ioutil, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), - http: encodeQueryParameter( - _repository, - http, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.ssv, - ), - url: encodeQueryParameter( - _repository, - url, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), - context: encodeQueryParameter( - _repository, - context, - const TypeInfo(List, [ - const TypeInfo(String), - ]), - format: ListFormat.multi, - ), - allowEmpty: encodeQueryParameter( - _repository, - allowEmpty, - const TypeInfo(String), - ), - language: language == null - ? null - : encodeQueryParameter( - _repository, - language, - const TypeInfo(Map, [ - TypeInfo(String), - const TypeInfo(String), - ]), - ), + + pipe: encodeQueryParameter(_repository, pipe, const TypeInfo( + List, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.pipes,), + ioutil: encodeQueryParameter(_repository, ioutil, const TypeInfo( + List, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + http: encodeQueryParameter(_repository, http, const TypeInfo( + List, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.ssv,), + url: encodeQueryParameter(_repository, url, const TypeInfo( + List, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + context: encodeQueryParameter(_repository, context, const TypeInfo( + List, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.multi,), + allowEmpty: encodeQueryParameter(_repository, allowEmpty, const TypeInfo( + + + String + ) + +, ), + language: encodeQueryParameter(_repository, language, const TypeInfo( + Map, [ + TypeInfo(String), + const TypeInfo( + + String + + ) + +, + ]) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } -} +} class FakeApiRaw { + final Dio _dio; const FakeApiRaw(this._dio); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1195,8 +1439,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ + /// Throws [DioException] if API call or serialization fails + Future> fakeHealthGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -1235,7 +1479,7 @@ class FakeApiRaw { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -1249,8 +1493,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ + /// Throws [DioException] if API call or serialization fails + Future> fakeHttpSignatureTest({ Object? query1, String? header1, Object? body, @@ -1315,8 +1559,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1367,8 +1611,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1419,8 +1663,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterNumberSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1471,8 +1715,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterStringSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1523,8 +1767,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + /// Throws [DioException] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1575,8 +1819,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithBinary({ Object? body, String? requestContentType, String? acceptContentType, @@ -1618,7 +1862,7 @@ class FakeApiRaw { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1627,8 +1871,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithFileSchema({ Object? body, String? requestContentType, String? acceptContentType, @@ -1667,11 +1911,11 @@ class FakeApiRaw { } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1680,8 +1924,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithQueryParams({ required Object query, Object? body, String? requestContentType, @@ -1738,8 +1982,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ + /// Throws [DioException] if API call or serialization fails + Future> testClientModel({ Object? body, String? requestContentType, String? acceptContentType, @@ -1777,8 +2021,8 @@ class FakeApiRaw { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -1803,8 +2047,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ + /// Throws [DioException] if API call or serialization fails + Future> testEndpointParameters({ Object? body, String? requestContentType, String? acceptContentType, @@ -1853,14 +2097,14 @@ class FakeApiRaw { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1869,8 +2113,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ + /// Throws [DioException] if API call or serialization fails + Future> testEnumParameters({ String? enumHeaderStringArray, String? enumHeaderString, Object? enumQueryStringArray, @@ -1893,8 +2137,7 @@ class FakeApiRaw { final _options = Options( method: r'GET', headers: { - if (enumHeaderStringArray != null) - r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, @@ -1909,13 +2152,11 @@ class FakeApiRaw { ); final _queryParameters = { - if (enumQueryStringArray != null) - r'enum_query_string_array': enumQueryStringArray, + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, if (enumQueryString != null) r'enum_query_string': enumQueryString, if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) - r'enum_query_model_array': enumQueryModelArray, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, }; return await _dio.request( @@ -1947,8 +2188,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ + /// Throws [DioException] if API call or serialization fails + Future> testGroupParameters({ required Object requiredStringGroup, required String requiredBooleanGroup, required Object requiredInt64Group, @@ -2009,7 +2250,7 @@ class FakeApiRaw { } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -2021,8 +2262,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ + /// Throws [DioException] if API call or serialization fails + Future> testInlineAdditionalProperties({ Object? body, String? requestContentType, String? acceptContentType, @@ -2061,7 +2302,7 @@ class FakeApiRaw { } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -2074,8 +2315,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ + /// Throws [DioException] if API call or serialization fails + Future> testJsonFormData({ Object? body, String? requestContentType, String? acceptContentType, @@ -2117,13 +2358,13 @@ class FakeApiRaw { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -2132,8 +2373,8 @@ class FakeApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + /// Throws [DioException] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ required Object pipe, required Object ioutil, required Object http, @@ -2188,4 +2429,143 @@ class FakeApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +enum EnumHeaderStringArrayEnum { + @JsonValue(r'>') + greaterThan, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +/// Header parameter enum test (string) +enum EnumHeaderStringEnum { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumQueryStringArrayEnum { + @JsonValue(r'>') + greaterThan, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +/// Query parameter enum test (string) +enum EnumQueryStringEnum { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + +/// Query parameter enum test (double) +enum EnumQueryIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-2) + numberNegative2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + + +/// Query parameter enum test (double) +enum EnumQueryDoubleEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} + + + + +enum InnerEnum { + // +} + + + +/// Form parameter enum test (string) +enum EnumFormStringEnum { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + + + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart similarity index 71% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart index c5830b2db7a5..d4da7006767e 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -4,11 +4,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; +part 'fake_classname_tags123_api.g.dart'; + class FakeClassnameTags123Api { final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,13 +32,8 @@ class FakeClassnameTags123Api { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart - /// Throws [DioError] if API call or serialization fails - Future> testClassname({ -======= /// Throws [DioException] if API call or serialization fails - Future> testClassname({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -43,49 +42,9 @@ class FakeClassnameTags123Api { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/api/fake_classname_tags123_api.dart Object? _bodyData; - _bodyData = _repository.serialize(modelClient, const TypeInfo(ModelClient)); -======= - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart + _bodyData = encodeBodyParameter( + _repository, modelClient, const TypeInfo(ModelClient)); final _response = await rawApi.testClassname( body: _bodyData, @@ -104,10 +63,8 @@ class FakeClassnameTags123Api { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ModelClient), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ModelClient)); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -149,7 +106,7 @@ class FakeClassnameTags123ApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> testClassname({ Object? body, String? requestContentType, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart similarity index 56% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart index c5a015a28adb..1285caef6bab 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart @@ -4,27 +4,19 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/foo.dart'; import 'package:openapi/src/model/foo_ref_or_value.dart'; -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart +part 'foo_api.g.dart'; + class FooApi { final FooApiRaw rawApi; final SerializationRepositoryBase _repository; -======= -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/order.dart'; - -class StoreApi { - - final Dio _dio; - - final Serializers _serializers; ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart const FooApi(this.rawApi, this._repository); @@ -40,17 +32,10 @@ class StoreApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioError] if API call or serialization fails - Future> createFoo({ - Foo? foo, -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ - required String orderId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart + Future> createFoo({ + required Foo foo, CancelToken? cancelToken, Map? headers, Map? extra, @@ -58,24 +43,8 @@ class StoreApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart Object? _bodyData; - _bodyData = - foo == null ? null : _repository.serialize(foo, const TypeInfo(Foo)); -======= - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(String)).toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart + _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo(Foo)); final _response = await rawApi.createFoo( body: _bodyData, @@ -94,15 +63,13 @@ class StoreApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(FooRefOrValue), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(FooRefOrValue)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -131,15 +98,9 @@ class StoreApi { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioError] if API call or serialization fails - Future>> getAllFoos({ -======= - /// Returns a [Future] containing a [Response] with a [BuiltMap] as data /// Throws [DioException] if API call or serialization fails - Future>> getInventory({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart + Future>> getAllFoos({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -162,12 +123,12 @@ class StoreApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(List, [ const TypeInfo(FooRefOrValue), - ]), - ); + ])); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -208,20 +169,13 @@ class FooApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createFoo({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ - required int orderId, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -229,11 +183,7 @@ class FooApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart final _path = r'/foo'; -======= - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(int)).toString()); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart final _options = Options( method: r'POST', headers: { @@ -257,39 +207,6 @@ class FooApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart -======= - - Order? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Order), - ) as Order; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart } /// GET all Foos @@ -303,20 +220,13 @@ class FooApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getAllFoos({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ - required Order order, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -340,29 +250,7 @@ class FooApiRaw { validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { - const _type = FullType(Order); - _bodyData = _serializers.serialize(order, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart _path, data: body, options: _options, @@ -370,38 +258,5 @@ class FooApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart -======= - - Order? _responseData; - - try { - final rawResponse = _response.data; - _responseData = rawResponse == null ? null : _serializers.deserialize( - rawResponse, - specifiedType: const FullType(Order), - ) as Order; - - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart } } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart index 8056aff4ef4d..b7c8a07bde33 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart @@ -4,12 +4,16 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/api_response.dart'; import 'package:openapi/src/model/pet.dart'; +part 'pet_api.g.dart'; + class PetApi { final PetApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -29,7 +33,7 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> addPet({ required Pet pet, CancelToken? cancelToken, @@ -40,7 +44,7 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); final _response = await rawApi.addPet( body: _bodyData, @@ -70,10 +74,10 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deletePet({ required int petId, - String? apiKey, + required String apiKey, CancelToken? cancelToken, Map? headers, Map? extra, @@ -82,10 +86,9 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { final _response = await rawApi.deletePet( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), - apiKey: apiKey == null - ? null - : _repository.serialize(apiKey, const TypeInfo(String)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + apiKey: + encodeStringParameter(_repository, apiKey, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -110,9 +113,9 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required List status, + @Deprecated('status is deprecated') required List status, CancelToken? cancelToken, Map? headers, Map? extra, @@ -125,7 +128,7 @@ class PetApi { _repository, status, const TypeInfo(List, [ - const TypeInfo(String), + const TypeInfo(StatusEnum), ]), format: ListFormat.csv, ), @@ -143,17 +146,17 @@ class PetApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(List, [ const TypeInfo(Pet), - ]), - ); + ])); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -184,7 +187,7 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Set] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') Future>> findPetsByTags({ required Set tags, @@ -218,17 +221,17 @@ class PetApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(Set, [ const TypeInfo(Pet), - ]), - ); + ])); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -259,7 +262,7 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getPetById({ required int petId, CancelToken? cancelToken, @@ -270,7 +273,7 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { final _response = await rawApi.getPetById( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -285,15 +288,12 @@ class PetApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Pet), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Pet)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -324,7 +324,7 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePet({ required Pet pet, CancelToken? cancelToken, @@ -335,7 +335,7 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); final _response = await rawApi.updatePet( body: _bodyData, @@ -366,11 +366,11 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePetWithForm({ required int petId, - String? name, - String? status, + required String name, + required String status, CancelToken? cancelToken, Map? headers, Map? extra, @@ -379,16 +379,17 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = { + final _bodyMap = { if (name != null) r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), if (status != null) r'status': encodeFormParameter(_repository, status, const TypeInfo(String)), }; + _bodyData = _bodyMap; final _response = await rawApi.updatePetWithForm( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -417,11 +418,11 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFile({ required int petId, - String? additionalMetadata, - MultipartFile? file, + required String additionalMetadata, + required MultipartFile file, CancelToken? cancelToken, Map? headers, Map? extra, @@ -430,15 +431,18 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = FormData.fromMap({ + final _bodyMap = { if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter( _repository, additionalMetadata, const TypeInfo(String)), - if (file != null) r'file': file, - }); + if (file != null) + r'file': encodeFormParameter( + _repository, file, const TypeInfo(MultipartFile)), + }; + _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFile( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -455,15 +459,13 @@ class PetApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ApiResponse)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -496,11 +498,11 @@ class PetApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, - String? additionalMetadata, + required String additionalMetadata, CancelToken? cancelToken, Map? headers, Map? extra, @@ -509,15 +511,17 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = FormData.fromMap({ + final _bodyMap = { if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter( _repository, additionalMetadata, const TypeInfo(String)), - r'requiredFile': requiredFile, - }); + r'requiredFile': encodeFormParameter( + _repository, requiredFile, const TypeInfo(MultipartFile)), + }; + _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFileWithRequiredFile( - petId: _repository.serialize(petId, const TypeInfo(int)).toString(), + petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -534,15 +538,13 @@ class PetApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(ApiResponse), - ); + : decodeResponse( + _repository, rawResponse, const TypeInfo(ApiResponse)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -579,7 +581,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> addPet({ Object? body, String? requestContentType, @@ -637,7 +639,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deletePet({ required String petId, String? apiKey, @@ -698,7 +700,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, @@ -761,7 +763,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Set] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') Future> findPetsByTags({ required Object tags, @@ -825,7 +827,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getPetById({ required String petId, Object? body, @@ -886,7 +888,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePet({ Object? body, String? requestContentType, @@ -945,7 +947,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updatePetWithForm({ required String petId, Object? body, @@ -1006,7 +1008,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFile({ required String petId, Object? body, @@ -1067,7 +1069,7 @@ class PetApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> uploadFileWithRequiredFile({ required String petId, Object? body, @@ -1113,3 +1115,15 @@ class PetApiRaw { ); } } + +@Deprecated('StatusEnum has been deprecated') +enum StatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart similarity index 65% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart index 5de756c1b862..32acb15b4111 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart @@ -4,11 +4,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/order.dart'; +part 'store_api.g.dart'; + class StoreApi { final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,15 +32,9 @@ class StoreApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteOrder({ required String orderId, -======= - /// Throws [DioException] if API call or serialization fails - Future> createUser({ - required User user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -44,46 +42,9 @@ class StoreApi { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart final _response = await rawApi.deleteOrder( orderId: - _repository.serialize(orderId, const TypeInfo(String)).toString(), -======= - final _path = r'/user'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart + encodeStringParameter(_repository, orderId, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -106,16 +67,9 @@ _bodyData=jsonEncode(user); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Map] as data - /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ -======= - /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ - required List user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -135,32 +89,21 @@ _bodyData=jsonEncode(user); Map? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( + : decodeResponse( + _repository, rawResponse, const TypeInfo(Map, [ TypeInfo(String), const TypeInfo(int), - ]), - ); + ])); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart error: error, stackTrace: stackTrace, ); @@ -190,17 +133,10 @@ _bodyData=jsonEncode(user); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getOrderById({ required int orderId, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ - required List user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -209,7 +145,7 @@ _bodyData=jsonEncode(user); ProgressCallback? onReceiveProgress, }) async { final _response = await rawApi.getOrderById( - orderId: _repository.serialize(orderId, const TypeInfo(int)).toString(), + orderId: encodeStringParameter(_repository, orderId, const TypeInfo(int)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -221,29 +157,15 @@ _bodyData=jsonEncode(user); Order? _responseData; try { -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, -======= -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), type: DioExceptionType.unknown, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart error: error, stackTrace: stackTrace, ); @@ -273,17 +195,10 @@ _bodyData=jsonEncode(user); /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> placeOrder({ required Order order, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ - required String username, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -292,7 +207,7 @@ _bodyData=jsonEncode(user); ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(order, const TypeInfo(Order)); + _bodyData = encodeBodyParameter(_repository, order, const TypeInfo(Order)); final _response = await rawApi.placeOrder( body: _bodyData, @@ -311,15 +226,12 @@ _bodyData=jsonEncode(user); final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(Order), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -355,21 +267,14 @@ class StoreApiRaw { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ - required String username, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -402,35 +307,6 @@ class StoreApiRaw { onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart -======= - - User? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'User', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart } /// Returns pet inventories by status @@ -444,21 +320,13 @@ _responseData = rawData == null ? null : deserialize(rawData, 'User' /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Map] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioException] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -497,35 +365,6 @@ _responseData = rawData == null ? null : deserialize(rawData, 'User' onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart -======= - - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart } /// Find purchase order by ID @@ -540,20 +379,14 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getOrderById({ required String orderId, Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -600,21 +433,13 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, ResponseType? responseType, -======= - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updateUser({ - required String username, - required User user, ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart CancelToken? cancelToken, Map? headers, Map? extra, @@ -638,27 +463,7 @@ _responseData = rawData == null ? null : deserialize(rawData, 'S validateStatus: validateStatus, ); -<<<<<<< HEAD:samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart return await _dio.request( -======= - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( ->>>>>>> 95cefaeecdae21a43a453f07ed510c420abaa461:samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart _path, data: body, options: _options, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart index 2d145d17f8b5..87293567d705 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart @@ -4,11 +4,15 @@ import 'dart:async'; import 'package:dio/dio.dart'; + +import 'package:json_annotation/json_annotation.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/user.dart'; +part 'user_api.g.dart'; + class UserApi { final UserApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -28,7 +32,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUser({ required User user, CancelToken? cancelToken, @@ -39,7 +43,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); final _response = await rawApi.createUser( body: _bodyData, @@ -68,7 +72,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithArrayInput({ required List user, CancelToken? cancelToken, @@ -79,9 +83,10 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( + _bodyData = encodeBodyParameter( + _repository, user, - const TypeInfo(User, [ + const TypeInfo(List, [ const TypeInfo(User), ])); @@ -112,7 +117,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithListInput({ required List user, CancelToken? cancelToken, @@ -123,9 +128,10 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize( + _bodyData = encodeBodyParameter( + _repository, user, - const TypeInfo(User, [ + const TypeInfo(List, [ const TypeInfo(User), ])); @@ -156,7 +162,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteUser({ required String username, CancelToken? cancelToken, @@ -168,7 +174,7 @@ class UserApi { }) async { final _response = await rawApi.deleteUser( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -193,7 +199,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getUserByName({ required String username, CancelToken? cancelToken, @@ -205,7 +211,7 @@ class UserApi { }) async { final _response = await rawApi.getUserByName( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), cancelToken: cancelToken, headers: headers, extra: extra, @@ -220,15 +226,12 @@ class UserApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(User), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(User)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -260,7 +263,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> loginUser({ required String username, required String password, @@ -296,15 +299,12 @@ class UserApi { final rawResponse = _response.data; _responseData = rawResponse == null ? null - : _repository.deserialize( - rawResponse, - const TypeInfo(String), - ); + : decodeResponse(_repository, rawResponse, const TypeInfo(String)); } catch (error, stackTrace) { - throw DioError( + throw DioException( requestOptions: _response.requestOptions, response: _response, - type: DioErrorType.unknown, + type: DioExceptionType.unknown, error: error, stackTrace: stackTrace, ); @@ -334,7 +334,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> logoutUser({ CancelToken? cancelToken, Map? headers, @@ -369,7 +369,7 @@ class UserApi { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updateUser({ required String username, required User user, @@ -381,11 +381,11 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = _repository.serialize(user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); final _response = await rawApi.updateUser( username: - _repository.serialize(username, const TypeInfo(String)).toString(), + encodeStringParameter(_repository, username, const TypeInfo(String)), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -418,7 +418,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUser({ Object? body, String? requestContentType, @@ -470,7 +470,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithArrayInput({ Object? body, String? requestContentType, @@ -522,7 +522,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> createUsersWithListInput({ Object? body, String? requestContentType, @@ -574,7 +574,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> deleteUser({ required String username, Object? body, @@ -628,7 +628,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> getUserByName({ required String username, Object? body, @@ -683,7 +683,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> loginUser({ required Object username, required Object password, @@ -742,7 +742,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> logoutUser({ Object? body, String? requestContentType, @@ -795,7 +795,7 @@ class UserApiRaw { /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails + /// Throws [DioException] if API call or serialization fails Future> updateUser({ required String username, Object? body, diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_client.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_client.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart similarity index 70% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart index 056ba3bcd8ec..6ba61211c680 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api_util.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart @@ -21,6 +21,29 @@ Object encodeFormParameter( return serialized; } +String encodeStringParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + return repository.serialize(value, type).toString(); +} + +Object encodeBodyParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + Object encodeQueryParameter( SerializationRepositoryBase repository, T value, @@ -59,3 +82,8 @@ ListParam encodeCollectionQueryParameter( } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } + +TOutput decodeResponse( + SerializationRepositoryBase repository, TInput value, TypeInfo type) { + return repository.deserialize(value, type); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/_exports.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/_exports.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/_exports.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart index 464ac70be575..d39354703349 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart @@ -17,14 +17,14 @@ class Animal { /// Returns a new [Animal] instance. Animal({ required this.className, - this.color = 'red', + this.color = r'red', }); @JsonKey(name: r'className', required: true, includeIfNull: false) final String className; @JsonKey( - defaultValue: 'red', + defaultValue: r'red', name: r'color', required: false, includeIfNull: false) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart similarity index 96% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart index 8e0612fb641a..ae7b2ede17d1 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart @@ -20,7 +20,7 @@ class Cat { /// Returns a new [Cat] instance. Cat({ required this.className, - this.color = 'red', + this.color = r'red', this.declawed, }); @@ -28,7 +28,7 @@ class Cat { final String className; @JsonKey( - defaultValue: 'red', + defaultValue: r'red', name: r'color', required: false, includeIfNull: false) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart index 9d95e6d6ef77..2e4b66ada568 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart @@ -17,14 +17,14 @@ class Category { /// Returns a new [Category] instance. Category({ this.id, - this.name = 'default-name', + this.name = r'default-name', }); @JsonKey(name: r'id', required: false, includeIfNull: false) final int? id; @JsonKey( - defaultValue: 'default-name', + defaultValue: r'default-name', name: r'name', required: true, includeIfNull: false) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart index 394340b11eb9..074bd2f07075 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart @@ -20,7 +20,7 @@ class Dog { /// Returns a new [Dog] instance. Dog({ required this.className, - this.color = 'red', + this.color = r'red', this.breed, }); @@ -28,7 +28,7 @@ class Dog { final String className; @JsonKey( - defaultValue: 'red', + defaultValue: r'red', name: r'color', required: false, includeIfNull: false) diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart index 8f82703b5dc5..17b80eed8f24 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart @@ -3,8 +3,7 @@ // // ignore_for_file: unused_element -import 'package:openapi/src/model/apple_any_of_disc.dart'; -import 'package:openapi/src/model/banana_any_of_disc.dart'; +import 'package:openapi/src/model/fruit_type.dart'; import 'package:json_annotation/json_annotation.dart'; part 'fruit_any_of_disc.g.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart index c9630c637573..e9148e54da0d 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/built_value/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart @@ -1,17 +1,18 @@ /// The general rule for implementing this class is /// json == serialize(deserialize(json)) /// object == deserialize(serialize(object)) -/// It doesn't have to be json, +/// Where json in this context means a dart primitive +/// JSON = String | num | bool | null | Uint8List | List | Map abstract class SerializationRepositoryBase { const SerializationRepositoryBase(); - Object serialize( + FutureOr serialize( T src, TypeInfo inputTypeInfo, { Object? context, }); - T deserialize( - Object value, + FutureOr deserialize( + Object? value, TypeInfo targetTypeInfo, { Object? context, }); diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart new file mode 100644 index 000000000000..9cd7bec2c338 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart @@ -0,0 +1,350 @@ +import 'dart:convert'; +import 'dart:typed_data'; +import 'repository_base.dart'; +import 'package:openapi/models.dart'; + +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + + /// Transforms an object of arbitrary type [T] (whose information is passed in inputTypeInfo) to a dart primitive + @override + FutureOr serialize(T src, TypeInfo inputTypeInfo, + {Object? context}) { + if (src == null) { + return null; + } + if (src is String) { + return src; + } + if (src is bool) { + return src; + } + if (src is DateTime) { + return src.toIso8601String(); + } + if (src is num) { + return src; + } + if (src is Uint8List) { + return src; + } + if (src is Iterable) { + return src + .map((value) => + serialize(value, inputTypeInfo.parameters[0], context: context)) + .toList(); + } + if (src is Map) { + return src.map((key, value) => MapEntry( + //Json Map keys must always be strings + serialize(key, inputTypeInfo.parameters[0], context: context) + .toString(), + serialize(value, inputTypeInfo.parameters[1], context: context))); + } + + if (context is Object? Function(Object?)) { + return context(src); + } + + try { + return (src as dynamic).toJson(); + } on NoSuchMethodError { + assert(false, ''' + Failed to serialize the object properly, falling back to `toString()` + '''); + return src.toString(); + } + } + + /// Transforms a dart primitive to an object of arbitrary type [T] (whose information is passed in inputTypeInfo) + @override + T deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { + //Don't rely on T being accurate here, since it won't get passed for generic arguments. + if (value == null) { + return null as T; + } + final targetRootType = targetTypeInfo.root; + if (targetRootType == T) { + //short circuit if we already have the output as the input + return value as T; + } + switch (targetRootType) { + case String: + return value.toString() as T; + case double: + return (value is num + ? value.toDouble() + : double.tryParse(value.toString())) as T; + case int: + return (value is num ? value.toInt() : int.tryParse(value.toString())) + as T; + case num: + return (value is num ? value : num.tryParse(value.toString())) as T; + case bool: + return (value is bool ? value : bool.tryParse(value.toString())) as T; + case DateTime: + return (value is DateTime ? value : DateTime.tryParse(value.toString())) + as T; + case Iterable: + case List: + case Set: + if (value is! Iterable) { + throw Exception('Cannot deserialize'); + } + final mappedItems = value.map((v) => + deserialize(v, targetTypeInfo.parameters[0], context: context)); + if (targetRootType == List) { + return List.from(mappedItems); + } else if (targetRootType == Set) { + return Set.from(mappedItems); + } else if (targetRootType == Iterable) { + return mappedItems; + } else { + throw Exception('Cannot deserialize'); + } + case Map: + if (value is! Map) { + throw Exception('Cannot deserialize'); + } + return value.map((k, v) => MapEntry( + deserialize(k, targetTypeInfo.parameters[0], context: context), + deserialize(v, targetTypeInfo.parameters[1], context: context))); + case AdditionalPropertiesClass: + return AdditionalPropertiesClass.fromJson(value as Map) + as T; + case Addressable: + return Addressable.fromJson(value as Map) as T; + case AllOfWithSingleRef: + return AllOfWithSingleRef.fromJson(value as Map) as T; + case Animal: + return Animal.fromJson(value as Map) as T; + case ApiResponse: + return ApiResponse.fromJson(value as Map) as T; + case Apple: + return Apple.fromJson(value as Map) as T; + case AppleAllOfDisc: + return AppleAllOfDisc.fromJson(value as Map) as T; + case AppleGrandparentDisc: + return AppleGrandparentDisc.fromJson(value as Map) + as T; + case AppleOneOfDisc: + return AppleOneOfDisc.fromJson(value as Map) as T; + case AppleReqDisc: + return AppleReqDisc.fromJson(value as Map) as T; + case AppleVariant1: + return AppleVariant1.fromJson(value as Map) as T; + case ArrayOfArrayOfNumberOnly: + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) + as T; + case ArrayOfNumberOnly: + return ArrayOfNumberOnly.fromJson(value as Map) as T; + case ArrayTest: + return ArrayTest.fromJson(value as Map) as T; + case Banana: + return Banana.fromJson(value as Map) as T; + case BananaAllOfDisc: + return BananaAllOfDisc.fromJson(value as Map) as T; + case BananaGrandparentDisc: + return BananaGrandparentDisc.fromJson(value as Map) + as T; + case BananaOneOfDisc: + return BananaOneOfDisc.fromJson(value as Map) as T; + case BananaReqDisc: + return BananaReqDisc.fromJson(value as Map) as T; + case Bar: + return Bar.fromJson(value as Map) as T; + case BarCreate: + return BarCreate.fromJson(value as Map) as T; + case BarRef: + return BarRef.fromJson(value as Map) as T; + case BarRefOrValue: + return BarRefOrValue.fromJson(value as Map) as T; + case Capitalization: + return Capitalization.fromJson(value as Map) as T; + case Cat: + return Cat.fromJson(value as Map) as T; + case Category: + return Category.fromJson(value as Map) as T; + case ClassModel: + return ClassModel.fromJson(value as Map) as T; + case ComposedDiscMissingFromProperties: + return ComposedDiscMissingFromProperties.fromJson( + value as Map) as T; + case ComposedDiscOptionalTypeCorrect: + return ComposedDiscOptionalTypeCorrect.fromJson( + value as Map) as T; + case ComposedDiscOptionalTypeInconsistent: + return ComposedDiscOptionalTypeInconsistent.fromJson( + value as Map) as T; + case ComposedDiscOptionalTypeIncorrect: + return ComposedDiscOptionalTypeIncorrect.fromJson( + value as Map) as T; + case ComposedDiscRequiredInconsistent: + return ComposedDiscRequiredInconsistent.fromJson( + value as Map) as T; + case ComposedDiscTypeInconsistent: + return ComposedDiscTypeInconsistent.fromJson( + value as Map) as T; + case ComposedDiscTypeIncorrect: + return ComposedDiscTypeIncorrect.fromJson(value as Map) + as T; + case DeprecatedObject: + return DeprecatedObject.fromJson(value as Map) as T; + case DiscMissingFromProperties: + return DiscMissingFromProperties.fromJson(value as Map) + as T; + case DiscOptionalTypeCorrect: + return DiscOptionalTypeCorrect.fromJson(value as Map) + as T; + case DiscOptionalTypeIncorrect: + return DiscOptionalTypeIncorrect.fromJson(value as Map) + as T; + case DiscTypeIncorrect: + return DiscTypeIncorrect.fromJson(value as Map) as T; + case Dog: + return Dog.fromJson(value as Map) as T; + case Entity: + return Entity.fromJson(value as Map) as T; + case EntityRef: + return EntityRef.fromJson(value as Map) as T; + case EnumArrays: + return EnumArrays.fromJson(value as Map) as T; + case EnumTest: + return EnumTest.fromJson(value as Map) as T; + case Extensible: + return Extensible.fromJson(value as Map) as T; + case FileSchemaTestClass: + return FileSchemaTestClass.fromJson(value as Map) as T; + case Foo: + return Foo.fromJson(value as Map) as T; + case FooBasicGetDefaultResponse: + return FooBasicGetDefaultResponse.fromJson( + value as Map) as T; + case FooRef: + return FooRef.fromJson(value as Map) as T; + case FooRefOrValue: + return FooRefOrValue.fromJson(value as Map) as T; + case FormatTest: + return FormatTest.fromJson(value as Map) as T; + case Fruit: + return Fruit.fromJson(value as Map) as T; + case FruitAllOfDisc: + return FruitAllOfDisc.fromJson(value as Map) as T; + case FruitAnyOfDisc: + return FruitAnyOfDisc.fromJson(value as Map) as T; + case FruitGrandparentDisc: + return FruitGrandparentDisc.fromJson(value as Map) + as T; + case FruitInlineDisc: + return FruitInlineDisc.fromJson(value as Map) as T; + case FruitInlineDiscOneOf: + return FruitInlineDiscOneOf.fromJson(value as Map) + as T; + case FruitInlineDiscOneOf1: + return FruitInlineDiscOneOf1.fromJson(value as Map) + as T; + case FruitInlineInlineDisc: + return FruitInlineInlineDisc.fromJson(value as Map) + as T; + case FruitInlineInlineDiscOneOf: + return FruitInlineInlineDiscOneOf.fromJson( + value as Map) as T; + case FruitInlineInlineDiscOneOf1: + return FruitInlineInlineDiscOneOf1.fromJson( + value as Map) as T; + case FruitInlineInlineDiscOneOfOneOf: + return FruitInlineInlineDiscOneOfOneOf.fromJson( + value as Map) as T; + case FruitOneOfDisc: + return FruitOneOfDisc.fromJson(value as Map) as T; + case FruitReqDisc: + return FruitReqDisc.fromJson(value as Map) as T; + case FruitType: + return FruitType.fromJson(value as Map) as T; + case FruitVariant1: + return FruitVariant1.fromJson(value as Map) as T; + case GigaOneOf: + return GigaOneOf.fromJson(value as Map) as T; + case GrapeVariant1: + return GrapeVariant1.fromJson(value as Map) as T; + case HasOnlyReadOnly: + return HasOnlyReadOnly.fromJson(value as Map) as T; + case HealthCheckResult: + return HealthCheckResult.fromJson(value as Map) as T; + case MapTest: + return MapTest.fromJson(value as Map) as T; + case MixedPropertiesAndAdditionalPropertiesClass: + return MixedPropertiesAndAdditionalPropertiesClass.fromJson( + value as Map) as T; + case Model200Response: + return Model200Response.fromJson(value as Map) as T; + case ModelClient: + return ModelClient.fromJson(value as Map) as T; + case ModelEnumClass: + //TODO: find a way to support enums + return value as T; + case ModelFile: + return ModelFile.fromJson(value as Map) as T; + case ModelList: + return ModelList.fromJson(value as Map) as T; + case ModelReturn: + return ModelReturn.fromJson(value as Map) as T; + case Name: + return Name.fromJson(value as Map) as T; + case NullableClass: + return NullableClass.fromJson(value as Map) as T; + case NumberOnly: + return NumberOnly.fromJson(value as Map) as T; + case ObjectWithDeprecatedFields: + return ObjectWithDeprecatedFields.fromJson( + value as Map) as T; + case OneOfPrimitiveChild: + return OneOfPrimitiveChild.fromJson(value as Map) as T; + case Order: + return Order.fromJson(value as Map) as T; + case OuterComposite: + return OuterComposite.fromJson(value as Map) as T; + case OuterEnum: + //TODO: find a way to support enums + return value as T; + case OuterEnumDefaultValue: + //TODO: find a way to support enums + return value as T; + case OuterEnumInteger: + //TODO: find a way to support enums + return value as T; + case OuterEnumIntegerDefaultValue: + //TODO: find a way to support enums + return value as T; + case OuterObjectWithEnumProperty: + return OuterObjectWithEnumProperty.fromJson( + value as Map) as T; + case Parent: + return Parent.fromJson(value as Map) as T; + case Pasta: + return Pasta.fromJson(value as Map) as T; + case Pet: + return Pet.fromJson(value as Map) as T; + case Pizza: + return Pizza.fromJson(value as Map) as T; + case PizzaSpeziale: + return PizzaSpeziale.fromJson(value as Map) as T; + case ReadOnlyFirst: + return ReadOnlyFirst.fromJson(value as Map) as T; + case SingleRefType: + //TODO: find a way to support enums + return value as T; + case SpecialModelName: + return SpecialModelName.fromJson(value as Map) as T; + case Tag: + return Tag.fromJson(value as Map) as T; + case User: + return User.fromJson(value as Map) as T; + default: + if (value is T) { + return value; + } + throw Exception('Cannot deserialize'); + } + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pom.xml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pom.xml rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pubspec.yaml similarity index 93% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/pubspec.yaml index bd1dcc906093..8acec8ec10bb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=2.15.0 <3.0.0' dependencies: - dio: '^5.2.1' + dio: '^5.2.0' json_annotation: ^4.8.1 dev_dependencies: diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/addressable_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/addressable_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/animal_test.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/animal_test.dart index 0a6686e9a1d3..e18d62d5f646 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/animal_test.dart @@ -10,7 +10,7 @@ void main() { // String className test('to test the property `className`', () async {}); - // String color (default value: 'red') + // String color (default value: r'red') test('to test the property `color`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_create_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_create_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/cat_test.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/cat_test.dart index 2ed74c7b389e..260a564cb60a 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/cat_test.dart @@ -10,7 +10,7 @@ void main() { // String className test('to test the property `className`', () async {}); - // String color (default value: 'red') + // String color (default value: r'red') test('to test the property `color`', () async {}); // bool declawed diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/category_test.dart similarity index 87% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/category_test.dart index 86a2b1f4bbb7..1435106525e8 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/category_test.dart @@ -10,7 +10,7 @@ void main() { // int id test('to test the property `id`', () async {}); - // String name (default value: 'default-name') + // String name (default value: r'default-name') test('to test the property `name`', () async {}); }); } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/default_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/default_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/dog_test.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/dog_test.dart index f2a34b1432ab..2ec7895143d6 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/dog_test.dart @@ -10,7 +10,7 @@ void main() { // String className test('to test the property `className`', () async {}); - // String color (default value: 'red') + // String color (default value: r'red') test('to test the property `color`', () async {}); // String breed diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/extensible_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/extensible_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_basic_get_default_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_basic_get_default_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_any_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_any_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/giga_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/giga_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/grape_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/grape_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/object_with_deprecated_fields_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/object_with_deprecated_fields_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/one_of_primitive_child_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/one_of_primitive_child_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/parent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/parent_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pasta_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pasta_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_speziale_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_speziale_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart rename to samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_test.dart diff --git a/website/i18n/en.json b/website/i18n/en.json index af769f8ec269..121028f5391d 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -131,6 +131,10 @@ "title": "Config Options for dart-dio", "sidebar_label": "dart-dio" }, + "generators/dart-next": { + "title": "Config Options for dart-next", + "sidebar_label": "dart-next" + }, "generators/dart-jaguar": { "title": "Config Options for dart-jaguar", "sidebar_label": "dart-jaguar" From 580ce70e8ea0295fecbc3c813c8870f64c4f9e4f Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:14:00 +0200 Subject: [PATCH 18/31] add back original files --- .../src/main/resources/dart/dart-keywords.txt | 69 ++++ .../dart/libraries/dio/README.mustache | 126 +++++++ .../libraries/dio/analysis_options.mustache | 12 + .../resources/dart/libraries/dio/api.mustache | 148 +++++++++ .../dart/libraries/dio/api_client.mustache | 72 ++++ .../dart/libraries/dio/api_doc.mustache | 86 +++++ .../dart/libraries/dio/api_test.mustache | 28 ++ .../libraries/dio/auth/api_key_auth.mustache | 27 ++ .../dart/libraries/dio/auth/auth.mustache | 15 + .../libraries/dio/auth/basic_auth.mustache | 34 ++ .../libraries/dio/auth/bearer_auth.mustache | 23 ++ .../dart/libraries/dio/auth/oauth.mustache | 23 ++ .../dart/libraries/dio/class.mustache | 1 + .../dart/libraries/dio/enum.mustache | 1 + .../dart/libraries/dio/gitignore.mustache | 41 +++ .../dart/libraries/dio/header.mustache | 3 + .../resources/dart/libraries/dio/lib.mustache | 12 + .../dart/libraries/dio/model.mustache | 10 + .../dart/libraries/dio/model_test.mustache | 27 ++ .../dart/libraries/dio/object_doc.mustache | 16 + .../dart/libraries/dio/pubspec.mustache | 39 +++ .../built_value/api/constructor.mustache | 3 + .../built_value/api/deserialize.mustache | 23 ++ .../built_value/api/imports.mustache | 1 + .../built_value/api/query_param.mustache | 1 + .../built_value/api/serialize.mustache | 30 ++ .../built_value/api_util.mustache | 74 +++++ .../serialization/built_value/class.mustache | 19 ++ .../built_value/class_concrete.mustache | 56 ++++ .../built_value/class_discriminator.mustache | 20 ++ .../built_value/class_header.mustache | 13 + .../built_value/class_inline_enums.mustache | 23 ++ .../built_value/class_members.mustache | 38 +++ .../built_value/class_serializer.mustache | 307 ++++++++++++++++++ .../serialization/built_value/date.mustache | 70 ++++ .../built_value/date_serializer.mustache | 28 ++ .../deserialize_properties.mustache | 57 ++++ .../serialization/built_value/enum.mustache | 36 ++ .../built_value/enum_inline.mustache | 22 ++ .../offset_date_serializer.mustache | 52 +++ .../built_value/serializers.mustache | 45 +++ .../built_value/test_instance.mustache | 2 + .../variable_serializer_type.mustache | 1 + .../built_value/variable_type.mustache | 1 + .../api/constructor.mustache | 1 + .../api/deserialize.mustache | 2 + .../json_serializable/api/imports.mustache | 3 + .../api/query_param.mustache | 1 + .../json_serializable/api/serialize.mustache | 1 + .../json_serializable/build.yaml.mustache | 18 + .../json_serializable/class.mustache | 99 ++++++ .../dart_constructor.mustache | 11 + .../json_serializable/deserialize.mustache | 64 ++++ .../json_serializable/enum.mustache | 17 + .../json_serializable/enum_inline.mustache | 14 + .../json_serializable/test_instance.mustache | 2 + 56 files changed, 1968 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/dart/dart-keywords.txt create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache create mode 100644 modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache diff --git a/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt new file mode 100644 index 000000000000..5e51f8cceff6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt @@ -0,0 +1,69 @@ +abstract +as +assert +async +await +break +case +catch +class +const +continue +covariant +default +deferred +do +dynamic +else +enum +export +extends +extension +external +factory +false +final +finally +for +Function +get +hide +if +implements +import +in +inout +interface +is +late +library +mixin +native +new +null +of +on +operator +out +part +patch +required +rethrow +return +set +show +source +static +super +switch +sync +this +throw +true +try +typedef +var +void +while +with +yield \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache new file mode 100644 index 000000000000..50f467f647a3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache @@ -0,0 +1,126 @@ +# {{pubName}} (EXPERIMENTAL) +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +{{#artifactVersion}} +- Package version: {{.}} +{{/artifactVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) +{{#useJsonSerializable}} +* JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable) +{{/useJsonSerializable}} +{{#useDateLibTimeMachine}} +* timemachine option currently **DOES NOT** support sound null-safety and may not work +{{/useDateLibTimeMachine}} + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + {{pubName}}: {{pubVersion}} +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + {{pubName}}: + git: + url: https://github.com/{{gitUserId}}/{{gitRepoId}}.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + {{pubName}}: + path: /path/to/{{pubName}} +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:{{pubName}}/{{pubName}}.dart'; +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + +final api = {{clientName}}().get{{classname}}(); +{{#allParams}} +final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final response = await {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(response); + {{/returnType}} +} catch on DioException (e) { + print("Exception when calling {{classname}}->{{operationId}}: $e\n"); +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} +### {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache new file mode 100644 index 000000000000..865b3404b402 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/analysis_options.mustache @@ -0,0 +1,12 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart{{#useJsonSerializable}} + - lib/{{sourceFolder}}/model/*.g.dart{{/useJsonSerializable}} + errors: + deprecated_member_use_from_same_package: ignore diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache new file mode 100644 index 000000000000..e86a2cfb005a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -0,0 +1,148 @@ +{{>header}} +import 'dart:async'; + +{{#includeLibraryTemplate}}api/imports{{/includeLibraryTemplate}} +import 'package:dio/dio.dart'; + +{{#operations}} +{{#imports}}import '{{.}}'; +{{/imports}} + +class {{classname}} { + + final Dio _dio; + +{{#includeLibraryTemplate}}api/constructor{{/includeLibraryTemplate}} + + {{#operation}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{notes}} + /// + /// Parameters: + {{#allParams}} + /// * [{{paramName}}] {{#description}}- {{{.}}}{{/description}} + {{/allParams}} + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} + /// Throws [DioException] if API call or serialization fails + {{#externalDocs}} + /// {{description}} + /// Also see [{{summary}} Documentation]({{url}}) + {{/externalDocs}} + {{#isDeprecated}} + @Deprecated('This operation has been deprecated') + {{/isDeprecated}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} + {{#isDeprecated}}@Deprecated('{{paramName}} is deprecated') {{/isDeprecated}}{{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{{baseName}}}' '}', {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}.toString()){{/pathParams}}; + final _options = Options( + method: r'{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}', + {{#isResponseFile}} + responseType: ResponseType.bytes, + {{/isResponseFile}} + headers: { + {{#httpUserAgent}} + r'User-Agent': r'{{{.}}}', + {{/httpUserAgent}} + {{#headerParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{paramName}}, + {{/headerParams}} + ...?headers, + }, + extra: { + 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} + {{#authMethods}}{ + 'type': '{{type}}',{{#scheme}} + 'scheme': '{{.}}',{{/scheme}} + 'name': '{{name}}',{{#isApiKey}} + 'keyName': '{{keyParamName}}', + 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} + },{{/authMethods}} + ],{{/hasAuthMethods}} + ...?extra, + },{{#hasConsumes}} + contentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} + validateStatus: validateStatus, + );{{#hasQueryParams}} + + final _queryParameters = { + {{#queryParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{baseName}}': {{#includeLibraryTemplate}}api/query_param{{/includeLibraryTemplate}}, + {{/queryParams}} + };{{/hasQueryParams}}{{#hasBodyOrFormParams}} + + dynamic _bodyData; + + try { +{{#includeLibraryTemplate}}api/serialize{{/includeLibraryTemplate}} + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + }{{/hasBodyOrFormParams}} + + final _response = await _dio.request( + _path,{{#hasBodyOrFormParams}} + data: _bodyData,{{/hasBodyOrFormParams}} + options: _options,{{#hasQueryParams}} + queryParameters: _queryParameters,{{/hasQueryParams}} + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + {{#returnType}} + + {{{.}}}? _responseData; + + try { +{{#includeLibraryTemplate}}api/deserialize{{/includeLibraryTemplate}} + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response<{{{returnType}}}>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + );{{/returnType}}{{^returnType}} + return _response;{{/returnType}} + } + + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache new file mode 100644 index 000000000000..d0cc2dfb2096 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -0,0 +1,72 @@ +{{>header}} +import 'package:dio/dio.dart';{{#useBuiltValue}} +import 'package:built_value/serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/serializers.dart';{{/useBuiltValue}} +import 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/bearer_auth.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} +class {{clientName}} { + static const String basePath = r'{{{basePath}}}'; + + final Dio dio; +{{#useBuiltValue}} + final Serializers serializers; + +{{/useBuiltValue}} + {{clientName}}({ + Dio? dio,{{#useBuiltValue}} + Serializers? serializers,{{/useBuiltValue}} + String? basePathOverride, + List? interceptors, + }) : {{#useBuiltValue}}this.serializers = serializers ?? standardSerializers,{{/useBuiltValue}} + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + }{{#apiInfo}}{{#apis}} + + /// Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + {{classname}} get{{classname}}() { + return {{classname}}(dio{{#useBuiltValue}}, serializers{{/useBuiltValue}}); + }{{/apis}}{{/apiInfo}} +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache new file mode 100644 index 000000000000..10292c430463 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache @@ -0,0 +1,86 @@ +# {{pubName}}.api.{{classname}}{{#description}} +{{.}}{{/description}} + +## Load the API package +```dart +import 'package:{{pubName}}/api.dart'; +``` + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +# **{{{operationId}}}** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Example +```dart +import 'package:{{pubName}}/api.dart'; +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasicBasic}} +// TODO Configure HTTP basic authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD'; +{{/isBasicBasic}} +{{#isApiKey}} +// TODO Configure API key authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer'; +{{/isApiKey}} +{{#isOAuth}} +// TODO Configure OAuth2 access token for authorization: {{{name}}} +//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN'; +{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +final api = {{clientName}}().get{{classname}}(); +{{#allParams}} +final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} + +try { + {{#returnType}}final response = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + print(response); + {{/returnType}} +} catch on DioException (e) { + print('Exception when calling {{classname}}->{{operationId}}: $e\n'); +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache new file mode 100644 index 000000000000..8420ac5dfaf7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:test/test.dart'; +import 'package:{{pubName}}/{{pubName}}.dart'; + +{{#operations}} + +/// tests for {{{classname}}} +void main() { + final instance = {{{clientName}}}().get{{{classname}}}(); + + group({{{classname}}}, () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{{operationId}}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache new file mode 100644 index 000000000000..5d9da99bd5d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache @@ -0,0 +1,27 @@ +{{>header}} + +import 'package:dio/dio.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache new file mode 100644 index 000000000000..a266e2384c77 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache @@ -0,0 +1,15 @@ +{{>header}} +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache new file mode 100644 index 000000000000..c2a4426937da --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache @@ -0,0 +1,34 @@ +{{>header}} +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache new file mode 100644 index 000000000000..b4bce45ca61f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache @@ -0,0 +1,23 @@ +{{>header}} +import 'package:dio/dio.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache new file mode 100644 index 000000000000..e5af801f39be --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache @@ -0,0 +1,23 @@ +{{>header}} +import 'package:dio/dio.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache new file mode 100644 index 000000000000..228fcf5826d1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/class.mustache @@ -0,0 +1 @@ +{{#includeLibraryTemplate}}class{{/includeLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache new file mode 100644 index 000000000000..a47e780c2b57 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/enum.mustache @@ -0,0 +1 @@ +{{#includeLibraryTemplate}}enum{{/includeLibraryTemplate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/header.mustache new file mode 100644 index 000000000000..32c88287e5cf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/header.mustache @@ -0,0 +1,3 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache new file mode 100644 index 000000000000..1ac711810617 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/lib.mustache @@ -0,0 +1,12 @@ +{{>header}} +export 'package:{{pubName}}/{{sourceFolder}}/api.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/auth/api_key_auth.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/auth/basic_auth.dart'; +export 'package:{{pubName}}/{{sourceFolder}}/auth/oauth.dart'; +{{#useBuiltValue}}export 'package:{{pubName}}/{{sourceFolder}}/serializers.dart'; +{{#useDateLibCore}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}}{{/useBuiltValue}} + +{{#apiInfo}}{{#apis}}export 'package:{{pubName}}/{{sourceFolder}}/{{apiPackage}}/{{classFilename}}.dart'; +{{/apis}}{{/apiInfo}} +{{#models}}{{#model}}export 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache new file mode 100644 index 000000000000..1917decaf6c6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model.mustache @@ -0,0 +1,10 @@ +{{>header}} +// ignore_for_file: unused_element +{{#models}} + {{#model}} + {{#imports}} +import '{{.}}'; + {{/imports}} +{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} + {{/model}} +{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache new file mode 100644 index 000000000000..26f614c657f2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache @@ -0,0 +1,27 @@ +{{#models}} +{{#model}} +import 'package:test/test.dart'; +import 'package:{{pubName}}/{{pubName}}.dart'; + +// tests for {{{classname}}} +void main() { + {{^isEnum}} + {{! Due to required vars without default value we can not create a full instance here }} +{{#includeLibraryTemplate}}test_instance{{/includeLibraryTemplate}} + {{/isEnum}} + + group({{{classname}}}, () { + {{#vars}} + {{#description}} + // {{{.}}} + {{/description}} + // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{{name}}}`', () async { + // TODO + }); + + {{/vars}} + }); +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache new file mode 100644 index 000000000000..9abc25d51235 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache @@ -0,0 +1,16 @@ +{{#models}}{{#model}}# {{pubName}}.model.{{classname}} + +## Load the model package +```dart +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}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache new file mode 100644 index 000000000000..e1201880b0c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -0,0 +1,39 @@ +name: {{pubName}} +version: {{pubVersion}} +description: {{pubDescription}} +homepage: {{pubHomepage}} +{{#pubRepository}} +repository: {{.}} +{{/pubRepository}} +{{#pubPublishTo}} +publish_to: {{.}} +{{/pubPublishTo}} + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' +{{#useBuiltValue}} + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' +{{/useBuiltValue}} +{{#useJsonSerializable}} + json_annotation: '^4.4.0' +{{/useJsonSerializable}} +{{#useDateLibTimeMachine}} + time_machine: ^0.9.16 +{{/useDateLibTimeMachine}} + +dev_dependencies: +{{#useBuiltValue}} + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any +{{/useBuiltValue}} +{{#useJsonSerializable}} + build_runner: any + json_serializable: '^6.1.5' +{{/useJsonSerializable}} + test: ^1.16.0 diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache new file mode 100644 index 000000000000..e823414cc755 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/constructor.mustache @@ -0,0 +1,3 @@ + final Serializers _serializers; + + const {{classname}}(this._dio, this._serializers); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache new file mode 100644 index 000000000000..fe49d9d3f06a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/deserialize.mustache @@ -0,0 +1,23 @@ + final rawResponse = _response.data; + {{#isResponseFile}} + _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; + {{/isResponseFile}} + {{^isResponseFile}} + {{#returnSimpleType}} + {{#returnTypeIsPrimitive}} + _responseData = rawResponse == null ? null : rawResponse as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType({{{returnType}}}), + ) as {{{returnType}}}; + {{/returnTypeIsPrimitive}} + {{/returnSimpleType}} + {{^returnSimpleType}} + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Built{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{#isMap}}Map{{/isMap}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{returnBaseType}}})]), + ) as {{{returnType}}}; + {{/returnSimpleType}} + {{/isResponseFile}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache new file mode 100644 index 000000000000..2f62fbda4267 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/imports.mustache @@ -0,0 +1 @@ +import 'package:built_value/serializer.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache new file mode 100644 index 000000000000..aa47f4f43940 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/query_param.mustache @@ -0,0 +1 @@ +{{#isContainer}}{{#isMap}}encodeQueryParameter{{/isMap}}{{^isMap}}encodeCollectionQueryParameter<{{{baseType}}}>{{/isMap}}{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{dataType}}}){{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]), {{#collectionFormat}}format: ListFormat.{{collectionFormat}},{{/collectionFormat}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache new file mode 100644 index 000000000000..6c4d370d86e9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api/serialize.mustache @@ -0,0 +1,30 @@ + {{#hasFormParams}} + {{#isMultipart}} + _bodyData = FormData.fromMap({ + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{#isFile}}{{{paramName}}}{{#isArray}}.toList(){{/isArray}}{{/isFile}}{{^isFile}}encodeFormParameter(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{baseType}}}{{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]{{/isContainer}})){{/isFile}}, + {{/formParams}} + }); + {{/isMultipart}} + {{^isMultipart}} + _bodyData = { + {{#formParams}} + {{^required}}{{^isNullable}}if ({{{paramName}}} != null) {{/isNullable}}{{/required}}r'{{{baseName}}}': {{>serialization/built_value/api/query_param}}, + {{/formParams}} + }; + {{/isMultipart}} + {{/hasFormParams}} + {{#bodyParam}} + {{#isPrimitiveType}} + _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isContainer}} + const _type = FullType(Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]); + {{/isContainer}} + {{^isContainer}} + const _type = FullType({{{baseType}}}); + {{/isContainer}} + _bodyData = {{^required}}{{paramName}} == null ? null : {{/required}}_serializers.serialize({{paramName}}, specifiedType: _type); + {{/isPrimitiveType}} + {{/bodyParam}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache new file mode 100644 index 000000000000..45432b0042dc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache @@ -0,0 +1,74 @@ +{{>header}} +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache new file mode 100644 index 000000000000..9acd5ba70a08 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache @@ -0,0 +1,19 @@ +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart';{{#oneOf}}{{#-first}} +import 'package:one_of/one_of.dart';{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}} +import 'package:one_of/any_of.dart';{{/-first}}{{/anyOf}} + +{{#imports}} +{{/imports}} +part '{{classFilename}}.g.dart'; + +{{>serialization/built_value/class_header}} { +{{>serialization/built_value/class_members}} +} +{{#discriminator}}{{#hasDiscriminatorWithNonEmptyMapping}} +{{>serialization/built_value/class_discriminator}} +{{/hasDiscriminatorWithNonEmptyMapping}}{{/discriminator}} +{{>serialization/built_value/class_serializer}}{{#vendorExtensions.x-is-parent}} + +{{>serialization/built_value/class_concrete}}{{/vendorExtensions.x-is-parent}} +{{>serialization/built_value/class_inline_enums}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache new file mode 100644 index 000000000000..44cad763010a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_concrete.mustache @@ -0,0 +1,56 @@ +/// a concrete implementation of [{{classname}}], since [{{classname}}] is not instantiable +@BuiltValue(instantiable: true) +abstract class ${{classname}} implements {{classname}}, Built<${{classname}}, ${{classname}}Builder> { + ${{classname}}._(); + + factory ${{classname}}([void Function(${{classname}}Builder)? updates]) = _$${{classname}}; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(${{classname}}Builder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<${{classname}}> get serializer => _$${{classname}}Serializer(); +} + +class _$${{classname}}Serializer implements PrimitiveSerializer<${{classname}}> { + @override + final Iterable types = const [${{classname}}, _$${{classname}}]; + + @override + final String wireName = r'${{classname}}'; + + @override + Object serialize( + Serializers serializers, + ${{{classname}}} object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType({{classname}}))!; + } + +{{#vendorExtensions.x-has-self-and-ancestor-only-props}}{{>serialization/built_value/deserialize_properties}} + +{{/vendorExtensions.x-has-self-and-ancestor-only-props}} + @override + ${{classname}} deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ${{classname}}Builder(); + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! when discriminator is involved, read it, then return based on value }} + return result.build(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache new file mode 100644 index 000000000000..f867345883b1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_discriminator.mustache @@ -0,0 +1,20 @@ +extension {{classname}}DiscriminatorExt on {{classname}} { + String? get discriminatorValue { + {{#mappedModels}} + if (this is {{modelName}}) { + return r'{{mappingName}}'; + } + {{/mappedModels}} + return null; + } +} +extension {{classname}}BuilderDiscriminatorExt on {{classname}}Builder { + String? get discriminatorValue { + {{#mappedModels}} + if (this is {{modelName}}Builder) { + return r'{{mappingName}}'; + } + {{/mappedModels}} + return null; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache new file mode 100644 index 000000000000..a059dc504798 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_header.mustache @@ -0,0 +1,13 @@ +/// {{{description}}}{{^description}}{{classname}}{{/description}} +{{#hasVars}} +/// +/// Properties: +{{#allVars}} +/// * [{{{name}}}] {{#description}}- {{{.}}}{{/description}} +{{/allVars}} +{{/hasVars}} +{{#isDeprecated}} +@Deprecated('{{{classname}}} has been deprecated') +{{/isDeprecated}} +@BuiltValue({{#vendorExtensions.x-is-parent}}instantiable: false{{/vendorExtensions.x-is-parent}}) +abstract class {{classname}} {{^allOf}}{{^vendorExtensions.x-is-parent}}implements {{/vendorExtensions.x-is-parent}}{{/allOf}}{{#allOf}}{{#-first}}implements {{/-first}}{{/allOf}}{{#allOf}}{{{.}}}{{^-last}}, {{/-last}}{{/allOf}}{{^vendorExtensions.x-is-parent}}{{#allOf}}{{#-first}}, {{/-first}}{{/allOf}}{{/vendorExtensions.x-is-parent}}{{^vendorExtensions.x-is-parent}}Built<{{classname}}, {{classname}}Builder>{{/vendorExtensions.x-is-parent}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache new file mode 100644 index 000000000000..1105c1b70b10 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_inline_enums.mustache @@ -0,0 +1,23 @@ +{{! + Generate an enum for any variables that are declared as inline enums + isEnum is only true for inline variables that are enums. + If an enum is declared as a definition, isEnum is false and the enum is generated from the + enum.mustache template. + enumName only exists for inline enums +}} +{{#vars}} + {{^isModel}} + {{#enumName}} + {{^isContainer}} + +{{>serialization/built_value/enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/built_value/enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/enumName}} + {{/isModel}} +{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache new file mode 100644 index 000000000000..0df06e1e3073 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_members.mustache @@ -0,0 +1,38 @@ +{{! define variables that aren't inherited from allOf/anyOf/oneOf }} +{{#vendorExtensions.x-self-only-props}} + {{#description}} + /// {{{.}}} + {{/description}} + {{#deprecated}} + @Deprecated('{{{name}}} has been deprecated') + {{/deprecated}} + @BuiltValueField(wireName: r'{{baseName}}') + {{>serialization/built_value/variable_type}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}}; + {{#allowableValues}} + // {{#min}}range from {{{min}}} to {{{max}}}{{/min}}{{^min}}enum {{name}}Enum { {{#values}} {{{.}}}, {{/values}} };{{/min}} + {{/allowableValues}} + +{{/vendorExtensions.x-self-only-props}}{{#anyOf}}{{#-first}} /// Any Of {{#anyOf}}[{{{.}}}]{{^-last}}, {{/-last}}{{/anyOf}} + AnyOf get anyOf; + +{{/-first}}{{/anyOf}}{{#oneOf}}{{#-first}} /// One Of {{#oneOf}}[{{{.}}}]{{^-last}}, {{/-last}}{{/oneOf}} + OneOf get oneOf; + +{{/-first}}{{/oneOf}}{{#discriminator}} static const String discriminatorFieldName = r'{{propertyBaseName}}';{{#hasDiscriminatorWithNonEmptyMapping}} + + static const Map discriminatorMapping = { + {{#mappedModels}} + r'{{mappingName}}': {{modelName}}, + {{/mappedModels}} + };{{/hasDiscriminatorWithNonEmptyMapping}} + +{{/discriminator}}{{^vendorExtensions.x-is-parent}} {{classname}}._(); + + factory {{classname}}([void updates({{classname}}Builder b)]) = _${{classname}}; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults({{{classname}}}Builder b) => b{{#vendorExtensions.x-parent-discriminator}}..{{propertyName}}=b.discriminatorValue{{/vendorExtensions.x-parent-discriminator}}{{#vendorExtensions.x-self-and-ancestor-only-props}}{{#defaultValue}} + ..{{{name}}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/vendorExtensions.x-self-and-ancestor-only-props}}; + +{{/vendorExtensions.x-is-parent}} @BuiltValueSerializer(custom: true) + static Serializer<{{classname}}> get serializer => _${{classname}}Serializer(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache new file mode 100644 index 000000000000..4cd02f3506de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class_serializer.mustache @@ -0,0 +1,307 @@ +class _${{classname}}Serializer implements PrimitiveSerializer<{{classname}}> { + @override + final Iterable types = const [{{classname}}{{^vendorExtensions.x-is-parent}}, _${{classname}}{{/vendorExtensions.x-is-parent}}]; + + @override + final String wireName = r'{{classname}}'; + + Iterable _serializeProperties( + Serializers serializers, + {{{classname}}} object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + {{#vendorExtensions.x-self-and-ancestor-only-props}} + {{#required}} + {{! + A required property need to always be part of the serialized output. + When it is nullable, null is serialized, otherwise it is an error if it is null. + }} + yield r'{{baseName}}'; + yield {{#isNullable}}object.{{{name}}} == null ? null : {{/isNullable}}serializers.serialize( + object.{{{name}}}, + specifiedType: const {{>serialization/built_value/variable_serializer_type}}, + ); + {{/required}} + {{^required}} + if (object.{{{name}}} != null) { + {{! Non-required properties are only serialized if not null. }} + yield r'{{baseName}}'; + yield serializers.serialize( + object.{{{name}}}, + specifiedType: const {{>serialization/built_value/variable_serializer_type}}, + ); + } + {{/required}} + {{/vendorExtensions.x-self-and-ancestor-only-props}} + } + + @override + Object serialize( + Serializers serializers, + {{{classname}}} object, { + FullType specifiedType = FullType.unspecified, + }) { + {{! oneOf }} + {{#oneOf}} + {{#-first}} + final oneOf = object.oneOf; + {{#vendorExtensions.x-self-and-ancestor-only-props}} + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + {{/vendorExtensions.x-self-and-ancestor-only-props}} + {{^vendorExtensions.x-self-and-ancestor-only-props}} + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + {{/vendorExtensions.x-self-and-ancestor-only-props}} + {{/-first}} + {{/oneOf}} + {{! anyOf }} + {{#anyOf}} + {{#-first}} + final anyOf = object.anyOf; + {{#vendorExtensions.x-self-and-ancestor-only-props}} + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + final serialized = serializers.serialize(anyOf, specifiedType: FullType(AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList())); + result.addAll((serialized is Map ? serialized.entries.map((e) => [e.key, e.value]).expand((e) => e) : serialized) as Iterable); + return result; + {{/vendorExtensions.x-self-and-ancestor-only-props}} + {{^vendorExtensions.x-self-and-ancestor-only-props}} + return serializers.serialize(anyOf, specifiedType: FullType(AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()))!; + {{/vendorExtensions.x-self-and-ancestor-only-props}} + {{/-first}} + {{/anyOf}} + {{^oneOf}} + {{^anyOf}} + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{! handle discriminator }} + {{#mappedModels}} + if (object is {{modelName}}) { + return serializers.serialize(object, specifiedType: FullType({{modelName}}))!; + } + {{/mappedModels}} + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + {{/anyOf}} + {{/oneOf}} + } + +{{#vendorExtensions.x-has-self-and-ancestor-only-props}}{{^vendorExtensions.x-is-parent}}{{>serialization/built_value/deserialize_properties}} + +{{/vendorExtensions.x-is-parent}}{{/vendorExtensions.x-has-self-and-ancestor-only-props}} @override + {{classname}} deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + {{! oneOf }} + {{#oneOf}} + {{#-first}} + final result = {{#vendorExtensions.x-is-parent}}${{/vendorExtensions.x-is-parent}}{{classname}}Builder(); + Object? oneOfDataSrc; + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{! has props, assign them to result, and extract unhandled }} + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result + ); + {{! only deserialize unhandled props }} + oneOfDataSrc = unhandled; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + {{^vendorExtensions.x-has-self-and-ancestor-only-props}} + oneOfDataSrc = serialized; + {{! has no probs at all, pass the serialized as is }} + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + final oneOfTypes = [{{#mappedModels}}{{modelName}}, {{/mappedModels}}{{#vendorExtensions.x-is-parent}}${{classname}}{{/vendorExtensions.x-is-parent}}]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + {{#mappedModels}} + case r'{{mappingName}}': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType({{modelName}}), + ) as {{modelName}}; + oneOfType = {{modelName}}; + break; + {{/mappedModels}} + default: + {{#vendorExtensions.x-is-parent}} + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(${{classname}}), + ) as ${{classname}}; + oneOfType = ${{classname}}; + {{/vendorExtensions.x-is-parent}} + {{^vendorExtensions.x-is-parent}} + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + {{/vendorExtensions.x-is-parent}} + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{! use the OneOfSerializer when there is no discriminator }} + final targetType = const FullType(OneOf, [{{#composedSchemas}}{{#oneOf}}{{>serialization/built_value/variable_serializer_type}}, {{/oneOf}}{{/composedSchemas}}]); + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! has props, assign them to result, and extract unhandled }} + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + {{! only deserialize unhandled props }} + oneOfDataSrc = unhandled; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + {{^vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! has no probs at all, pass the serialized as is }} + oneOfDataSrc = serialized; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + {{/hasDiscriminatorWithNonEmptyMapping}} + return result.build(); + {{/-first}} + {{/oneOf}} + {{! anyOf }} + {{#anyOf}} + {{#-first}} + final result = {{#vendorExtensions.x-is-parent}}${{/vendorExtensions.x-is-parent}}{{classname}}Builder(); + Object? anyOfDataSrc; + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + {{! has props, assign them to result, and extract unhandled }} + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + {{! only deserialize unhandled props }} + anyOfDataSrc = unhandled; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + {{^vendorExtensions.x-has-self-and-ancestor-only-props}} + anyOfDataSrc = serialized; + {{! has no probs at all, pass the serialized as is }} + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + final anyOfTypes = [{{#mappedModels}}{{modelName}}, {{/mappedModels}}{{#vendorExtensions.x-is-parent}}${{classname}}{{/vendorExtensions.x-is-parent}}]; + Object anyOfResult; + Type anyOfType; + switch (discValue) { + {{#mappedModels}} + case r'{{mappingName}}': + anyOfResult = serializers.deserialize(anyOfDataSrc, specifiedType: FullType({{modelName}})) as {{modelName}}; + anyOfType = {{modelName}}; + break; + {{/mappedModels}} + default: + {{#vendorExtensions.x-is-parent}} + anyOfResult = serializers.deserialize(anyOfDataSrc, specifiedType: FullType(${{classname}})) as ${{classname}}; + anyOfType = ${{classname}}; + {{/vendorExtensions.x-is-parent}} + {{^vendorExtensions.x-is-parent}} + throw UnsupportedError("Couldn't deserialize anyOf for the discriminator value: ${discValue}"); + {{/vendorExtensions.x-is-parent}} + } + result.anyOf = AnyOfDynamic(values: {anyOfTypes.indexOf(anyOfType): anyOfResult}, types: anyOfTypes); + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{^hasDiscriminatorWithNonEmptyMapping}} + {{! use the OneOfSerializer when there is no discriminator }} + final targetType = const FullType(AnyOf, [{{#composedSchemas}}{{#anyOf}}{{>serialization/built_value/variable_serializer_type}}, {{/anyOf}}{{/composedSchemas}}]); + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! has props, assign them to result, and extract unhandled }} + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + {{! only deserialize unhandled props }} + anyOfDataSrc = unhandled; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + {{^vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! has no probs at all, pass the serialized as is }} + anyOfDataSrc = serialized; + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + result.anyOf = serializers.deserialize(anyOfDataSrc, specifiedType: targetType) as AnyOf; + {{/hasDiscriminatorWithNonEmptyMapping}} + return result.build(); + {{/-first}} + {{/anyOf}} + {{! no anyOf nor oneOf, handles allOf trees }} + {{^oneOf}} + {{^anyOf}} + {{#vendorExtensions.x-is-parent}} + {{! + parent classes don't have builder + so they must delegate to another serializer using + 1) discriminator + mapping + 2) concrete implementation ($classname) + }} + {{#hasDiscriminatorWithNonEmptyMapping}} + {{#discriminator}} + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf({{classname}}.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + {{#mappedModels}} + case r'{{mappingName}}': + return serializers.deserialize(serialized, specifiedType: FullType({{modelName}})) as {{modelName}}; + {{/mappedModels}} + default: + return serializers.deserialize(serialized, specifiedType: FullType(${{classname}})) as ${{classname}}; + } + {{/discriminator}} + {{/hasDiscriminatorWithNonEmptyMapping}} + {{^hasDiscriminatorWithNonEmptyMapping}} + return serializers.deserialize(serialized, specifiedType: FullType(${{classname}})) as ${{classname}}; + {{/hasDiscriminatorWithNonEmptyMapping}} + {{/vendorExtensions.x-is-parent}} + {{^vendorExtensions.x-is-parent}} + final result = {{classname}}Builder(); + final serializedList = (serialized as Iterable).toList(); + {{#vendorExtensions.x-has-self-and-ancestor-only-props}} + {{! has props, assign them to result, and extract unhandled }} + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + {{/vendorExtensions.x-has-self-and-ancestor-only-props}} + return result.build(); + {{/vendorExtensions.x-is-parent}} + {{/anyOf}} + {{/oneOf}} + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date.mustache @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache new file mode 100644 index 000000000000..dc16805ce628 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/date_serializer.mustache @@ -0,0 +1,28 @@ +{{>header}} +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache new file mode 100644 index 000000000000..d64ec8086c34 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/deserialize_properties.mustache @@ -0,0 +1,57 @@ + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required {{classname}}Builder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + {{#vendorExtensions.x-self-and-ancestor-only-props}} + case r'{{baseName}}': + final valueDes = serializers.deserialize( + value, + specifiedType: const {{>serialization/built_value/variable_serializer_type}}, + ) as {{>serialization/built_value/variable_type}}; + {{#isNullable}} + if (valueDes == null) continue; + {{/isNullable}} + {{#isContainer}} + result.{{{name}}}.replace(valueDes); + {{/isContainer}} + {{^isContainer}} + {{#isEnum}} + result.{{{name}}} = valueDes; + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + {{#isPrimitiveType}} + {{! These are models that have been manually marked as primitive via generator param. }} + result.{{{name}}} = valueDes; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#vendorExtensions.x-is-parent}} + result.{{{name}}} = valueDes; + {{/vendorExtensions.x-is-parent}} + {{^vendorExtensions.x-is-parent}} + result.{{{name}}}.replace(valueDes); + {{/vendorExtensions.x-is-parent}} + {{/isPrimitiveType}} + {{/isModel}} + {{^isModel}} + result.{{{name}}} = valueDes; + {{/isModel}} + {{/isEnum}} + {{/isContainer}} + break; + {{/vendorExtensions.x-self-and-ancestor-only-props}} + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache new file mode 100644 index 000000000000..2c076da6661c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache @@ -0,0 +1,36 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part '{{classFilename}}.g.dart'; + +{{#isDeprecated}} +@Deprecated('{{{classname}}} has been deprecated') +{{/isDeprecated}} +class {{classname}} extends EnumClass { + + {{#allowableValues}} + {{#enumVars}} + {{#description}} + /// {{{.}}} + {{/description}} + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) + static const {{classname}} {{name}} = _${{name}}; + {{/enumVars}} + {{/allowableValues}} + + static Serializer<{{classname}}> get serializer => _${{#lambda.camelcase}}{{{classname}}}{{/lambda.camelcase}}Serializer; + + const {{classname}}._(String name): super(name); + + static BuiltSet<{{classname}}> get values => _$values; + static {{classname}} valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class {{classname}}Mixin = Object with _${{classname}}Mixin; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache new file mode 100644 index 000000000000..98345b6d9d6a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache @@ -0,0 +1,22 @@ +{{#isDeprecated}} +@Deprecated('{{{enumName}}} has been deprecated') +{{/isDeprecated}} +class {{{enumName}}} extends EnumClass { + + {{#allowableValues}} + {{#enumVars}} + {{#description}} + /// {{{.}}} + {{/description}} + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}{{#enumUnknownDefaultCase}}{{#-last}}, fallback: true{{/-last}}{{/enumUnknownDefaultCase}}) + static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; + {{/enumVars}} + {{/allowableValues}} + + static Serializer<{{{enumName}}}> get serializer => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}Serializer; + + const {{{enumName}}}._(String name): super(name); + + static BuiltSet<{{{enumName}}}> get values => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}Values; + static {{{enumName}}} valueOf(String name) => _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}ValueOf(name); +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache new file mode 100644 index 000000000000..2698caf0f493 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/offset_date_serializer.mustache @@ -0,0 +1,52 @@ +{{>header}} +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:time_machine/time_machine.dart'; + +class OffsetDateSerializer implements PrimitiveSerializer { + + const OffsetDateSerializer(); + + @override + Iterable get types => BuiltList.of([OffsetDate]); + + @override + String get wireName => 'OffsetDate'; + + @override + OffsetDate deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final local = LocalDate.dateTime(DateTime.parse(serialized as String)); + return OffsetDate(local, Offset(0)); + } + + @override + Object serialize(Serializers serializers, OffsetDate offsetDate, + {FullType specifiedType = FullType.unspecified}) { + return offsetDate.toString('yyyy-MM-dd'); + } +} + +class OffsetDateTimeSerializer implements PrimitiveSerializer { + + const OffsetDateTimeSerializer(); + + @override + Iterable get types => BuiltList([OffsetDateTime]); + + @override + String get wireName => 'OffsetDateTime'; + + @override + OffsetDateTime deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final local = LocalDateTime.dateTime(DateTime.parse(serialized as String)); + return OffsetDateTime(local, Offset(0)); + } + + @override + Object serialize(Serializers serializers, OffsetDateTime offsetDateTime, + {FullType specifiedType = FullType.unspecified}) { + return offsetDateTime.toString(); + } +} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache new file mode 100644 index 000000000000..aa49d9aef9e4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache @@ -0,0 +1,45 @@ +{{>header}} +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +{{#useDateLibCore}}import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/date_serializer.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/date.dart';{{/useDateLibCore}} +{{#useDateLibTimeMachine}}import 'package:time_machine/time_machine.dart'; +import 'package:{{pubName}}/{{sourceFolder}}/offset_date_serializer.dart';{{/useDateLibTimeMachine}} +{{#models}}{{#model}}import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/model}}{{/models}}{{#builtValueSerializerImports}}import '{{{.}}}'; +{{/builtValueSerializerImports}} + +part 'serializers.g.dart'; + +@SerializersFor([{{#models}}{{#model}} + {{classname}},{{#vendorExtensions.x-is-parent}}${{classname}},{{/vendorExtensions.x-is-parent}}{{/model}}{{/models}} +]) +Serializers serializers = (_$serializers.toBuilder(){{#builtValueSerializers}} + ..addBuilderFactory( +{{#isArray}} + const FullType(Built{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), + () => {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}Builder<{{dataType}}>(), +{{/isArray}} +{{#isMap}} + const FullType(BuiltMap, [FullType(String), FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), + () => MapBuilder(), +{{/isMap}} + ){{/builtValueSerializers}} + {{#models}}{{#model}}{{#vendorExtensions.x-is-parent}}..add({{classname}}.serializer) + {{/vendorExtensions.x-is-parent}}{{/model}}{{/models}}..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()){{#useDateLibTimeMachine}} + ..add(const OffsetDateSerializer()) + ..add(const OffsetDateTimeSerializer()){{/useDateLibTimeMachine}}{{#useDateLibCore}} + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())){{/useDateLibCore}} + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache new file mode 100644 index 000000000000..2d92c472df31 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/test_instance.mustache @@ -0,0 +1,2 @@ + {{#vendorExtensions.x-is-parent}}//{{/vendorExtensions.x-is-parent}}final instance = {{{classname}}}Builder(); + // TODO add properties to the builder and call build() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache new file mode 100644 index 000000000000..c76dde39a9c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_serializer_type.mustache @@ -0,0 +1 @@ +FullType{{#isNullable}}.nullable{{/isNullable}}({{#isContainer}}{{baseType}}, [{{#isMap}}FullType(String), {{/isMap}}{{#items}}{{>serialization/built_value/variable_serializer_type}}{{/items}}]{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache new file mode 100644 index 000000000000..136545525cac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/variable_type.mustache @@ -0,0 +1 @@ +{{#isContainer}}{{baseType}}<{{#isMap}}String, {{/isMap}}{{#items}}{{>serialization/built_value/variable_type}}{{/items}}>{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache new file mode 100644 index 000000000000..a772c3148eaa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/constructor.mustache @@ -0,0 +1 @@ + const {{classname}}(this._dio); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache new file mode 100644 index 000000000000..f8666920780e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/deserialize.mustache @@ -0,0 +1,2 @@ +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize<{{{returnType}}}, {{{returnBaseType}}}>(rawData, '{{{returnType}}}', growable: true); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache new file mode 100644 index 000000000000..8ffca287e493 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/imports.mustache @@ -0,0 +1,3 @@ +// ignore: unused_import +import 'dart:convert'; +import 'package:{{pubName}}/{{sourceFolder}}/deserialize.dart'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache new file mode 100644 index 000000000000..a83489f9e91c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/query_param.mustache @@ -0,0 +1 @@ +{{{paramName}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache new file mode 100644 index 000000000000..93aed695e980 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/api/serialize.mustache @@ -0,0 +1 @@ +{{#bodyParam}}_bodyData=jsonEncode({{{paramName}}});{{/bodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/build.yaml.mustache @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache new file mode 100644 index 000000000000..4bc0161261e5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -0,0 +1,99 @@ +import 'package:json_annotation/json_annotation.dart'; + +part '{{classFilename}}.g.dart'; + +{{! + Classes with polymorphism or composition may generate unused imports, + these need to be ignored for said classes so that there are no lint errors. +}} +{{#parentModel}} +// ignore_for_file: unused_import + +{{/parentModel}} + +{{#isDeprecated}} +@Deprecated('{{{classname}}} has been deprecated') +{{/isDeprecated}} +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class {{{classname}}} { +{{>serialization/json_serializable/dart_constructor}} + +{{#vars}} + {{#description}} + /// {{{description}}} + {{/description}} + {{^isEnum}} + {{#minimum}} + // minimum: {{{minimum}}} + {{/minimum}} + {{#maximum}} + // maximum: {{{maximum}}} + {{/maximum}} + {{/isEnum}} + {{#deprecated}} + @Deprecated('{{{name}}} has been deprecated') + {{/deprecated}} + {{^isBinary}} + @JsonKey( + {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}} + name: r'{{{baseName}}}', + required: {{#required}}true{{/required}}{{^required}}false{{/required}}, + includeIfNull: {{#required}}{{#isNullable}}true{{/isNullable}}false{{/required}}{{^required}}false{{/required}} + ) + {{/isBinary}} + {{#isBinary}} + @JsonKey(ignore: true) + {{/isBinary}} + + + {{#required}} + {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{{name}}}; + {{/required}} + {{^required}} + {{#finalProperties}}final {{/finalProperties}}{{{datatypeWithEnum}}}? {{{name}}}; + {{/required}} + + + +{{/vars}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + @override + int get hashCode => + {{#vars}} + {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + + factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); + + Map toJson() => _${{{classname}}}ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} +{{#vars}} + {{#isEnum}} + {{^isContainer}} + +{{>serialization/json_serializable/enum_inline}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} + +{{>serialization/json_serializable/enum_inline}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} +{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache new file mode 100644 index 000000000000..3b99f0c54016 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/dart_constructor.mustache @@ -0,0 +1,11 @@ + /// Returns a new [{{{classname}}}] instance. + {{{classname}}}({ + {{#vars}} + + {{! + A field is required in Dart when it is + required && !defaultValue in OAS + }} + {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}} this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}, + {{/vars}} + }); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache new file mode 100644 index 000000000000..edb8887328cd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/deserialize.mustache @@ -0,0 +1,64 @@ +{{#models}} + {{#model}} + {{^isEnum}} +import 'package:{{pubName}}/{{sourceFolder}}/{{modelPackage}}/{{classFilename}}.dart'; +{{/isEnum}} +{{/model}} +{{/models}} + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + + ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + {{#models}} + {{#model}} + case '{{{classname}}}': + {{#isEnum}} + {{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}} + {{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}} + {{/isEnum}} + {{^isEnum}} + return {{{classname}}}.fromJson(value as Map) as ReturnType; + {{/isEnum}} + {{/model}} + {{/models}} + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache new file mode 100644 index 000000000000..dbb1ed2cd22a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -0,0 +1,17 @@ +import 'package:json_annotation/json_annotation.dart'; + +{{#description}}/// {{{description}}}{{/description}} +{{#isDeprecated}} +@Deprecated('{{{classname}}} has been deprecated') +{{/isDeprecated}} +enum {{{classname}}} { +{{#allowableValues}} +{{#enumVars}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache new file mode 100644 index 000000000000..53cd77098740 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum_inline.mustache @@ -0,0 +1,14 @@ +{{#enumName}} +{{#description}}/// {{{description}}}{{/description}} +{{#isDeprecated}} +@Deprecated('{{{enumName}}} has been deprecated') +{{/isDeprecated}} +enum {{{ enumName }}} { +{{#allowableValues}} +{{#enumVars}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}, +{{/enumVars}} +{{/allowableValues}} +} +{{/enumName}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache new file mode 100644 index 000000000000..1b32f6768164 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/test_instance.mustache @@ -0,0 +1,2 @@ + final {{{classname}}}? instance = /* {{{classname}}}(...) */ null; + // TODO add properties to the entity \ No newline at end of file From 01967897a271815373ede59881888d648e7bc801 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:21:20 +0200 Subject: [PATCH 19/31] Add back original files --- ...io-oneof-polymorphism-and-inheritance.yaml | 11 + bin/configs/dart-dio-oneof-primitive.yaml | 11 + bin/configs/dart-dio-oneof.yaml | 11 + ...ore-client-lib-fake-json_serializable.yaml | 12 + .../dart-dio-petstore-client-lib-fake.yaml | 13 + .../languages/AbstractDartCodegen.java | 33 +- .../codegen/languages/DartClientCodegen.java | 36 - .../languages/DartDioClientCodegen.java | 494 ++---- .../dart/dio/DartDioClientCodegenTest.java | 2 +- .../dart/dio/DartDioClientOptionsTest.java | 3 +- .../options/DartDioClientOptionsProvider.java | 1 - pom.xml | 7 +- .../client/petstore/dart-dio/oneof/.gitignore | 41 + .../dart-dio/oneof/.openapi-generator-ignore | 23 + .../dart-dio/oneof/.openapi-generator/FILES | 23 + .../dart-dio/oneof/.openapi-generator/VERSION | 1 + .../client/petstore/dart-dio/oneof/README.md | 84 + .../dart-dio/oneof/analysis_options.yaml | 11 + .../petstore/dart-dio/oneof/doc/Apple.md | 15 + .../petstore/dart-dio/oneof/doc/Banana.md | 15 + .../petstore/dart-dio/oneof/doc/DefaultApi.md | 51 + .../petstore/dart-dio/oneof/doc/Fruit.md | 17 + .../petstore/dart-dio/oneof/lib/openapi.dart | 16 + .../petstore/dart-dio/oneof/lib/src/api.dart | 73 + .../oneof/lib/src/api/default_api.dart | 93 + .../dart-dio/oneof/lib/src/api_util.dart | 77 + .../oneof/lib/src/auth/api_key_auth.dart | 30 + .../dart-dio/oneof/lib/src/auth/auth.dart | 18 + .../oneof/lib/src/auth/basic_auth.dart | 37 + .../oneof/lib/src/auth/bearer_auth.dart | 26 + .../dart-dio/oneof/lib/src/auth/oauth.dart | 26 + .../oneof/lib/src/date_serializer.dart | 31 + .../dart-dio/oneof/lib/src/model/apple.dart | 108 ++ .../dart-dio/oneof/lib/src/model/banana.dart | 108 ++ .../dart-dio/oneof/lib/src/model/date.dart | 70 + .../dart-dio/oneof/lib/src/model/fruit.dart | 123 ++ .../dart-dio/oneof/lib/src/serializers.dart | 36 + .../client/petstore/dart-dio/oneof/pom.xml | 89 + .../petstore/dart-dio/oneof/pubspec.yaml | 19 + .../dart-dio/oneof/test/apple_test.dart | 16 + .../dart-dio/oneof/test/banana_test.dart | 16 + .../dart-dio/oneof/test/default_api_test.dart | 16 + .../dart-dio/oneof/test/fruit_test.dart | 26 + .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 47 + .../.openapi-generator/VERSION | 1 + .../README.md | 99 ++ .../analysis_options.yaml | 11 + .../doc/Addressable.md | 16 + .../doc/Bar.md | 22 + .../doc/BarApi.md | 55 + .../doc/BarCreate.md | 22 + .../doc/BarRef.md | 19 + .../doc/BarRefOrValue.md | 19 + .../doc/Entity.md | 19 + .../doc/EntityRef.md | 21 + .../doc/Extensible.md | 17 + .../doc/Foo.md | 21 + .../doc/FooApi.md | 93 + .../doc/FooRef.md | 20 + .../doc/FooRefOrValue.md | 19 + .../doc/FooRefOrValueWithProperties.md | 19 + .../doc/Pasta.md | 20 + .../doc/Pizza.md | 20 + .../doc/PizzaSpeziale.md | 20 + .../lib/openapi.dart | 28 + .../lib/src/api.dart | 80 + .../lib/src/api/bar_api.dart | 116 ++ .../lib/src/api/foo_api.dart | 190 +++ .../lib/src/api_util.dart | 77 + .../lib/src/auth/api_key_auth.dart | 30 + .../lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../lib/src/auth/oauth.dart | 26 + .../lib/src/date_serializer.dart | 31 + .../lib/src/model/addressable.dart | 161 ++ .../lib/src/model/bar.dart | 219 +++ .../lib/src/model/bar_create.dart | 219 +++ .../lib/src/model/bar_ref.dart | 192 +++ .../lib/src/model/bar_ref_or_value.dart | 129 ++ .../lib/src/model/date.dart | 70 + .../lib/src/model/entity.dart | 298 ++++ .../lib/src/model/entity_ref.dart | 284 +++ .../lib/src/model/extensible.dart | 178 ++ .../lib/src/model/foo.dart | 200 +++ .../lib/src/model/foo_ref.dart | 210 +++ .../lib/src/model/foo_ref_or_value.dart | 129 ++ .../lib/src/model/pasta.dart | 182 ++ .../lib/src/model/pizza.dart | 250 +++ .../lib/src/model/pizza_speziale.dart | 196 +++ .../lib/src/serializers.dart | 67 + .../pom.xml | 88 + .../pubspec.yaml | 19 + .../test/addressable_test.dart | 23 + .../test/bar_api_test.dart | 18 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 41 + .../test/bar_ref_test.dart | 41 + .../test/bar_test.dart | 55 + .../test/entity_ref_test.dart | 53 + .../test/entity_test.dart | 41 + .../test/extensible_test.dart | 29 + .../test/foo_api_test.dart | 25 + .../test/foo_ref_or_value_test.dart | 41 + .../test/foo_ref_test.dart | 46 + .../test/foo_test.dart | 51 + .../test/pasta_test.dart | 46 + .../test/pizza_speziale_test.dart | 46 + .../test/pizza_test.dart | 46 + .../dart-dio/oneof_primitive/.gitignore | 41 + .../oneof_primitive/.openapi-generator-ignore | 23 + .../oneof_primitive/.openapi-generator/FILES | 21 + .../.openapi-generator/VERSION | 1 + .../dart-dio/oneof_primitive/README.md | 83 + .../oneof_primitive/analysis_options.yaml | 11 + .../dart-dio/oneof_primitive/doc/Child.md | 15 + .../oneof_primitive/doc/DefaultApi.md | 51 + .../dart-dio/oneof_primitive/doc/Example.md | 15 + .../dart-dio/oneof_primitive/lib/openapi.dart | 15 + .../dart-dio/oneof_primitive/lib/src/api.dart | 73 + .../lib/src/api/default_api.dart | 93 + .../oneof_primitive/lib/src/api_util.dart | 77 + .../lib/src/auth/api_key_auth.dart | 30 + .../oneof_primitive/lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../oneof_primitive/lib/src/auth/oauth.dart | 26 + .../lib/src/date_serializer.dart | 31 + .../oneof_primitive/lib/src/model/child.dart | 108 ++ .../oneof_primitive/lib/src/model/date.dart | 70 + .../lib/src/model/example.dart | 72 + .../oneof_primitive/lib/src/serializers.dart | 34 + .../petstore/dart-dio/oneof_primitive/pom.xml | 88 + .../dart-dio/oneof_primitive/pubspec.yaml | 19 + .../oneof_primitive/test/child_test.dart | 16 + .../test/default_api_test.dart | 16 + .../oneof_primitive/test/example_test.dart | 16 + .../.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 121 ++ .../.openapi-generator/VERSION | 1 + .../README.md | 204 +++ .../analysis_options.yaml | 12 + .../build.yaml | 18 + .../doc/AdditionalPropertiesClass.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../doc/Animal.md | 16 + .../doc/AnotherFakeApi.md | 57 + .../doc/ApiResponse.md | 17 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../doc/ArrayTest.md | 17 + .../doc/Capitalization.md | 20 + .../doc/Cat.md | 17 + .../doc/CatAllOf.md | 15 + .../doc/Category.md | 16 + .../doc/ClassModel.md | 15 + .../doc/DefaultApi.md | 51 + .../doc/DeprecatedObject.md | 15 + .../doc/Dog.md | 17 + .../doc/DogAllOf.md | 15 + .../doc/EnumArrays.md | 16 + .../doc/EnumTest.md | 22 + .../doc/FakeApi.md | 856 ++++++++++ .../doc/FakeBigDecimalMap200Response.md | 16 + .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../doc/Foo.md | 15 + .../doc/FooGetDefaultResponse.md | 15 + .../doc/FormatTest.md | 30 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../doc/InlineResponseDefault.md | 15 + .../doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../doc/ModelFile.md | 15 + .../doc/ModelList.md | 15 + .../doc/ModelReturn.md | 15 + .../doc/Name.md | 18 + .../doc/NullableClass.md | 26 + .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../doc/Pet.md | 20 + .../doc/PetApi.md | 439 +++++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../doc/StoreApi.md | 188 ++ .../doc/Tag.md | 16 + .../doc/User.md | 22 + .../doc/UserApi.md | 359 ++++ .../lib/openapi.dart | 65 + .../lib/src/api.dart | 110 ++ .../lib/src/api/another_fake_api.dart | 109 ++ .../lib/src/api/default_api.dart | 89 + .../lib/src/api/fake_api.dart | 1450 ++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 116 ++ .../lib/src/api/pet_api.dart | 727 ++++++++ .../lib/src/api/store_api.dart | 303 ++++ .../lib/src/api/user_api.dart | 524 ++++++ .../lib/src/auth/api_key_auth.dart | 30 + .../lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../lib/src/auth/oauth.dart | 26 + .../lib/src/deserialize.dart | 186 ++ .../model/additional_properties_class.dart | 70 + .../lib/src/model/all_of_with_single_ref.dart | 71 + .../lib/src/model/animal.dart | 70 + .../lib/src/model/api_response.dart | 86 + .../model/array_of_array_of_number_only.dart | 54 + .../lib/src/model/array_of_number_only.dart | 54 + .../lib/src/model/array_test.dart | 87 + .../lib/src/model/capitalization.dart | 135 ++ .../lib/src/model/cat.dart | 89 + .../lib/src/model/cat_all_of.dart | 54 + .../lib/src/model/category.dart | 70 + .../lib/src/model/class_model.dart | 54 + .../lib/src/model/deprecated_object.dart | 55 + .../lib/src/model/dog.dart | 89 + .../lib/src/model/dog_all_of.dart | 54 + .../lib/src/model/enum_arrays.dart | 92 + .../lib/src/model/enum_test.dart | 218 +++ .../fake_big_decimal_map200_response.dart | 70 + .../lib/src/model/file_schema_test_class.dart | 71 + .../lib/src/model/foo.dart | 54 + .../src/model/foo_get_default_response.dart | 55 + .../lib/src/model/format_test.dart | 302 ++++ .../lib/src/model/has_only_read_only.dart | 70 + .../lib/src/model/health_check_result.dart | 54 + .../src/model/inline_response_default.dart | 54 + .../lib/src/model/map_test.dart | 113 ++ ...rties_and_additional_properties_class.dart | 87 + .../lib/src/model/model200_response.dart | 70 + .../lib/src/model/model_client.dart | 54 + .../lib/src/model/model_enum_class.dart | 18 + .../lib/src/model/model_file.dart | 55 + .../lib/src/model/model_list.dart | 54 + .../lib/src/model/model_return.dart | 54 + .../lib/src/model/name.dart | 102 ++ .../lib/src/model/nullable_class.dart | 230 +++ .../lib/src/model/number_only.dart | 54 + .../model/object_with_deprecated_fields.dart | 106 ++ .../lib/src/model/order.dart | 148 ++ .../lib/src/model/outer_composite.dart | 86 + .../lib/src/model/outer_enum.dart | 18 + .../src/model/outer_enum_default_value.dart | 18 + .../lib/src/model/outer_enum_integer.dart | 18 + .../outer_enum_integer_default_value.dart | 18 + .../outer_object_with_enum_property.dart | 55 + .../lib/src/model/pet.dart | 150 ++ .../lib/src/model/read_only_first.dart | 70 + .../lib/src/model/single_ref_type.dart | 16 + .../lib/src/model/special_model_name.dart | 54 + .../lib/src/model/tag.dart | 70 + .../lib/src/model/user.dart | 167 ++ .../pom.xml | 88 + .../pubspec.yaml | 16 + .../additional_properties_class_test.dart | 21 + .../test/all_of_with_single_ref_test.dart | 21 + .../test/animal_test.dart | 21 + .../test/another_fake_api_test.dart | 20 + .../test/api_response_test.dart | 26 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/capitalization_test.dart | 42 + .../test/cat_test.dart | 26 + .../test/category_test.dart | 21 + .../test/class_model_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/deprecated_object_test.dart | 16 + .../test/dog_test.dart | 26 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/fake_api_test.dart | 140 ++ ...fake_big_decimal_map200_response_test.dart | 21 + .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_get_default_response_test.dart | 16 + .../test/foo_test.dart | 16 + .../test/format_test_test.dart | 93 + .../test/has_only_read_only_test.dart | 21 + .../test/health_check_result_test.dart | 16 + .../test/map_test_test.dart | 31 + ..._and_additional_properties_class_test.dart | 26 + .../test/model200_response_test.dart | 21 + .../test/model_client_test.dart | 16 + .../test/model_enum_class_test.dart | 9 + .../test/model_file_test.dart | 17 + .../test/model_list_test.dart | 16 + .../test/model_return_test.dart | 16 + .../test/name_test.dart | 31 + .../test/nullable_class_test.dart | 71 + .../test/number_only_test.dart | 16 + .../object_with_deprecated_fields_test.dart | 31 + .../test/order_test.dart | 42 + .../test/outer_composite_test.dart | 26 + .../test/outer_enum_default_value_test.dart | 9 + ...outer_enum_integer_default_value_test.dart | 9 + .../test/outer_enum_integer_test.dart | 9 + .../test/outer_enum_test.dart | 9 + .../outer_object_with_enum_property_test.dart | 16 + .../test/pet_api_test.dart | 92 + .../test/pet_test.dart | 42 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../test/tag_test.dart | 21 + .../test/user_api_test.dart | 83 + .../test/user_test.dart | 52 + .../petstore_client_lib_fake/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 123 ++ .../.openapi-generator/VERSION | 1 + .../petstore_client_lib_fake/README.md | 203 +++ .../analysis_options.yaml | 11 + .../doc/AdditionalPropertiesClass.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../petstore_client_lib_fake/doc/Animal.md | 16 + .../doc/AnotherFakeApi.md | 57 + .../doc/ApiResponse.md | 17 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../petstore_client_lib_fake/doc/ArrayTest.md | 17 + .../doc/Capitalization.md | 20 + .../petstore_client_lib_fake/doc/Cat.md | 17 + .../petstore_client_lib_fake/doc/CatAllOf.md | 15 + .../petstore_client_lib_fake/doc/Category.md | 16 + .../doc/ClassModel.md | 15 + .../doc/DefaultApi.md | 51 + .../doc/DeprecatedObject.md | 15 + .../petstore_client_lib_fake/doc/Dog.md | 17 + .../petstore_client_lib_fake/doc/DogAllOf.md | 15 + .../doc/EnumArrays.md | 16 + .../petstore_client_lib_fake/doc/EnumTest.md | 22 + .../petstore_client_lib_fake/doc/FakeApi.md | 856 ++++++++++ .../doc/FakeBigDecimalMap200Response.md | 16 + .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../petstore_client_lib_fake/doc/Foo.md | 15 + .../doc/FooGetDefaultResponse.md | 15 + .../doc/FormatTest.md | 30 + .../doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../doc/InlineResponseDefault.md | 15 + .../petstore_client_lib_fake/doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../doc/Model200Response.md | 16 + .../doc/ModelClient.md | 15 + .../doc/ModelEnumClass.md | 14 + .../petstore_client_lib_fake/doc/ModelFile.md | 15 + .../petstore_client_lib_fake/doc/ModelList.md | 15 + .../doc/ModelReturn.md | 15 + .../petstore_client_lib_fake/doc/Name.md | 18 + .../doc/NullableClass.md | 26 + .../doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../petstore_client_lib_fake/doc/Order.md | 20 + .../doc/OuterComposite.md | 17 + .../petstore_client_lib_fake/doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../petstore_client_lib_fake/doc/Pet.md | 20 + .../petstore_client_lib_fake/doc/PetApi.md | 439 +++++ .../doc/ReadOnlyFirst.md | 16 + .../doc/SingleRefType.md | 14 + .../doc/SpecialModelName.md | 15 + .../petstore_client_lib_fake/doc/StoreApi.md | 188 ++ .../petstore_client_lib_fake/doc/Tag.md | 16 + .../petstore_client_lib_fake/doc/User.md | 22 + .../petstore_client_lib_fake/doc/UserApi.md | 359 ++++ .../petstore_client_lib_fake/lib/openapi.dart | 66 + .../petstore_client_lib_fake/lib/src/api.dart | 115 ++ .../lib/src/api/another_fake_api.dart | 115 ++ .../lib/src/api/default_api.dart | 93 + .../lib/src/api/fake_api.dart | 1519 +++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 122 ++ .../lib/src/api/pet_api.dart | 765 +++++++++ .../lib/src/api/store_api.dart | 319 ++++ .../lib/src/api/user_api.dart | 539 ++++++ .../lib/src/api_util.dart | 77 + .../lib/src/auth/api_key_auth.dart | 30 + .../lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../lib/src/auth/oauth.dart | 26 + .../lib/src/date_serializer.dart | 31 + .../model/additional_properties_class.dart | 127 ++ .../lib/src/model/all_of_with_single_ref.dart | 128 ++ .../lib/src/model/animal.dart | 205 +++ .../lib/src/model/api_response.dart | 144 ++ .../model/array_of_array_of_number_only.dart | 109 ++ .../lib/src/model/array_of_number_only.dart | 109 ++ .../lib/src/model/array_test.dart | 146 ++ .../lib/src/model/capitalization.dart | 199 +++ .../lib/src/model/cat.dart | 138 ++ .../lib/src/model/cat_all_of.dart | 141 ++ .../lib/src/model/category.dart | 125 ++ .../lib/src/model/class_model.dart | 108 ++ .../lib/src/model/date.dart | 70 + .../lib/src/model/deprecated_object.dart | 109 ++ .../lib/src/model/dog.dart | 138 ++ .../lib/src/model/dog_all_of.dart | 141 ++ .../lib/src/model/enum_arrays.dart | 163 ++ .../lib/src/model/enum_test.dart | 318 ++++ .../fake_big_decimal_map200_response.dart | 127 ++ .../lib/src/model/file_schema_test_class.dart | 128 ++ .../lib/src/model/foo.dart | 109 ++ .../src/model/foo_get_default_response.dart | 109 ++ .../lib/src/model/format_test.dart | 374 ++++ .../lib/src/model/has_only_read_only.dart | 126 ++ .../lib/src/model/health_check_result.dart | 109 ++ .../src/model/inline_response_default.dart | 91 + .../lib/src/model/map_test.dart | 181 ++ ...rties_and_additional_properties_class.dart | 146 ++ .../lib/src/model/model200_response.dart | 126 ++ .../lib/src/model/model_client.dart | 108 ++ .../lib/src/model/model_enum_class.dart | 38 + .../lib/src/model/model_file.dart | 109 ++ .../lib/src/model/model_list.dart | 108 ++ .../lib/src/model/model_return.dart | 108 ++ .../lib/src/model/name.dart | 160 ++ .../lib/src/model/nullable_class.dart | 319 ++++ .../lib/src/model/number_only.dart | 108 ++ .../model/object_with_deprecated_fields.dart | 167 ++ .../lib/src/model/order.dart | 225 +++ .../lib/src/model/outer_composite.dart | 144 ++ .../lib/src/model/outer_enum.dart | 38 + .../src/model/outer_enum_default_value.dart | 38 + .../lib/src/model/outer_enum_integer.dart | 38 + .../outer_enum_integer_default_value.dart | 38 + .../outer_object_with_enum_property.dart | 108 ++ .../lib/src/model/pet.dart | 222 +++ .../lib/src/model/read_only_first.dart | 126 ++ .../lib/src/model/single_ref_type.dart | 36 + .../lib/src/model/special_model_name.dart | 108 ++ .../lib/src/model/tag.dart | 126 ++ .../lib/src/model/user.dart | 235 +++ .../lib/src/serializers.dart | 157 ++ .../dart-dio/petstore_client_lib_fake/pom.xml | 148 ++ .../petstore_client_lib_fake/pubspec.yaml | 19 + .../additional_properties_class_test.dart | 21 + .../test/all_of_with_single_ref_test.dart | 21 + .../test/animal_test.dart | 21 + .../test/another_fake_api_test.dart | 20 + .../test/api_response_test.dart | 26 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/capitalization_test.dart | 42 + .../test/cat_test.dart | 26 + .../test/category_test.dart | 21 + .../test/class_model_test.dart | 16 + .../test/default_api_test.dart | 16 + .../test/deprecated_object_test.dart | 16 + .../test/dog_test.dart | 26 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/fake_api_test.dart | 140 ++ ...fake_big_decimal_map200_response_test.dart | 21 + .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../test/foo_get_default_response_test.dart | 16 + .../test/foo_test.dart | 16 + .../test/format_test_test.dart | 93 + .../test/has_only_read_only_test.dart | 21 + .../test/health_check_result_test.dart | 16 + .../test/map_test_test.dart | 31 + ..._and_additional_properties_class_test.dart | 26 + .../test/model200_response_test.dart | 21 + .../test/model_client_test.dart | 16 + .../test/model_enum_class_test.dart | 9 + .../test/model_file_test.dart | 17 + .../test/model_list_test.dart | 16 + .../test/model_return_test.dart | 16 + .../test/name_test.dart | 31 + .../test/nullable_class_test.dart | 71 + .../test/number_only_test.dart | 16 + .../object_with_deprecated_fields_test.dart | 31 + .../test/order_test.dart | 42 + .../test/outer_composite_test.dart | 26 + .../test/outer_enum_default_value_test.dart | 9 + ...outer_enum_integer_default_value_test.dart | 9 + .../test/outer_enum_integer_test.dart | 9 + .../test/outer_enum_test.dart | 9 + .../outer_object_with_enum_property_test.dart | 16 + .../test/pet_api_test.dart | 92 + .../test/pet_test.dart | 42 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../test/tag_test.dart | 21 + .../test/user_api_test.dart | 83 + .../test/user_test.dart | 52 + .../petstore_client_lib_fake_tests/.gitignore | 1 + .../petstore_client_lib_fake_tests/README.md | 6 + .../analysis_options.yaml | 9 + .../pubspec.yaml | 18 + .../petstore_client_lib_fake_tests/puby.yaml | 3 + .../test/api/authentication_test.dart | 92 + .../test/api/fake_api_test.dart | 193 +++ .../test/api/pet_api_test.dart | 298 ++++ .../test/api/store_api_test.dart | 37 + .../test/api_util_test.dart | 348 ++++ .../test/model/date_serializer_test.dart | 31 + .../test/model/date_test.dart | 25 + 523 files changed, 37570 insertions(+), 414 deletions(-) create mode 100644 bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml create mode 100644 bin/configs/dart-dio-oneof-primitive.yaml create mode 100644 bin/configs/dart-dio-oneof.yaml create mode 100644 bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml create mode 100644 bin/configs/dart-dio-petstore-client-lib-fake.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/pom.xml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeBigDecimalMap200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_big_decimal_map200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart diff --git a/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml new file mode 100644 index 000000000000..d3d5b622bc0f --- /dev/null +++ b/bin/configs/dart-dio-oneof-polymorphism-and-inheritance.yaml @@ -0,0 +1,11 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof-primitive.yaml b/bin/configs/dart-dio-oneof-primitive.yaml new file mode 100644 index 000000000000..29130b5dc468 --- /dev/null +++ b/bin/configs/dart-dio-oneof-primitive.yaml @@ -0,0 +1,11 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof_primitive +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-oneof.yaml b/bin/configs/dart-dio-oneof.yaml new file mode 100644 index 000000000000..865312cdd493 --- /dev/null +++ b/bin/configs/dart-dio-oneof.yaml @@ -0,0 +1,11 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/oneof +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOf.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" diff --git a/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml b/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml new file mode 100644 index 000000000000..9809a61d7a00 --- /dev/null +++ b/bin/configs/dart-dio-petstore-client-lib-fake-json_serializable.yaml @@ -0,0 +1,12 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" + serializationLibrary: "json_serializable" diff --git a/bin/configs/dart-dio-petstore-client-lib-fake.yaml b/bin/configs/dart-dio-petstore-client-lib-fake.yaml new file mode 100644 index 000000000000..3faed9515af8 --- /dev/null +++ b/bin/configs/dart-dio-petstore-client-lib-fake.yaml @@ -0,0 +1,13 @@ +generatorName: dart-dio +outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio +typeMappings: + Client: "ModelClient" + File: "ModelFile" + EnumClass: "ModelEnumClass" +additionalProperties: + hideGenerationTimestamp: "true" + enumUnknownDefaultCase: "true" +reservedWordsMappings: + class: "classField" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 91798df50af8..51a8b4bdeae8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -500,7 +500,7 @@ public String toDefaultValue(Schema schema) { return null; } if (ModelUtils.isStringSchema(schema)) { - return "r'" + schema.getDefault().toString().replace("'", "\\'") + "'"; + return "'" + schema.getDefault().toString().replace("'", "\\'") + "'"; } return schema.getDefault().toString(); } @@ -602,6 +602,35 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) { return property; } + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { + final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + for (CodegenResponse r : op.responses) { + // By default, only set types are automatically added to operation imports, not sure why. + // Add all container type imports here, by default 'dart:core' imports are skipped + // but other sub-classes may require specific container type imports. + if (r.containerType != null && typeMapping().containsKey(r.containerType)) { + final String value = typeMapping().get(r.containerType); + if (needToImport(value)) { + op.imports.add(value); + } + } + } + for (CodegenParameter p : op.allParams) { + if (p.isContainer) { + final String type = p.isArray ? "array" : "map"; + if (typeMapping().containsKey(type)) { + final String value = typeMapping().get(type); + // Also add container imports for parameters. + if (needToImport(value)) { + op.imports.add(value); + } + } + } + } + return op; + } + @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { super.postProcessOperationsWithModels(objs, allModels); @@ -704,7 +733,7 @@ public String toEnumValue(String value, String datatype) { "int".equalsIgnoreCase(datatype)) { return value; } else { - return "r'" + escapeText(value) + "'"; + return "'" + escapeText(value) + "'"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index fa52316dd11d..40edd69ed377 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -19,18 +19,11 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenResponse; import org.openapitools.codegen.SupportingFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.servers.Server; - import java.util.HashMap; -import java.util.List; import java.util.Map; public class DartClientCodegen extends AbstractDartCodegen { @@ -54,35 +47,6 @@ public DartClientCodegen() { sourceFolder = ""; } - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { - final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - for (CodegenResponse r : op.responses) { - // By default, only set types are automatically added to operation imports, not sure why. - // Add all container type imports here, by default 'dart:core' imports are skipped - // but other sub-classes may require specific container type imports. - if (r.containerType != null && typeMapping().containsKey(r.containerType)) { - final String value = typeMapping().get(r.containerType); - if (needToImport(value)) { - op.imports.add(value); - } - } - } - for (CodegenParameter p : op.allParams) { - if (p.isContainer) { - final String type = p.isArray ? "array" : "map"; - if (typeMapping().containsKey(type)) { - final String value = typeMapping().get(type); - // Also add container imports for parameters. - if (needToImport(value)) { - op.imports.add(value); - } - } - } - } - return op; - } - @Override public void processOpts() { super.processOpts(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 588b82b84c08..dc71ca39d35e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -16,33 +16,16 @@ package org.openapitools.codegen.languages; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - +import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.Discriminator; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenDiscriminator; +import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.TemplateManager; import org.openapitools.codegen.api.TemplatePathLocator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.meta.GeneratorMetadata; @@ -62,13 +45,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Sets; -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; +import java.io.File; +import java.util.*; +import java.util.stream.Collectors; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Discriminator; -import io.swagger.v3.oas.models.media.Schema; +import static org.openapitools.codegen.utils.StringUtils.underscore; public class DartDioClientCodegen extends AbstractDartCodegen { @@ -83,10 +64,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; - public static final String NETWORKING_LIBRARY_DIO = "dio"; - public static final String NETWORKING_LIBRARY_HTTP = "http"; - public static final String NETWORKING_LIBRARY_DEFAULT = NETWORKING_LIBRARY_DIO; - private static final String DIO_IMPORT = "package:dio/dio.dart"; public static final String FINAL_PROPERTIES = "finalProperties"; public static final String FINAL_PROPERTIES_DEFAULT_VALUE = "true"; @@ -95,65 +72,52 @@ public class DartDioClientCodegen extends AbstractDartCodegen { private String dateLibrary; - private String serializationLibrary; - private String clientName; private TemplateManager templateManager; - private Map supportedSerializationLibraries = new LinkedHashMap<>(); - public DartDioClientCodegen() { super(); modifyFeatureSet(features -> features .includeClientModificationFeatures( ClientModificationFeature.Authorizations, - ClientModificationFeature.UserAgent) - .includeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism, - SchemaSupportFeature.Union, - SchemaSupportFeature.Composite, - SchemaSupportFeature.allOf, - SchemaSupportFeature.oneOf, - SchemaSupportFeature.anyOf)); + ClientModificationFeature.UserAgent + ).includeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.Union, + SchemaSupportFeature.Composite, + SchemaSupportFeature.allOf, + SchemaSupportFeature.oneOf, + SchemaSupportFeature.anyOf + ) + ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.STABLE) .build(); outputFolder = "generated-code/dart-dio"; - embeddedTemplateDir = "dart"; + embeddedTemplateDir = "dart/libraries/dio"; this.setTemplateDir(embeddedTemplateDir); - supportedLibraries.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] dio"); - supportedLibraries.put(NETWORKING_LIBRARY_HTTP, "[BETA] http"); - final CliOption networkingLibraryOptions = CliOption.newString(CodegenConstants.LIBRARY, - "Specify networking library"); - networkingLibraryOptions.setEnum(supportedLibraries); - networkingLibraryOptions.setDefault(NETWORKING_LIBRARY_DEFAULT); - cliOptions.add(networkingLibraryOptions); - - supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); - supportedSerializationLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); - final CliOption serializationLibraryOptions = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, - "Specify serialization library"); - serializationLibraryOptions.setEnum(supportedSerializationLibraries); - serializationLibraryOptions.setDefault(SERIALIZATION_LIBRARY_DEFAULT); - cliOptions.add(serializationLibraryOptions); + supportedLibraries.put(SERIALIZATION_LIBRARY_BUILT_VALUE, "[DEFAULT] built_value"); + supportedLibraries.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "[BETA] json_serializable"); + final CliOption serializationLibrary = CliOption.newString(CodegenConstants.SERIALIZATION_LIBRARY, "Specify serialization library"); + serializationLibrary.setEnum(supportedLibraries); + serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); + cliOptions.add(serializationLibrary); // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); dateOption.setDefault(DATE_LIBRARY_DEFAULT); - final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, - "Whether properties are marked as final when using Json Serializable for serialization"); + final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization"); finalProperties.setDefault("true"); cliOptions.add(finalProperties); final Map dateOptions = new HashMap<>(); dateOptions.put(DATE_LIBRARY_CORE, "[DEFAULT] Dart core library (DateTime)"); - dateOptions.put(DATE_LIBRARY_TIME_MACHINE, - "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); + dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); } @@ -166,31 +130,6 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } - public String getSerializationLibrary() { - return serializationLibrary; - } - - /** - * Set serialization library template. - * - * @param serializationLibrary Serialization Library template - */ - public void setSerializationLibrary(String serializationLibrary) { - if (serializationLibrary != null && !supportedSerializationLibraries.containsKey(serializationLibrary)) { - StringBuilder sb = new StringBuilder( - "Unknown serialization library: " + serializationLibrary + "\nAvailable serialization libraries:"); - if (supportedSerializationLibraries.size() == 0) { - sb.append("\n ").append("NONE"); - } else { - for (String lib : supportedSerializationLibraries.keySet()) { - sb.append("\n ").append(lib); - } - } - throw new RuntimeException(sb.toString()); - } - this.serializationLibrary = serializationLibrary; - } - public String getClientName() { return clientName; } @@ -214,24 +153,16 @@ public void processOpts() { super.processOpts(); if (StringUtils.isEmpty(System.getenv("DART_POST_PROCESS_FILE"))) { - LOGGER.info( - "Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); - LOGGER.info( - "NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - if (!additionalProperties.containsKey(CodegenConstants.LIBRARY)) { - additionalProperties.put(CodegenConstants.LIBRARY, NETWORKING_LIBRARY_DEFAULT); - LOGGER.debug("Networking library not set, using default {}", NETWORKING_LIBRARY_DEFAULT); + LOGGER.info("Environment variable DART_POST_PROCESS_FILE not defined so the Dart code may not be properly formatted. To define it, try `export DART_POST_PROCESS_FILE=\"/usr/local/bin/dartfmt -w\"` (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } - setLibrary(additionalProperties.get(CodegenConstants.LIBRARY).toString()); if (!additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DEFAULT); LOGGER.debug("Serialization library not set, using default {}", SERIALIZATION_LIBRARY_DEFAULT); } - setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + setLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { this.setLegacyDiscriminatorBehavior(false); } @@ -244,9 +175,9 @@ public void processOpts() { if (!additionalProperties.containsKey(FINAL_PROPERTIES)) { additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(FINAL_PROPERTIES_DEFAULT_VALUE)); LOGGER.debug("finalProperties not set, using default {}", FINAL_PROPERTIES_DEFAULT_VALUE); - } else { - additionalProperties.put(FINAL_PROPERTIES, - Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString())); + } + else { + additionalProperties.put(FINAL_PROPERTIES, Boolean.parseBoolean(additionalProperties.get(FINAL_PROPERTIES).toString())); } if (!additionalProperties.containsKey(CLIENT_NAME)) { @@ -261,81 +192,24 @@ public void processOpts() { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("lib_api_exports.mustache", libPath, "apis.dart")); - supportingFiles.add(new SupportingFile("lib_model_exports.mustache", libPath, "models.dart")); supportingFiles.add(new SupportingFile("lib.mustache", libPath, pubName + ".dart")); final String srcFolder = libPath + sourceFolder; - supportingFiles - .add(new SupportingFile("serialization/repository_base.mustache", srcFolder, "repository_base.dart")); - - configureNetworkingLibrary(srcFolder); - configureSerializationLibrary(srcFolder); - configureDateLibrary(srcFolder); - } - - private void configureNetworkingLibrary(String sourceFolder) { - switch (library) { - case NETWORKING_LIBRARY_DIO: - additionalProperties.put("useDio", "true"); - configureNetworkingLibraryDio(sourceFolder); - break; - default: - case NETWORKING_LIBRARY_HTTP: - additionalProperties.put("useHttp", "true"); - configureNetworkingLibraryHttp(sourceFolder); - break; - } - - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), - isSkipOverwrite()); - TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); - TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); - templateManager = new TemplateManager( - templateManagerOptions, - getTemplatingEngine(), - new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator }); - - // A lambda which allows for easy includes of serialization library specific - // templates without having to change the main template files. - additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { - MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); - String templateFile = "libraries/" + library + "/" + fragment.execute() + ".mustache"; - Template tmpl = engine.getCompiler() - .withLoader(name -> engine.findTemplate(templateManager, name)) - .defaultValue("") - .compile(templateManager.getFullTemplateContents(templateFile)); - - fragment.executeTemplate(tmpl, writer); - }); - } + supportingFiles.add(new SupportingFile("api_client.mustache", srcFolder, "api.dart")); - private void configureNetworkingLibraryDio(String srcFolder) { - imports.put("MultipartFile", DIO_IMPORT); - final String dioMustacheFolder = "libraries/dio/"; - supportingFiles - .add(new SupportingFile(dioMustacheFolder + "api_client.mustache", srcFolder, "api_client.dart")); - supportingFiles.add(new SupportingFile(dioMustacheFolder + "api_util.mustache", srcFolder, "api_util.dart")); final String authFolder = srcFolder + File.separator + "auth"; - final String authMustacheFolder = dioMustacheFolder + "auth/"; - supportingFiles - .add(new SupportingFile(authMustacheFolder + "auth_exports.mustache", authFolder, "_exports.dart")); - supportingFiles - .add(new SupportingFile(authMustacheFolder + "api_key_auth.mustache", authFolder, "api_key_auth.dart")); - supportingFiles - .add(new SupportingFile(authMustacheFolder + "basic_auth.mustache", authFolder, "basic_auth.dart")); - supportingFiles - .add(new SupportingFile(authMustacheFolder + "bearer_auth.mustache", authFolder, "bearer_auth.dart")); - supportingFiles.add(new SupportingFile(authMustacheFolder + "oauth.mustache", authFolder, "oauth.dart")); - supportingFiles.add(new SupportingFile(authMustacheFolder + "auth.mustache", authFolder, "auth.dart")); - } - - private void configureNetworkingLibraryHttp(String srcFolder) { + supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); + supportingFiles.add(new SupportingFile("auth/basic_auth.mustache", authFolder, "basic_auth.dart")); + supportingFiles.add(new SupportingFile("auth/bearer_auth.mustache", authFolder, "bearer_auth.dart")); + supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); + supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); + configureSerializationLibrary(srcFolder); + configureDateLibrary(srcFolder); } private void configureSerializationLibrary(String srcFolder) { - switch (serializationLibrary) { + switch (library) { case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE: additionalProperties.put("useJsonSerializable", "true"); configureSerializationLibraryJsonSerializable(srcFolder); @@ -347,20 +221,20 @@ private void configureSerializationLibrary(String srcFolder) { break; } - TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), - isSkipOverwrite()); + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(isEnableMinimalUpdate(), isSkipOverwrite()); TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); templateManager = new TemplateManager( templateManagerOptions, getTemplatingEngine(), - new TemplatePathLocator[] { generatorTemplateLocator, commonTemplateLocator }); + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); // A lambda which allows for easy includes of serialization library specific // templates without having to change the main template files. - additionalProperties.put("includeSerializationTemplate", (Mustache.Lambda) (fragment, writer) -> { + additionalProperties.put("includeLibraryTemplate", (Mustache.Lambda) (fragment, writer) -> { MustacheEngineAdapter engine = ((MustacheEngineAdapter) getTemplatingEngine()); - String templateFile = "serialization/" + serializationLibrary + "/" + fragment.execute() + ".mustache"; + String templateFile = "serialization/" + library + "/" + fragment.execute() + ".mustache"; Template tmpl = engine.getCompiler() .withLoader(name -> engine.findTemplate(templateManager, name)) .defaultValue("") @@ -371,10 +245,8 @@ private void configureSerializationLibrary(String srcFolder) { } private void configureSerializationLibraryBuiltValue(String srcFolder) { - supportingFiles.add(new SupportingFile("serialization/built_value/repository_impl.mustache", srcFolder, - "repository_impl.dart")); - supportingFiles.add( - new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/serializers.mustache", srcFolder, "serializers.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/api_util.mustache", srcFolder, "api_util.dart")); typeMapping.put("Array", "BuiltList"); typeMapping.put("array", "BuiltList"); @@ -391,18 +263,19 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { imports.put("BuiltMap", "package:built_collection/built_collection.dart"); imports.put("JsonObject", "package:built_value/json_object.dart"); imports.put("Uint8List", "dart:typed_data"); + imports.put("MultipartFile", DIO_IMPORT); } private void configureSerializationLibraryJsonSerializable(String srcFolder) { - supportingFiles.add(new SupportingFile("serialization/json_serializable/repository_impl.mustache", srcFolder, - "repository_impl.dart")); - supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", - "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/build.yaml.mustache", "" /* main project dir */, "build.yaml")); + supportingFiles.add(new SupportingFile("serialization/json_serializable/deserialize.mustache", srcFolder, + "deserialize.dart")); // most of these are defined in AbstractDartCodegen, we are overriding // just the binary / file handling languageSpecificPrimitives.add("Object"); imports.put("Uint8List", "dart:typed_data"); + imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { @@ -415,23 +288,19 @@ private void configureDateLibrary(String srcFolder) { typeMapping.put("datetime", "OffsetDateTime"); imports.put("OffsetDate", "package:time_machine/time_machine.dart"); imports.put("OffsetDateTime", "package:time_machine/time_machine.dart"); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { - supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", - srcFolder, "local_date_serializer.dart")); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart")); } break; default: case DATE_LIBRARY_CORE: additionalProperties.put("useDateLibCore", "true"); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { typeMapping.put("date", "Date"); typeMapping.put("Date", "Date"); - importMapping.put("Date", - "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); - supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", - srcFolder + File.separator + modelPackage(), "date.dart")); - supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", - srcFolder, "date_serializer.dart")); + importMapping.put("Date", "package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/date.dart"); + supportingFiles.add(new SupportingFile("serialization/built_value/date.mustache", srcFolder + File.separator + modelPackage(), "date.dart")); + supportingFiles.add(new SupportingFile("serialization/built_value/date_serializer.mustache", srcFolder, "date_serializer.dart")); } break; } @@ -440,10 +309,7 @@ private void configureDateLibrary(String srcFolder) { @Override public String toDefaultValue(Schema schema) { if (schema.getDefault() != null) { - if (schema.getEnum() != null) { - return super.toDefaultValue(schema); - } - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { if (ModelUtils.isArraySchema(schema)) { if (ModelUtils.isSet(schema)) { return "SetBuilder()"; @@ -454,7 +320,6 @@ public String toDefaultValue(Schema schema) { return "MapBuilder()"; } } - if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) { // this is currently not supported and would create compile errors return null; @@ -467,48 +332,6 @@ public String toDefaultValue(Schema schema) { return null; } - @Override - public String toDefaultParameterValue(Schema schema) { - var result = super.toDefaultParameterValue(schema); - return result; - } - - @Override - public void updateCodegenPropertyEnum(CodegenProperty var) { - super.updateCodegenPropertyEnum(var); - var enumName = var.getEnumName(); - if (enumName != null) { - if (var.defaultValue != null) { - var allowable = var.getAllowableValues(); - if (allowable != null) { - var matchingMap = (ArrayList) allowable.get("enumVars"); - String matchingName = null; - for (Object enumMember : matchingMap) { - if (!(enumMember instanceof HashMap)) { - continue; - } - var castedEnumMember = (HashMap) enumMember; - var name = (String) castedEnumMember.get("name"); - var value = castedEnumMember.get("value"); - if (value.equals(var.defaultValue)) { - matchingName = name; - break; - } - } - if (matchingName != null) { - var newDefaultValue = enumName + "." + matchingName; - var oldDefaultValue = var.getDefaultValue(); - LOGGER.info("Modifying enum {} with default value {} to {}", enumName, oldDefaultValue, - newDefaultValue); - var.setDefaultValue(newDefaultValue); - } - } - - } - } - } - - @Override public ModelsMap postProcessModels(ModelsMap objs) { objs = super.postProcessModels(objs); @@ -545,17 +368,6 @@ private void syncRootTypesWithInnerVars(Map objs) { syncRootTypesWithInnerVars(allModels, model); } } - - @Override - public CodegenProperty fromProperty(String name, Schema p, boolean required, - boolean schemaIsFromAdditionalProperties) { - CodegenProperty result = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties); - if (result.containerType != null && typeMapping.containsKey(result.containerType)) { - result.containerType = typeMapping.get(result.containerType); - } - return result; - } - private void syncRootTypesWithInnerVars(Map objs, CodegenModel model) { List allVars = new ArrayList<>(); allVars.addAll(((Collection) model.vendorExtensions.get(kSelfAndAncestorOnlyProps))); @@ -563,19 +375,18 @@ private void syncRootTypesWithInnerVars(Map objs, CodegenM allVars.addAll(((Collection) model.vendorExtensions.get(kAncestorOnlyProps))); for (CodegenProperty prop : allVars) { - // check if type exists in parent map + //check if type exists in parent map String type = prop.openApiType; if (objs.containsKey(type)) { - // get the type + //get the type CodegenModel relatedModel = objs.get(type); - // fill the property's VendorExtensions with the type's VendorExtensions + //fill the property's VendorExtensions with the type's VendorExtensions prop.getVendorExtensions().put(kIsParent, relatedModel.getVendorExtensions().get(kIsParent)); prop.isEnum = relatedModel.isEnum; } } } - private final String kIsChild = "x-is-child"; private final String kIsParent = "x-is-parent"; private final String kIsPure = "x-is-pure"; @@ -614,6 +425,8 @@ private void adaptToDartInheritance(Map objs) { allAncestorsForAllModelsFlat.addAll(allAncestors); } + + Set allPureClasses = new HashSet<>(); // set isChild,isParent,isPure for (java.util.Map.Entry cmEntry : allModels.entrySet()) { @@ -634,10 +447,10 @@ private void adaptToDartInheritance(Map objs) { cm.vendorExtensions.put(kIsParent, isParent); cm.vendorExtensions.put(kIsPure, isPure); if (!isParent && (cm.oneOf == null || cm.oneOf.isEmpty())) { - // discriminator has no meaning here - if (cm.discriminator != null) { + //discriminator has no meaning here + if (cm.discriminator!=null) { cm.vendorExtensions.put(kParentDiscriminator, cm.discriminator); - cm.discriminator = null; + cm.discriminator=null; } } @@ -734,20 +547,19 @@ private void adaptToDartInheritance(Map objs) { } /// override the default behavior of createDiscriminator - /// to remove extra mappings added as a side effect of - /// setLegacyDiscriminatorBehavior(false) + /// to remove extra mappings added as a side effect of setLegacyDiscriminatorBehavior(false) /// this ensures 1-1 schema mapping instead of 1-many @Override protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema, openAPI); Discriminator originalDiscriminator = schema.getDiscriminator(); - if (originalDiscriminator != null) { - Map originalMapping = originalDiscriminator.getMapping(); + if (originalDiscriminator!=null) { + Map originalMapping = originalDiscriminator.getMapping(); if (originalMapping != null && !originalMapping.isEmpty()) { - // we already have a discriminator mapping, remove everything else + //we already have a discriminator mapping, remove everything else for (MappedModel currentMappings : new HashSet<>(sub.getMappedModels())) { if (originalMapping.containsKey(currentMappings.getMappingName())) { - // all good + //all good } else { sub.getMapping().remove(currentMappings.getMappingName()); sub.getMappedModels().remove(currentMappings); @@ -761,7 +573,7 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch @Override public Map postProcessAllModels(Map objs) { objs = super.postProcessAllModels(objs); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { adaptToDartInheritance(objs); syncRootTypesWithInnerVars(objs); } @@ -781,7 +593,7 @@ public Map postProcessAllModels(Map objs) @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { if (property.isEnum && property.getComposedSchemas() == null) { // enums are generated with built_value and make use of BuiltSet model.imports.add("BuiltSet"); @@ -792,7 +604,13 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // that need a custom serializer builder factory added. final CodegenProperty items = property.items; if (items.getAdditionalProperties() != null) { - addBuiltValueSerializer(BuiltValueSerializer.fromCodegenProperty(items)); + addBuiltValueSerializer(new BuiltValueSerializer( + items.isArray, + items.getUniqueItems(), + items.isMap, + items.items.isNullable, + items.getAdditionalProperties().dataType + )); } } } @@ -807,18 +625,14 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List resultImports = new HashSet<>(); for (CodegenOperation op : operationList) { - for (CodegenParameter param : Stream.of(op.allParams, op.bodyParams, op.formParams) - .flatMap(Collection::stream) - .collect(Collectors.toList())) { + for (CodegenParameter param : op.allParams) { if (((op.isMultipart && param.isFormParam) || param.isBodyParam) && (param.isBinary || param.isFile)) { param.dataType = param.dataType.replace("Uint8List", "MultipartFile"); - // param.containerType = param.containerType.replace("Uint8List", - // "MultipartFile"); + param.baseType = param.baseType.replace("Uint8List", "MultipartFile"); op.imports.add("MultipartFile"); - if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(serializationLibrary)) { - boolean skipFormModel = Boolean - .parseBoolean(GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL, "true")); + if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) { + boolean skipFormModel = Boolean.parseBoolean(GlobalSettings.getProperty(CodegenConstants.SKIP_FORM_MODEL, "true")); if (param.isFormParam && param.isContainer && !skipFormModel) { // Because of skipFormModel=false, there is a model class generated which has // "BuiltList" as property and it requires the correct @@ -827,8 +641,8 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List rewriteImports(Set originalImports, boolean isModel) } else if (modelImport.startsWith("package:")) { // e.g. package:openapi/src/model/child.dart resultImports.add(modelImport); } else { - resultImports.add("package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/" - + underscore(modelImport) + ".dart"); + resultImports.add("package:" + pubName + "/" + sourceFolder + "/" + modelPackage() + "/" + underscore(modelImport) + ".dart"); } } return resultImports; } static class BuiltValueSerializer { - final String containerType; - final boolean isContainer; + final boolean isArray; + final boolean uniqueItems; + final boolean isMap; - final BuiltValueSerializer items; + final boolean isNullable; - final String datatypeWithEnum; final String dataType; - public static BuiltValueSerializer fromCodegenParameter(CodegenParameter parameter) { - if (parameter == null) { - return null; - } - return new BuiltValueSerializer(parameter.isArray, parameter.getUniqueItems(), parameter.getIsMap(), - /// Recursion to handle subtypes - fromCodegenProperty(parameter.items), - parameter.isNullable, parameter.datatypeWithEnum, parameter.dataType, parameter.containerType, - parameter.isContainer); - } - - public static BuiltValueSerializer fromCodegenProperty(CodegenProperty property) { - if (property == null) { - return null; - } - return new BuiltValueSerializer(property.isArray, property.getUniqueItems(), property.getIsMap(), - /// Recursion to handle subtypes - fromCodegenProperty(property.items), - property.isNullable, property.datatypeWithEnum, property.dataType, property.containerType, - property.isContainer); - } - - private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, BuiltValueSerializer items, - boolean isNullable, String datatypeWithEnum, String dataType, String containerType, - boolean isContainer) { + private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, String dataType) { this.isArray = isArray; this.uniqueItems = uniqueItems; this.isMap = isMap; - this.items = items; this.isNullable = isNullable; - this.datatypeWithEnum = datatypeWithEnum; this.dataType = dataType; - this.containerType = containerType; - this.isContainer = isContainer; - } - - public boolean isContainer() { - return isContainer; } public boolean isArray() { @@ -981,67 +777,25 @@ public boolean isMap() { return isMap; } - public BuiltValueSerializer getItems() { - return items; - } - public boolean isNullable() { return isNullable; } - public String getDatatypeWithEnum() { - return datatypeWithEnum; - } - - public String getContainerType() { - return containerType; - } - public String getDataType() { return dataType; } @Override - public int hashCode() { - return Objects.hash(isContainer, isArray, uniqueItems, isMap, items, isNullable, datatypeWithEnum, - dataType); + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BuiltValueSerializer that = (BuiltValueSerializer) o; + return isArray == that.isArray && uniqueItems == that.uniqueItems && isMap == that.isMap && isNullable == that.isNullable && dataType.equals(that.dataType); } @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - BuiltValueSerializer other = (BuiltValueSerializer) obj; - if (isContainer != other.isContainer) - return false; - if (isArray != other.isArray) - return false; - if (uniqueItems != other.uniqueItems) - return false; - if (isMap != other.isMap) - return false; - if (items == null) { - if (other.items != null) - return false; - } else if (!items.equals(other.items)) - return false; - if (isNullable != other.isNullable) - return false; - if (datatypeWithEnum == null) { - if (other.datatypeWithEnum != null) - return false; - } else if (!datatypeWithEnum.equals(other.datatypeWithEnum)) - return false; - if (dataType == null) { - if (other.dataType != null) - return false; - } else if (!dataType.equals(other.dataType)) - return false; - return true; + public int hashCode() { + return Objects.hash(isArray, uniqueItems, isMap, isNullable, dataType); } } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java index 6bd4b3685bb0..1967ceb66724 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientCodegenTest.java @@ -121,6 +121,6 @@ public void verifyDartDioGeneratorRuns() throws IOException { files.forEach(File::deleteOnExit); TestUtils.ensureContainsFile(files, output, "README.md"); - TestUtils.ensureContainsFile(files, output, "lib/apis.dart"); + TestUtils.ensureContainsFile(files, output, "lib/src/api.dart"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index f457de7c81d5..23eee3fd2a2c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -52,8 +52,7 @@ protected void verifyOptions() { verify(clientCodegen).setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); - verify(clientCodegen).setLibrary(DartDioClientCodegen.NETWORKING_LIBRARY_DEFAULT); - verify(clientCodegen).setSerializationLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index 2015a52a1360..60cb35293226 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -61,7 +61,6 @@ public Map createOptions() { .put(DartDioClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(DartDioClientCodegen.PUB_REPOSITORY, PUB_REPOSITORY_VALUE) .put(DartDioClientCodegen.PUB_PUBLISH_TO, PUB_PUBLISH_TO_VALUE) - .put(CodegenConstants.LIBRARY, DartDioClientCodegen.NETWORKING_LIBRARY_DEFAULT) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT) .put(DartDioClientCodegen.FINAL_PROPERTIES, DartDioClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) diff --git a/pom.xml b/pom.xml index dda803807394..5536194bdfe9 100644 --- a/pom.xml +++ b/pom.xml @@ -1323,8 +1323,11 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib - samples/openapi3/client/petstore/dart-dio/dio/built_value - samples/openapi3/client/petstore/dart-dio/dio/json_serializable + samples/openapi3/client/petstore/dart-dio/oneof + samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance + samples/openapi3/client/petstore/dart-dio/oneof_primitive + samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake + samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable samples/openapi3/client/petstore/dart-next/dio/built_value samples/openapi3/client/petstore/dart-next/dio/json_serializable diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES new file mode 100644 index 000000000000..f1ab7b5540a3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +README.md +analysis_options.yaml +doc/Apple.md +doc/Banana.md +doc/DefaultApi.md +doc/Fruit.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/apple.dart +lib/src/model/banana.dart +lib/src/model/date.dart +lib/src/model/fruit.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/README.md b/samples/openapi3/client/petstore/dart-dio/oneof/README.md new file mode 100644 index 000000000000..756dc48f59ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/README.md @@ -0,0 +1,84 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getDefaultApi(); + +try { + final response = await api.rootGet(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->rootGet: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**rootGet**](doc/DefaultApi.md#rootget) | **GET** / | + + +## Documentation For Models + + - [Apple](doc/Apple.md) + - [Banana](doc/Banana.md) + - [Fruit](doc/Fruit.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml new file mode 100644 index 000000000000..139ad7abf559 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md new file mode 100644 index 000000000000..b010661371f9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/DefaultApi.md @@ -0,0 +1,51 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**rootGet**](DefaultApi.md#rootget) | **GET** / | + + +# **rootGet** +> Fruit rootGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.rootGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->rootGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart new file mode 100644 index 000000000000..d85a16fc6ad9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/openapi.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/default_api.dart'; + +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/fruit.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart new file mode 100644 index 000000000000..dfd8e847bdd9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/default_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost'; + + final Dio dio; + final Serializers serializers; + + Openapi({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio, serializers); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart new file mode 100644 index 000000000000..797199ae1740 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api/default_api.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/fruit.dart'; + +class DefaultApi { + + final Dio _dio; + + final Serializers _serializers; + + const DefaultApi(this._dio, this._serializers); + + /// rootGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioException] if API call or serialization fails + Future> rootGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Fruit? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Fruit), + ) as Fruit; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart new file mode 100644 index 000000000000..02ca94190b96 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/apple.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'apple.g.dart'; + +/// Apple +/// +/// Properties: +/// * [kind] +@BuiltValue() +abstract class Apple implements Built { + @BuiltValueField(wireName: r'kind') + String? get kind; + + Apple._(); + + factory Apple([void updates(AppleBuilder b)]) = _$Apple; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AppleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AppleSerializer(); +} + +class _$AppleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Apple, _$Apple]; + + @override + final String wireName = r'Apple'; + + Iterable _serializeProperties( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.kind != null) { + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Apple object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AppleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'kind': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.kind = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Apple deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AppleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart new file mode 100644 index 000000000000..bf2d632ee114 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/banana.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'banana.g.dart'; + +/// Banana +/// +/// Properties: +/// * [count] +@BuiltValue() +abstract class Banana implements Built { + @BuiltValueField(wireName: r'count') + num? get count; + + Banana._(); + + factory Banana([void updates(BananaBuilder b)]) = _$Banana; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BananaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BananaSerializer(); +} + +class _$BananaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Banana, _$Banana]; + + @override + final String wireName = r'Banana'; + + Iterable _serializeProperties( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.count != null) { + yield r'count'; + yield serializers.serialize( + object.count, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Banana object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BananaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'count': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.count = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Banana deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BananaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart new file mode 100644 index 000000000000..11f8cfa70501 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/model/fruit.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'fruit.g.dart'; + +/// Fruit +/// +/// Properties: +/// * [color] +/// * [kind] +/// * [count] +@BuiltValue() +abstract class Fruit implements Built { + @BuiltValueField(wireName: r'color') + String? get color; + + /// One Of [Apple], [Banana] + OneOf get oneOf; + + Fruit._(); + + factory Fruit([void updates(FruitBuilder b)]) = _$Fruit; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FruitBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FruitSerializer(); +} + +class _$FruitSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Fruit, _$Fruit]; + + @override + final String wireName = r'Fruit'; + + Iterable _serializeProperties( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Fruit object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); + return result; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FruitBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Fruit deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FruitBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + oneOfDataSrc = unhandled; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart new file mode 100644 index 000000000000..ddb1d66a1f5e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/lib/src/serializers.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/fruit.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + Apple, + Banana, + Fruit, +]) +Serializers serializers = (_$serializers.toBuilder() + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml new file mode 100644 index 000000000000..22a9189f7d08 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + org.openapitools + DartDioOneOf + pom + 1.0.0-SNAPSHOT + DartDio OneOf + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml new file mode 100644 index 000000000000..de93663746d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart new file mode 100644 index 000000000000..1d542169550d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final instance = AppleBuilder(); + // TODO add properties to the builder and call build() + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart new file mode 100644 index 000000000000..a883acc0a9e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final instance = BananaBuilder(); + // TODO add properties to the builder and call build() + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart new file mode 100644 index 000000000000..07d256d2e554 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/test/default_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future rootGet() async + test('test rootGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart new file mode 100644 index 000000000000..c18790ae9566 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final instance = FruitBuilder(); + // TODO add properties to the builder and call build() + + group(Fruit, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES new file mode 100644 index 000000000000..52a900a19623 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/FILES @@ -0,0 +1,47 @@ +.gitignore +README.md +analysis_options.yaml +doc/Addressable.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Entity.md +doc/EntityRef.md +doc/Extensible.md +doc/Foo.md +doc/FooApi.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/Pasta.md +doc/Pizza.md +doc/PizzaSpeziale.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/bar_api.dart +lib/src/api/foo_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/addressable.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/date.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/extensible.dart +lib/src/model/foo.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/pasta.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md new file mode 100644 index 000000000000..2db5d76f05d7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/README.md @@ -0,0 +1,99 @@ +# openapi (EXPERIMENTAL) +This tests for a oneOf interface representation + + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 0.0.1 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = await api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print("Exception when calling BarApi->createBar: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:8080* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +## Documentation For Models + + - [Addressable](doc/Addressable.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [Extensible](doc/Extensible.md) + - [Foo](doc/Foo.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [Pasta](doc/Pasta.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml new file mode 100644 index 000000000000..139ad7abf559 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Addressable.md @@ -0,0 +1,16 @@ +# openapi.model.Addressable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md @@ -0,0 +1,22 @@ +# openapi.model.Bar + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md new file mode 100644 index 000000000000..a6f23c00210c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarApi.md @@ -0,0 +1,55 @@ +# openapi.api.BarApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar + + +# **createBar** +> Bar createBar(barCreate) + +Create a Bar + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print('Exception when calling BarApi->createBar: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **barCreate** | [**BarCreate**](BarCreate.md)| | + +### Return type + +[**Bar**](Bar.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md @@ -0,0 +1,22 @@ +# openapi.model.BarCreate + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Entity.md @@ -0,0 +1,19 @@ +# openapi.model.Entity + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md @@ -0,0 +1,21 @@ +# openapi.model.EntityRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Extensible.md @@ -0,0 +1,17 @@ +# openapi.model.Extensible + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md @@ -0,0 +1,21 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md new file mode 100644 index 000000000000..ff844803f061 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooApi.md @@ -0,0 +1,93 @@ +# openapi.api.FooApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo +[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +# **createFoo** +> FooRefOrValue createFoo(foo) + +Create a Foo + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); +final Foo foo = ; // Foo | The Foo to be created + +try { + final response = api.createFoo(foo); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->createFoo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] + +### Return type + +[**FooRefOrValue**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json;charset=utf-8 + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getAllFoos** +> BuiltList getAllFoos() + +GET all Foos + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); + +try { + final response = api.getAllFoos(); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->getAllFoos: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**BuiltList<FooRefOrValue>**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md new file mode 100644 index 000000000000..05aa2b0bbc1c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValueWithProperties + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md @@ -0,0 +1,20 @@ +# openapi.model.Pasta + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md @@ -0,0 +1,20 @@ +# openapi.model.Pizza + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart new file mode 100644 index 000000000000..ea87a7cb4761 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/openapi.dart @@ -0,0 +1,28 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; + +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart new file mode 100644 index 000000000000..3e6abb37ddb9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/bar_api.dart'; +import 'package:openapi/src/api/foo_api.dart'; + +class Openapi { + static const String basePath = r'http://localhost:8080'; + + final Dio dio; + final Serializers serializers; + + Openapi({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(dio, serializers); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(dio, serializers); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart new file mode 100644 index 000000000000..5cad411a8466 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/bar_api.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; + +class BarApi { + + final Dio _dio; + + final Serializers _serializers; + + const BarApi(this._dio, this._serializers); + + /// Create a Bar + /// + /// + /// Parameters: + /// * [barCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Bar] as data + /// Throws [DioException] if API call or serialization fails + Future> createBar({ + required BarCreate barCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/bar'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(BarCreate); + _bodyData = _serializers.serialize(barCreate, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bar? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Bar), + ) as Bar; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart new file mode 100644 index 000000000000..4b67cdef3d0a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api/foo_api.dart @@ -0,0 +1,190 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; + +class FooApi { + + final Dio _dio; + + final Serializers _serializers; + + const FooApi(this._dio, this._serializers); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data + /// Throws [DioException] if API call or serialization fails + Future> createFoo({ + Foo? foo, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json;charset=utf-8', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Foo); + _bodyData = foo == null ? null : _serializers.serialize(foo, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooRefOrValue? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// GET all Foos + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltList] as data + /// Throws [DioException] if API call or serialization fails + Future>> getAllFoos({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltList? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(BuiltList, [FullType(FooRefOrValue)]), + ) as BuiltList; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart new file mode 100644 index 000000000000..0ab0936d5673 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/addressable.dart @@ -0,0 +1,161 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'addressable.g.dart'; + +/// Base schema for addressable entities +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +@BuiltValue(instantiable: false) +abstract class Addressable { + /// Hyperlink reference + @BuiltValueField(wireName: r'href') + String? get href; + + /// unique identifier + @BuiltValueField(wireName: r'id') + String? get id; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AddressableSerializer(); +} + +class _$AddressableSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Addressable]; + + @override + final String wireName = r'Addressable'; + + Iterable _serializeProperties( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; + } +} + +/// a concrete implementation of [Addressable], since [Addressable] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { + $Addressable._(); + + factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AddressableBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Addressable> get serializer => _$$AddressableSerializer(); +} + +class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { + @override + final Iterable types = const [$Addressable, _$$Addressable]; + + @override + final String wireName = r'$Addressable'; + + @override + Object serialize( + Serializers serializers, + $Addressable object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Addressable))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AddressableBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Addressable deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AddressableBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart new file mode 100644 index 000000000000..cb769550b4f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar.g.dart'; + +/// Bar +/// +/// Properties: +/// * [id] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] +/// * [href] - Hyperlink reference +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class Bar implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + Bar._(); + + factory Bar([void updates(BarBuilder b)]) = _$Bar; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarSerializer(); +} + +class _$BarSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Bar, _$Bar]; + + @override + final String wireName = r'Bar'; + + Iterable _serializeProperties( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Bar object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Bar deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..8942b6433f5e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -0,0 +1,219 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_create.g.dart'; + +/// BarCreate +/// +/// Properties: +/// * [barPropA] +/// * [fooPropB] +/// * [foo] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class BarCreate implements Entity, Built { + @BuiltValueField(wireName: r'foo') + FooRefOrValue? get foo; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + @BuiltValueField(wireName: r'barPropA') + String? get barPropA; + + BarCreate._(); + + factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarCreateSerializer(); +} + +class _$BarCreateSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarCreate, _$BarCreate]; + + @override + final String wireName = r'BarCreate'; + + Iterable _serializeProperties( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(FooRefOrValue), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.barPropA != null) { + yield r'barPropA'; + yield serializers.serialize( + object.barPropA, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + BarCreate object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarCreateBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(FooRefOrValue), + ) as FooRefOrValue; + result.foo.replace(valueDes); + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'barPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.barPropA = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarCreate deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarCreateBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..2b9d2727a448 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -0,0 +1,192 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'bar_ref.g.dart'; + +/// BarRef +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class BarRef implements EntityRef, Built { + BarRef._(); + + factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefSerializer(); +} + +class _$BarRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRef, _$BarRef]; + + @override + final String wireName = r'BarRef'; + + Iterable _serializeProperties( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + BarRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required BarRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + BarRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..4af61384ab76 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'bar_ref_or_value.g.dart'; + +/// BarRefOrValue +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class BarRefOrValue implements Built { + /// One Of [Bar], [BarRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'BarRef': BarRef, + }; + + BarRefOrValue._(); + + factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = _$BarRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(BarRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$BarRefOrValueSerializer(); +} + +extension BarRefOrValueDiscriminatorExt on BarRefOrValue { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarRef) { + return r'BarRef'; + } + return null; + } +} +extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; + } + return null; + } +} + +class _$BarRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [BarRefOrValue, _$BarRefOrValue]; + + @override + final String wireName = r'BarRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + BarRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + BarRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = BarRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Bar, BarRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Bar': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Bar), + ) as Bar; + oneOfType = Bar; + break; + case r'BarRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(BarRef), + ) as BarRef; + oneOfType = BarRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart new file mode 100644 index 000000000000..7e27fab47387 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity.dart @@ -0,0 +1,298 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity.g.dart'; + +/// Entity +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue(instantiable: false) +abstract class Entity implements Addressable, Extensible { + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Bar': Bar, + r'Bar_Create': BarCreate, + r'Foo': Foo, + r'Pasta': Pasta, + r'Pizza': Pizza, + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntitySerializer(); +} + +extension EntityDiscriminatorExt on Entity { + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension EntityBuilderDiscriminatorExt on EntityBuilder { + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$EntitySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Entity]; + + @override + final String wireName = r'Entity'; + + Iterable _serializeProperties( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Bar) { + return serializers.serialize(object, specifiedType: FullType(Bar))!; + } + if (object is BarCreate) { + return serializers.serialize(object, specifiedType: FullType(BarCreate))!; + } + if (object is Foo) { + return serializers.serialize(object, specifiedType: FullType(Foo))!; + } + if (object is Pasta) { + return serializers.serialize(object, specifiedType: FullType(Pasta))!; + } + if (object is Pizza) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Bar': + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; + case r'Bar_Create': + return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; + case r'Foo': + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; + case r'Pasta': + return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; + case r'Pizza': + return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; + } + } +} + +/// a concrete implementation of [Entity], since [Entity] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Entity implements Entity, Built<$Entity, $EntityBuilder> { + $Entity._(); + + factory $Entity([void Function($EntityBuilder)? updates]) = _$$Entity; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Entity> get serializer => _$$EntitySerializer(); +} + +class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { + @override + final Iterable types = const [$Entity, _$$Entity]; + + @override + final String wireName = r'$Entity'; + + @override + Object serialize( + Serializers serializers, + $Entity object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Entity))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Entity deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..7502c94dd7f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -0,0 +1,284 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'entity_ref.g.dart'; + +/// Entity reference schema to be use for all entityRef class. +/// +/// Properties: +/// * [name] - Name of the related entity. +/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue(instantiable: false) +abstract class EntityRef implements Addressable, Extensible { + /// The actual type of the target instance when needed for disambiguation. + @BuiltValueField(wireName: r'@referredType') + String? get atReferredType; + + /// Name of the related entity. + @BuiltValueField(wireName: r'name') + String? get name; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'BarRef': BarRef, + r'FooRef': FooRef, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EntityRefSerializer(); +} + +extension EntityRefDiscriminatorExt on EntityRef { + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$EntityRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EntityRef]; + + @override + final String wireName = r'EntityRef'; + + Iterable _serializeProperties( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is BarRef) { + return serializers.serialize(object, specifiedType: FullType(BarRef))!; + } + if (object is FooRef) { + return serializers.serialize(object, specifiedType: FullType(FooRef))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'BarRef': + return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; + case r'FooRef': + return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; + default: + return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; + } + } +} + +/// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable +@BuiltValue(instantiable: true) +abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { + $EntityRef._(); + + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($EntityRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$EntityRef> get serializer => _$$EntityRefSerializer(); +} + +class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { + @override + final Iterable types = const [$EntityRef, _$$EntityRef]; + + @override + final String wireName = r'$EntityRef'; + + @override + Object serialize( + Serializers serializers, + $EntityRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(EntityRef))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EntityRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $EntityRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $EntityRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart new file mode 100644 index 000000000000..2423fb276412 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/extensible.dart @@ -0,0 +1,178 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'extensible.g.dart'; + +/// Extensible +/// +/// Properties: +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue(instantiable: false) +abstract class Extensible { + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @BuiltValueField(wireName: r'@schemaLocation') + String? get atSchemaLocation; + + /// When sub-classing, this defines the super-class + @BuiltValueField(wireName: r'@baseType') + String? get atBaseType; + + /// When sub-classing, this defines the sub-class Extensible name + @BuiltValueField(wireName: r'@type') + String get atType; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExtensibleSerializer(); +} + +class _$ExtensibleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Extensible]; + + @override + final String wireName = r'Extensible'; + + Iterable _serializeProperties( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; + } +} + +/// a concrete implementation of [Extensible], since [Extensible] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { + $Extensible._(); + + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ExtensibleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Extensible> get serializer => _$$ExtensibleSerializer(); +} + +class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { + @override + final Iterable types = const [$Extensible, _$$Extensible]; + + @override + final String wireName = r'$Extensible'; + + @override + Object serialize( + Serializers serializers, + $Extensible object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Extensible))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ExtensibleBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Extensible deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $ExtensibleBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart new file mode 100644 index 000000000000..d2e1f5817f20 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -0,0 +1,200 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo.g.dart'; + +/// Foo +/// +/// Properties: +/// * [fooPropA] +/// * [fooPropB] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class Foo implements Entity, Built { + @BuiltValueField(wireName: r'fooPropA') + String? get fooPropA; + + @BuiltValueField(wireName: r'fooPropB') + String? get fooPropB; + + Foo._(); + + factory Foo([void updates(FooBuilder b)]) = _$Foo; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooSerializer(); +} + +class _$FooSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Foo, _$Foo]; + + @override + final String wireName = r'Foo'; + + Iterable _serializeProperties( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.fooPropA != null) { + yield r'fooPropA'; + yield serializers.serialize( + object.fooPropA, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.fooPropB != null) { + yield r'fooPropB'; + yield serializers.serialize( + object.fooPropB, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'fooPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropA = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'fooPropB': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.fooPropB = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Foo deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..1f77d990f0e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -0,0 +1,210 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo_ref.g.dart'; + +/// FooRef +/// +/// Properties: +/// * [foorefPropA] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class FooRef implements EntityRef, Built { + @BuiltValueField(wireName: r'foorefPropA') + String? get foorefPropA; + + FooRef._(); + + factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefSerializer(); +} + +class _$FooRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRef, _$FooRef]; + + @override + final String wireName = r'FooRef'; + + Iterable _serializeProperties( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atReferredType != null) { + yield r'@referredType'; + yield serializers.serialize( + object.atReferredType, + specifiedType: const FullType(String), + ); + } + if (object.foorefPropA != null) { + yield r'foorefPropA'; + yield serializers.serialize( + object.foorefPropA, + specifiedType: const FullType(String), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + FooRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@referredType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atReferredType = valueDes; + break; + case r'foorefPropA': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foorefPropA = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FooRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..af3e4875d9d6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,129 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'foo_ref_or_value.g.dart'; + +/// FooRefOrValue +/// +/// Properties: +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class FooRefOrValue implements Built { + /// One Of [Foo], [FooRef] + OneOf get oneOf; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'Foo': Foo, + r'FooRef': FooRef, + }; + + FooRefOrValue._(); + + factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = _$FooRefOrValue; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooRefOrValueBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooRefOrValueSerializer(); +} + +extension FooRefOrValueDiscriminatorExt on FooRefOrValue { + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; + } +} +extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; + } +} + +class _$FooRefOrValueSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooRefOrValue, _$FooRefOrValue]; + + @override + final String wireName = r'FooRefOrValue'; + + Iterable _serializeProperties( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + FooRefOrValue object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + FooRefOrValue deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooRefOrValueBuilder(); + Object? oneOfDataSrc; + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + oneOfDataSrc = serialized; + final oneOfTypes = [Foo, FooRef, ]; + Object oneOfResult; + Type oneOfType; + switch (discValue) { + case r'Foo': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(Foo), + ) as Foo; + oneOfType = Foo; + break; + case r'FooRef': + oneOfResult = serializers.deserialize( + oneOfDataSrc, + specifiedType: FullType(FooRef), + ) as FooRef; + oneOfType = FooRef; + break; + default: + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + } + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart new file mode 100644 index 000000000000..e8b1ebdf31ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -0,0 +1,182 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pasta.g.dart'; + +/// Pasta +/// +/// Properties: +/// * [vendor] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class Pasta implements Entity, Built { + @BuiltValueField(wireName: r'vendor') + String? get vendor; + + Pasta._(); + + factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PastaSerializer(); +} + +class _$PastaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pasta, _$Pasta]; + + @override + final String wireName = r'Pasta'; + + Iterable _serializeProperties( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + if (object.vendor != null) { + yield r'vendor'; + yield serializers.serialize( + object.vendor, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pasta object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PastaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + case r'vendor': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.vendor = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pasta deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PastaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart new file mode 100644 index 000000000000..14c06db06d7e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -0,0 +1,250 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza.g.dart'; + +/// Pizza +/// +/// Properties: +/// * [pizzaSize] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue(instantiable: false) +abstract class Pizza implements Entity { + @BuiltValueField(wireName: r'pizzaSize') + num? get pizzaSize; + + static const String discriminatorFieldName = r'@type'; + + static const Map discriminatorMapping = { + r'PizzaSpeziale': PizzaSpeziale, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSerializer(); +} + +extension PizzaDiscriminatorExt on Pizza { + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; + } +} +extension PizzaBuilderDiscriminatorExt on PizzaBuilder { + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; + } +} + +class _$PizzaSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pizza]; + + @override + final String wireName = r'Pizza'; + + Iterable _serializeProperties( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is PizzaSpeziale) { + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'PizzaSpeziale': + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; + } + } +} + +/// a concrete implementation of [Pizza], since [Pizza] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Pizza implements Pizza, Built<$Pizza, $PizzaBuilder> { + $Pizza._(); + + factory $Pizza([void Function($PizzaBuilder)? updates]) = _$$Pizza; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PizzaBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Pizza> get serializer => _$$PizzaSerializer(); +} + +class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { + @override + final Iterable types = const [$Pizza, _$$Pizza]; + + @override + final String wireName = r'$Pizza'; + + @override + Object serialize( + Serializers serializers, + $Pizza object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Pizza))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Pizza deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $PizzaBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..673052cc8fcf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -0,0 +1,196 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pizza_speziale.g.dart'; + +/// PizzaSpeziale +/// +/// Properties: +/// * [toppings] +/// * [href] - Hyperlink reference +/// * [id] - unique identifier +/// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships +/// * [atBaseType] - When sub-classing, this defines the super-class +/// * [atType] - When sub-classing, this defines the sub-class Extensible name +@BuiltValue() +abstract class PizzaSpeziale implements Pizza, Built { + @BuiltValueField(wireName: r'toppings') + String? get toppings; + + PizzaSpeziale._(); + + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PizzaSpezialeSerializer(); +} + +class _$PizzaSpezialeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PizzaSpeziale, _$PizzaSpeziale]; + + @override + final String wireName = r'PizzaSpeziale'; + + Iterable _serializeProperties( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.atSchemaLocation != null) { + yield r'@schemaLocation'; + yield serializers.serialize( + object.atSchemaLocation, + specifiedType: const FullType(String), + ); + } + if (object.pizzaSize != null) { + yield r'pizzaSize'; + yield serializers.serialize( + object.pizzaSize, + specifiedType: const FullType(num), + ); + } + if (object.toppings != null) { + yield r'toppings'; + yield serializers.serialize( + object.toppings, + specifiedType: const FullType(String), + ); + } + if (object.atBaseType != null) { + yield r'@baseType'; + yield serializers.serialize( + object.atBaseType, + specifiedType: const FullType(String), + ); + } + if (object.href != null) { + yield r'href'; + yield serializers.serialize( + object.href, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + yield r'@type'; + yield serializers.serialize( + object.atType, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PizzaSpeziale object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PizzaSpezialeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'@schemaLocation': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atSchemaLocation = valueDes; + break; + case r'pizzaSize': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.pizzaSize = valueDes; + break; + case r'toppings': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.toppings = valueDes; + break; + case r'@baseType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atBaseType = valueDes; + break; + case r'href': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.href = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'@type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.atType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PizzaSpeziale deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PizzaSpezialeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart new file mode 100644 index 000000000000..55083251e5e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/serializers.dart @@ -0,0 +1,67 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + Addressable,$Addressable, + Bar, + BarCreate, + BarRef, + BarRefOrValue, + Entity,$Entity, + EntityRef,$EntityRef, + Extensible,$Extensible, + Foo, + FooRef, + FooRefOrValue, + Pasta, + Pizza,$Pizza, + PizzaSpeziale, +]) +Serializers serializers = (_$serializers.toBuilder() + ..addBuilderFactory( + const FullType(BuiltList, [FullType(FooRefOrValue)]), + () => ListBuilder(), + ) + ..add(Addressable.serializer) + ..add(Entity.serializer) + ..add(EntityRef.serializer) + ..add(Extensible.serializer) + ..add(Pizza.serializer) + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml new file mode 100644 index 000000000000..50f62b7f8dae --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + org.openapitools + DartDioOneOfPolymorphismAndInheritance + pom + 1.0.0-SNAPSHOT + DartDio OneOf Polymorphism and Inheritance + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml new file mode 100644 index 000000000000..de93663746d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart new file mode 100644 index 000000000000..696e26e8e549 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + //final instance = AddressableBuilder(); + // TODO add properties to the builder and call build() + + group(Addressable, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart new file mode 100644 index 000000000000..73be91c446e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BarApi +void main() { + final instance = Openapi().getBarApi(); + + group(BarApi, () { + // Create a Bar + // + //Future createBar(BarCreate barCreate) async + test('test createBar', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart new file mode 100644 index 000000000000..1bf90151be8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_create_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarCreate +void main() { + final instance = BarCreateBuilder(); + // TODO add properties to the builder and call build() + + group(BarCreate, () { + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..c132ac09943b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final instance = BarRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(BarRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart new file mode 100644 index 000000000000..9c410b2b5c54 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_ref_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final instance = BarRefBuilder(); + // TODO add properties to the builder and call build() + + group(BarRef, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart new file mode 100644 index 000000000000..dc6daaa3400d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final instance = BarBuilder(); + // TODO add properties to the builder and call build() + + group(Bar, () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart new file mode 100644 index 000000000000..836289893fb4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EntityRef +void main() { + //final instance = EntityRefBuilder(); + // TODO add properties to the builder and call build() + + group(EntityRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart new file mode 100644 index 000000000000..30429747562d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + //final instance = EntityBuilder(); + // TODO add properties to the builder and call build() + + group(Entity, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart new file mode 100644 index 000000000000..75e6211e074b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + //final instance = ExtensibleBuilder(); + // TODO add properties to the builder and call build() + + group(Extensible, () { + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart new file mode 100644 index 000000000000..f33986a08b69 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_api_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FooApi +void main() { + final instance = Openapi().getFooApi(); + + group(FooApi, () { + // Create a Foo + // + //Future createFoo({ Foo foo }) async + test('test createFoo', () async { + // TODO + }); + + // GET all Foos + // + //Future> getAllFoos() async + test('test getAllFoos', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..029d030e5e35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final instance = FooRefOrValueBuilder(); + // TODO add properties to the builder and call build() + + group(FooRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart new file mode 100644 index 000000000000..a1398787bbcb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_ref_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final instance = FooRefBuilder(); + // TODO add properties to the builder and call build() + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart new file mode 100644 index 000000000000..93a5286e2b45 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final instance = FooBuilder(); + // TODO add properties to the builder and call build() + + group(Foo, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart new file mode 100644 index 000000000000..6a3ae338eec2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final instance = PastaBuilder(); + // TODO add properties to the builder and call build() + + group(Pasta, () { + // String vendor + test('to test the property `vendor`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..774320231c9e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_speziale_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final instance = PizzaSpezialeBuilder(); + // TODO add properties to the builder and call build() + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart new file mode 100644 index 000000000000..5c6e1af95a59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + //final instance = PizzaBuilder(); + // TODO add properties to the builder and call build() + + group(Pizza, () { + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES new file mode 100644 index 000000000000..7f2ac59bf645 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.gitignore +README.md +analysis_options.yaml +doc/Child.md +doc/DefaultApi.md +doc/Example.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/default_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/child.dart +lib/src/model/date.dart +lib/src/model/example.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md new file mode 100644 index 000000000000..f407e9306c43 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/README.md @@ -0,0 +1,83 @@ +# openapi (EXPERIMENTAL) +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getDefaultApi(); + +try { + final response = await api.list(); + print(response); +} catch on DioException (e) { + print("Exception when calling DefaultApi->list: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /example | + + +## Documentation For Models + + - [Child](doc/Child.md) + - [Example](doc/Example.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml new file mode 100644 index 000000000000..139ad7abf559 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md new file mode 100644 index 000000000000..bed0f2feec12 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Child.md @@ -0,0 +1,15 @@ +# openapi.model.Child + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md new file mode 100644 index 000000000000..c4077a67727b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/DefaultApi.md @@ -0,0 +1,51 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://api.example.xyz/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list**](DefaultApi.md#list) | **GET** /example | + + +# **list** +> Example list() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Example**](Example.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md new file mode 100644 index 000000000000..bf49bb137a60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/doc/Example.md @@ -0,0 +1,15 @@ +# openapi.model.Example + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart new file mode 100644 index 000000000000..220621d6961b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/openapi.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/default_api.dart'; + +export 'package:openapi/src/model/child.dart'; +export 'package:openapi/src/model/example.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart new file mode 100644 index 000000000000..7eb05e3ea4e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/default_api.dart'; + +class Openapi { + static const String basePath = r'http://api.example.xyz/v1'; + + final Dio dio; + final Serializers serializers; + + Openapi({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio, serializers); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart new file mode 100644 index 000000000000..4b5984b8e315 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api/default_api.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/example.dart'; + +class DefaultApi { + + final Dio _dio; + + final Serializers _serializers; + + const DefaultApi(this._dio, this._serializers); + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Example] as data + /// Throws [DioException] if API call or serialization fails + Future> list({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/example'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Example? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Example), + ) as Example; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart new file mode 100644 index 000000000000..987b52ca7240 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/child.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'child.g.dart'; + +/// Child +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Child implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + Child._(); + + factory Child([void updates(ChildBuilder b)]) = _$Child; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ChildBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ChildSerializer(); +} + +class _$ChildSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Child, _$Child]; + + @override + final String wireName = r'Child'; + + Iterable _serializeProperties( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Child object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ChildBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Child deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ChildBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart new file mode 100644 index 000000000000..799b77e4e178 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/model/example.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/child.dart'; +import 'dart:core'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; + +part 'example.g.dart'; + +/// Example +/// +/// Properties: +/// * [name] +@BuiltValue() +abstract class Example implements Built { + /// One Of [Child], [int] + OneOf get oneOf; + + Example._(); + + factory Example([void updates(ExampleBuilder b)]) = _$Example; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ExampleBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ExampleSerializer(); +} + +class _$ExampleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Example, _$Example]; + + @override + final String wireName = r'Example'; + + Iterable _serializeProperties( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + } + + @override + Object serialize( + Serializers serializers, + Example object, { + FullType specifiedType = FullType.unspecified, + }) { + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; + } + + @override + Example deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ExampleBuilder(); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(Child), FullType(int), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart new file mode 100644 index 000000000000..cbd8870dc676 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/lib/src/serializers.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/child.dart'; +import 'package:openapi/src/model/example.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + Child, + Example, +]) +Serializers serializers = (_$serializers.toBuilder() + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml new file mode 100644 index 000000000000..cceaebd895f6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + org.openapitools + DartDioOneOfPrimitive + pom + 1.0.0-SNAPSHOT + DartDio OneOf Primitive + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml new file mode 100644 index 000000000000..de93663746d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart new file mode 100644 index 000000000000..d40451a84c2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Child +void main() { + final instance = ChildBuilder(); + // TODO add properties to the builder and call build() + + group(Child, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart new file mode 100644 index 000000000000..e4ec57077946 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/default_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future list() async + test('test list', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart new file mode 100644 index 000000000000..ccb35121143e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/test/example_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Example +void main() { + final instance = ExampleBuilder(); + // TODO add properties to the builder and call build() + + group(Example, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..fd331c256c8c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -0,0 +1,121 @@ +.gitignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Capitalization.md +doc/Cat.md +doc/Category.md +doc/ClassModel.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/Dog.md +doc/EnumArrays.md +doc/EnumTest.md +doc/FakeApi.md +doc/FakeBigDecimalMap200Response.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooGetDefaultResponse.md +doc/FormatTest.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Pet.md +doc/PetApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/another_fake_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/deserialize.dart +lib/src/model/additional_properties_class.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/fake_big_decimal_map200_response.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_get_default_response.dart +lib/src/model/format_test.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/pet.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md new file mode 100644 index 000000000000..8506db54bbfc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -0,0 +1,204 @@ +# openapi (EXPERIMENTAL) +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) +* JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = await api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*FakeApi*](doc/FakeApi.md) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [Category](doc/Category.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.md) + - [MapTest](doc/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc/Model200Response.md) + - [ModelClient](doc/ModelClient.md) + - [ModelEnumClass](doc/ModelEnumClass.md) + - [ModelFile](doc/ModelFile.md) + - [ModelList](doc/ModelList.md) + - [ModelReturn](doc/ModelReturn.md) + - [Name](doc/Name.md) + - [NullableClass](doc/NullableClass.md) + - [NumberOnly](doc/NumberOnly.md) + - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [Order](doc/Order.md) + - [OuterComposite](doc/OuterComposite.md) + - [OuterEnum](doc/OuterEnum.md) + - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### bearer_test + +- **Type**: HTTP Bearer Token authentication (JWT) + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml new file mode 100644 index 000000000000..ac01482530cc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/analysis_options.yaml @@ -0,0 +1,12 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/build.yaml @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AllOfWithSingleRef.md @@ -0,0 +1,16 @@ +# openapi.model.AllOfWithSingleRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md new file mode 100644 index 000000000000..36a94e6bb703 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# openapi.api.AnotherFakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call123testSpecialTags** +> ModelClient call123testSpecialTags(modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [default to 'default-name'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md new file mode 100644 index 000000000000..13ae5d3a4708 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md new file mode 100644 index 000000000000..6abd2b44f9c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DefaultApi.md @@ -0,0 +1,51 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | + + +# **fooGet** +> FooGetDefaultResponse fooGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->fooGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md new file mode 100644 index 000000000000..1587283037ec --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeApi.md @@ -0,0 +1,856 @@ +# openapi.api.FakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | + + +# **fakeBigDecimalMap** +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeBigDecimalMap(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeHealthGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHealthGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeHttpSignatureTest(pet, query1, header1); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterBooleanSerialize** +> bool fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final bool body = true; // bool | Input boolean as post body + +try { + final response = api.fakeOuterBooleanSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body + +try { + final response = api.fakeOuterCompositeSerialize(outerComposite); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterNumberSerialize** +> num fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final num body = 8.14; // num | Input number as post body + +try { + final response = api.fakeOuterNumberSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **num**| Input number as post body | [optional] + +### Return type + +**num** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String body = body_example; // String | Input string as post body + +try { + final response = api.fakeOuterStringSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakePropertyEnumIntegerSerialize** +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body + +try { + final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithBinary** +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload + +try { + api.testBodyWithBinary(body); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **MultipartFile**| image to upload | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: image/png + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | + +try { + api.testBodyWithFileSchema(fileSchemaTestClass); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String query = query_example; // String | +final User user = ; // User | + +try { + api.testBodyWithQueryParams(query, user); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testClientModel** +> ModelClient testClientModel(modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClientModel(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->testClientModel: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEndpointParameters** +> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: http_basic_test +//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final num number = 8.14; // num | None +final double double_ = 1.2; // double | None +final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None +final String byte = BYTE_ARRAY_DATA_HERE; // String | None +final int integer = 56; // int | None +final int int32 = 56; // int | None +final int int64 = 789; // int | None +final double float = 3.4; // double | None +final String string = string_example; // String | None +final MultipartFile binary = BINARY_DATA_HERE; // MultipartFile | None +final DateTime date = 2013-10-20; // DateTime | None +final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None +final String password = password_example; // String | None +final String callback = callback_example; // String | None + +try { + api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEndpointParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **num**| None | + **double_** | **double**| None | + **patternWithoutDelimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **double**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **MultipartFile**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List enumHeaderStringArray = ; // List | Header parameter enum test (string array) +final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) +final List enumQueryStringArray = ; // List | Query parameter enum test (string array) +final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) +final int enumQueryInteger = 56; // int | Query parameter enum test (double) +final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) +final List enumQueryModelArray = ; // List | +final List enumFormStringArray = ; // List | Form parameter enum test (string array) +final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) + +try { + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEnumParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] + **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final int requiredStringGroup = 56; // int | Required String in group parameters +final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters +final int requiredInt64Group = 789; // int | Required Integer in group parameters +final int stringGroup = 56; // int | String in group parameters +final bool booleanGroup = true; // bool | Boolean in group parameters +final int int64Group = 789; // int | Integer in group parameters + +try { + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); +} catch on DioException (e) { + print('Exception when calling FakeApi->testGroupParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **int**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testInlineAdditionalProperties(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String param = param_example; // String | field1 +final String param2 = param2_example; // String | field2 + +try { + api.testJsonFormData(param, param2); +} catch on DioException (e) { + print('Exception when calling FakeApi->testJsonFormData: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List pipe = ; // List | +final List ioutil = ; // List | +final List http = ; // List | +final List url = ; // List | +final List context = ; // List | +final String allowEmpty = allowEmpty_example; // String | +final Map language = ; // Map | + +try { + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); +} catch on DioException (e) { + print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + **allowEmpty** | **String**| | + **language** | [**Map<String, String>**](String.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..281dfc44fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeBigDecimalMap200Response.md @@ -0,0 +1,16 @@ +# openapi.model.FakeBigDecimalMap200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someId** | **num** | | [optional] +**someMap** | **Map<String, num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..645aebf399f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# openapi.api.FakeClassnameTags123Api + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> ModelClient testClassname(modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key_query +//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getFakeClassnameTags123Api(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClassname(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md new file mode 100644 index 000000000000..185b76e3f5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Foo.md @@ -0,0 +1,15 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [default to 'bar'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md new file mode 100644 index 000000000000..10d0133abd95 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FooGetDefaultResponse.md @@ -0,0 +1,15 @@ +# openapi.model.FooGetDefaultResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] +**date** | [**DateTime**](DateTime.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md new file mode 100644 index 000000000000..c5e61e1162bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md @@ -0,0 +1,15 @@ +# openapi.model.InlineResponseDefault + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | **Map<String, String>** | | [optional] +**directMap** | **Map<String, bool>** | | [optional] +**indirectMap** | **Map<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md new file mode 100644 index 000000000000..5aa3fb97c32e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**DateTime**](DateTime.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..dda2836d8d54 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md new file mode 100644 index 000000000000..3cd230bfb213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **Set<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md new file mode 100644 index 000000000000..5fc7fbd2657f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/PetApi.md @@ -0,0 +1,439 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.addPet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->addPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | Pet id to delete +final String apiKey = apiKey_example; // String | + +try { + api.deletePet(petId, apiKey); +} catch on DioException (e) { + print('Exception when calling PetApi->deletePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final List status = ; // List | Status values that need to be considered for filter + +try { + final response = api.findPetsByStatus(status); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByStatus: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> Set findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Set tags = ; // Set | Tags to filter by + +try { + final response = api.findPetsByTags(tags); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Set<String>**](String.md)| Tags to filter by | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to return + +try { + final response = api.getPetById(petId); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->getPetById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(pet) + +Update an existing pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.updatePet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet that needs to be updated +final String name = name_example; // String | Updated name of the pet +final String status = status_example; // String | Updated status of the pet + +try { + api.updatePetWithForm(petId, name, status); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePetWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + final response = api.uploadFile(petId, additionalMetadata, file); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server + +try { + final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **requiredFile** | **MultipartFile**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SingleRefType.md @@ -0,0 +1,14 @@ +# openapi.model.SingleRefType + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md new file mode 100644 index 000000000000..42028947229f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/StoreApi.md @@ -0,0 +1,188 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final String orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api.deleteOrder(orderId); +} catch on DioException (e) { + print('Exception when calling StoreApi->deleteOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getStoreApi(); + +try { + final response = api.getInventory(); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getInventory: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, int>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final int orderId = 789; // int | ID of pet that needs to be fetched + +try { + final response = api.getOrderById(orderId); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final Order order = ; // Order | order placed for purchasing the pet + +try { + final response = api.placeOrder(order); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->placeOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md new file mode 100644 index 000000000000..49b79d76b8a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/UserApi.md @@ -0,0 +1,359 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final User user = ; // User | Created user object + +try { + api.createUser(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithArrayInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithListInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be deleted + +try { + api.deleteUser(username); +} catch on DioException (e) { + print('Exception when calling UserApi->deleteUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + final response = api.getUserByName(username); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->getUserByName: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The user name for login +final String password = password_example; // String | The password for login in clear text + +try { + final response = api.loginUser(username, password); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->loginUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); + +try { + api.logoutUser(); +} catch on DioException (e) { + print('Exception when calling UserApi->logoutUser: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | name that need to be deleted +final User user = ; // User | Updated user object + +try { + api.updateUser(username, user); +} catch on DioException (e) { + print('Exception when calling UserApi->updateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart new file mode 100644 index 000000000000..48d2103d57d9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -0,0 +1,65 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_get_default_response.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart new file mode 100644 index 000000000000..835b76584b2d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/another_fake_api.dart'; +import 'package:openapi/src/api/default_api.dart'; +import 'package:openapi/src/api/fake_api.dart'; +import 'package:openapi/src/api/fake_classname_tags123_api.dart'; +import 'package:openapi/src/api/pet_api.dart'; +import 'package:openapi/src/api/store_api.dart'; +import 'package:openapi/src/api/user_api.dart'; + +class Openapi { + static const String basePath = r'http://petstore.swagger.io:80/v2'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + AnotherFakeApi getAnotherFakeApi() { + return AnotherFakeApi(dio); + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio); + } + + /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeApi getFakeApi() { + return FakeApi(dio); + } + + /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeClassnameTags123Api getFakeClassnameTags123Api() { + return FakeClassnameTags123Api(dio); + } + + /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PetApi getPetApi() { + return PetApi(dio); + } + + /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + StoreApi getStoreApi() { + return StoreApi(dio); + } + + /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + UserApi getUserApi() { + return UserApi(dio); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..d98f3c23f4f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/another_fake_api.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class AnotherFakeApi { + + final Dio _dio; + + const AnotherFakeApi(this._dio); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> call123testSpecialTags({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart new file mode 100644 index 000000000000..e9efb7b5b194 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/default_api.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/foo_get_default_response.dart'; + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// fooGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> fooGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooGetDefaultResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FooGetDefaultResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..a6dd002c83cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_api.dart @@ -0,0 +1,1450 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/user.dart'; + +class FakeApi { + + final Dio _dio; + + const FakeApi(this._dio); + + /// fakeBigDecimalMap + /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FakeBigDecimalMap200Response] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeBigDecimalMap({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/BigDecimalMap'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FakeBigDecimalMap200Response? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FakeBigDecimalMap200Response', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeHealthGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + HealthCheckResult? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'HealthCheckResult', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> fakeHttpSignatureTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + bool? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'bool', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + OuterComposite? outerComposite, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerComposite); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'OuterComposite', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + num? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'num', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/string'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioException] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/property/enum-int'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerObjectWithEnumProperty); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'OuterObjectWithEnumProperty', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-binary'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'image/png', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-file-schema'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(fileSchemaTestClass); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-query-params'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'query': query, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + MultipartFile? binary, + DateTime? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'basic', + 'name': 'http_basic_test', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEnumParameters({ + List? enumHeaderStringArray, + String? enumHeaderString = '-efg', + List? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + List? enumQueryModelArray, + List? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'GET', + headers: { + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryString != null) r'enum_query_string': enumQueryString, + if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, + if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, + }; + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'DELETE', + headers: { + r'required_boolean_group': requiredBooleanGroup, + if (booleanGroup != null) r'boolean_group': booleanGroup, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearer_test', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'required_string_group': requiredStringGroup, + r'required_int64_group': requiredInt64Group, + if (stringGroup != null) r'string_group': stringGroup, + if (int64Group != null) r'int64_group': int64Group, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(requestBody); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/jsonFormData'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required List pipe, + required List ioutil, + required List http, + required List url, + required List context, + required String allowEmpty, + Map? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/test-query-parameters'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'pipe': pipe, + r'ioutil': ioutil, + r'http': http, + r'url': url, + r'context': context, + if (language != null) r'language': language, + r'allowEmpty': allowEmpty, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..56ec33f1cace --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class FakeClassnameTags123Api { + + final Dio _dio; + + const FakeClassnameTags123Api(this._dio); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClassname({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..ec20128ee1e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/pet_api.dart @@ -0,0 +1,727 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final Dio _dio; + + const PetApi(this._dio); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (apiKey != null) r'api_key': apiKey, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required List status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByStatus'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'status': status, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'List', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Set] as data + /// Throws [DioException] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required Set tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByTags'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'tags': tags, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Set? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Set', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioException] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Pet', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart new file mode 100644 index 000000000000..23e8deceaea8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/store_api.dart @@ -0,0 +1,303 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/order.dart'; + +class StoreApi { + + final Dio _dio; + + const StoreApi(this._dio); + + /// Delete purchase order by ID + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Map] as data + /// Throws [DioException] if API call or serialization fails + Future>> getInventory({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Map? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, int>(rawData, 'Map', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> getOrderById({ + required int orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> placeOrder({ + required Order order, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(order); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart new file mode 100644 index 000000000000..24bbeb48f746 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/api/user_api.dart @@ -0,0 +1,524 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/user.dart'; + +class UserApi { + + final Dio _dio; + + const UserApi(this._dio); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUser({ + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithArrayInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithArray'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithListInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithList'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioException] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'User', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/login'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'username': username, + r'password': password, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/logout'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart new file mode 100644 index 000000000000..8babb656e60e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -0,0 +1,186 @@ +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_get_default_response.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/user.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + + ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'AllOfWithSingleRef': + return AllOfWithSingleRef.fromJson(value as Map) as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'FakeBigDecimalMap200Response': + return FakeBigDecimalMap200Response.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FooGetDefaultResponse': + return FooGetDefaultResponse.fromJson(value as Map) as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + + + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) as ReturnType; + case 'OuterEnum': + + + case 'OuterEnumDefaultValue': + + + case 'OuterEnumInteger': + + + case 'OuterEnumIntegerDefaultValue': + + + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) as ReturnType; + case 'SingleRefType': + + + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); + } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..a3d4df084be5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'additional_properties_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AdditionalPropertiesClass { + /// Returns a new [AdditionalPropertiesClass] instance. + AdditionalPropertiesClass({ + + this.mapProperty, + + this.mapOfMapProperty, + }); + + @JsonKey( + + name: r'map_property', + required: false, + includeIfNull: false + ) + + + final Map? mapProperty; + + + + @JsonKey( + + name: r'map_of_map_property', + required: false, + includeIfNull: false + ) + + + final Map>? mapOfMapProperty; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => + mapProperty.hashCode + + mapOfMapProperty.hashCode; + + factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + + Map toJson() => _$AdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..b654a66733e9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'all_of_with_single_ref.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AllOfWithSingleRef { + /// Returns a new [AllOfWithSingleRef] instance. + AllOfWithSingleRef({ + + this.username, + + this.singleRefType, + }); + + @JsonKey( + + name: r'username', + required: false, + includeIfNull: false + ) + + + final String? username; + + + + @JsonKey( + + name: r'SingleRefType', + required: false, + includeIfNull: false + ) + + + final SingleRefType? singleRefType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; + + @override + int get hashCode => + username.hashCode + + singleRefType.hashCode; + + factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); + + Map toJson() => _$AllOfWithSingleRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart new file mode 100644 index 000000000000..22a196ce7d7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'animal.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Animal { + /// Returns a new [Animal] instance. + Animal({ + + required this.className, + + this.color = 'red', + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Animal && + other.className == className && + other.color == color; + + @override + int get hashCode => + className.hashCode + + color.hashCode; + + factory Animal.fromJson(Map json) => _$AnimalFromJson(json); + + Map toJson() => _$AnimalToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..c6700e2d39ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + + this.code, + + this.type, + + this.message, + }); + + @JsonKey( + + name: r'code', + required: false, + includeIfNull: false + ) + + + final int? code; + + + + @JsonKey( + + name: r'type', + required: false, + includeIfNull: false + ) + + + final String? type; + + + + @JsonKey( + + name: r'message', + required: false, + includeIfNull: false + ) + + + final String? message; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => + code.hashCode + + type.hashCode + + message.hashCode; + + factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..7372be1583f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_array_of_number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfArrayOfNumberOnly { + /// Returns a new [ArrayOfArrayOfNumberOnly] instance. + ArrayOfArrayOfNumberOnly({ + + this.arrayArrayNumber, + }); + + @JsonKey( + + name: r'ArrayArrayNumber', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => + arrayArrayNumber.hashCode; + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..d538bb312fde --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfNumberOnly { + /// Returns a new [ArrayOfNumberOnly] instance. + ArrayOfNumberOnly({ + + this.arrayNumber, + }); + + @JsonKey( + + name: r'ArrayNumber', + required: false, + includeIfNull: false + ) + + + final List? arrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && + other.arrayNumber == arrayNumber; + + @override + int get hashCode => + arrayNumber.hashCode; + + factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..30a6ec8a8b72 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + + this.arrayOfString, + + this.arrayArrayOfInteger, + + this.arrayArrayOfModel, + }); + + @JsonKey( + + name: r'array_of_string', + required: false, + includeIfNull: false + ) + + + final List? arrayOfString; + + + + @JsonKey( + + name: r'array_array_of_integer', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfInteger; + + + + @JsonKey( + + name: r'array_array_of_model', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfModel; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; + + factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..707cb05a040f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,135 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + + this.smallCamel, + + this.capitalCamel, + + this.smallSnake, + + this.capitalSnake, + + this.sCAETHFlowPoints, + + this.ATT_NAME, + }); + + @JsonKey( + + name: r'smallCamel', + required: false, + includeIfNull: false + ) + + + final String? smallCamel; + + + + @JsonKey( + + name: r'CapitalCamel', + required: false, + includeIfNull: false + ) + + + final String? capitalCamel; + + + + @JsonKey( + + name: r'small_Snake', + required: false, + includeIfNull: false + ) + + + final String? smallSnake; + + + + @JsonKey( + + name: r'Capital_Snake', + required: false, + includeIfNull: false + ) + + + final String? capitalSnake; + + + + @JsonKey( + + name: r'SCA_ETH_Flow_Points', + required: false, + includeIfNull: false + ) + + + final String? sCAETHFlowPoints; + + + + /// Name of the pet + @JsonKey( + + name: r'ATT_NAME', + required: false, + includeIfNull: false + ) + + + final String? ATT_NAME; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; + + factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart new file mode 100644 index 000000000000..0b176faf313e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'cat.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Cat { + /// Returns a new [Cat] instance. + Cat({ + + required this.className, + + this.color = 'red', + + this.declawed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + declawed.hashCode; + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + Map toJson() => _$CatToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..abb9dbc25e5f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'cat_all_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CatAllOf { + /// Returns a new [CatAllOf] instance. + CatAllOf({ + + this.declawed, + }); + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CatAllOf && + other.declawed == declawed; + + @override + int get hashCode => + declawed.hashCode; + + factory CatAllOf.fromJson(Map json) => _$CatAllOfFromJson(json); + + Map toJson() => _$CatAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart new file mode 100644 index 000000000000..b94c61579909 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'category.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Category { + /// Returns a new [Category] instance. + Category({ + + this.id, + + this.name = 'default-name', + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + defaultValue: 'default-name', + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Category && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; + + factory Category.fromJson(Map json) => _$CategoryFromJson(json); + + Map toJson() => _$CategoryToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart new file mode 100644 index 000000000000..01837bfcca96 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'class_model.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ClassModel { + /// Returns a new [ClassModel] instance. + ClassModel({ + + this.class_, + }); + + @JsonKey( + + name: r'_class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ClassModel && + other.class_ == class_; + + @override + int get hashCode => + class_.hashCode; + + factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + + Map toJson() => _$ClassModelToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..0151b72e23a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'deprecated_object.g.dart'; + + +@Deprecated('DeprecatedObject has been deprecated') +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DeprecatedObject { + /// Returns a new [DeprecatedObject] instance. + DeprecatedObject({ + + this.name, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && + other.name == name; + + @override + int get hashCode => + name.hashCode; + + factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + + Map toJson() => _$DeprecatedObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart new file mode 100644 index 000000000000..a049d0479fb0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'dog.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Dog { + /// Returns a new [Dog] instance. + Dog({ + + required this.className, + + this.color = 'red', + + this.breed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'breed', + required: false, + includeIfNull: false + ) + + + final String? breed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + breed.hashCode; + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + Map toJson() => _$DogToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..19bd4c0267be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'dog_all_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DogAllOf { + /// Returns a new [DogAllOf] instance. + DogAllOf({ + + this.breed, + }); + + @JsonKey( + + name: r'breed', + required: false, + includeIfNull: false + ) + + + final String? breed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DogAllOf && + other.breed == breed; + + @override + int get hashCode => + breed.hashCode; + + factory DogAllOf.fromJson(Map json) => _$DogAllOfFromJson(json); + + Map toJson() => _$DogAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..a97d069a3d25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -0,0 +1,92 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_arrays.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumArrays { + /// Returns a new [EnumArrays] instance. + EnumArrays({ + + this.justSymbol, + + this.arrayEnum, + }); + + @JsonKey( + + name: r'just_symbol', + required: false, + includeIfNull: false + ) + + + final EnumArraysJustSymbolEnum? justSymbol; + + + + @JsonKey( + + name: r'array_enum', + required: false, + includeIfNull: false + ) + + + final List? arrayEnum; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => + justSymbol.hashCode + + arrayEnum.hashCode; + + factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + + Map toJson() => _$EnumArraysToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumArraysJustSymbolEnum { + @JsonValue(r'>=') + greaterThanEqual, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumArraysArrayEnumEnum { + @JsonValue(r'fish') + fish, + @JsonValue(r'crab') + crab, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..80555c14d038 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -0,0 +1,218 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumTest { + /// Returns a new [EnumTest] instance. + EnumTest({ + + this.enumString, + + required this.enumStringRequired, + + this.enumInteger, + + this.enumNumber, + + this.outerEnum, + + this.outerEnumInteger, + + this.outerEnumDefaultValue, + + this.outerEnumIntegerDefaultValue, + }); + + @JsonKey( + + name: r'enum_string', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumStringEnum? enumString; + + + + @JsonKey( + + name: r'enum_string_required', + required: true, + includeIfNull: false + ) + + + final EnumTestEnumStringRequiredEnum enumStringRequired; + + + + @JsonKey( + + name: r'enum_integer', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumIntegerEnum? enumInteger; + + + + @JsonKey( + + name: r'enum_number', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumNumberEnum? enumNumber; + + + + @JsonKey( + + name: r'outerEnum', + required: false, + includeIfNull: false + ) + + + final OuterEnum? outerEnum; + + + + @JsonKey( + + name: r'outerEnumInteger', + required: false, + includeIfNull: false + ) + + + final OuterEnumInteger? outerEnumInteger; + + + + @JsonKey( + + name: r'outerEnumDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumDefaultValue? outerEnumDefaultValue; + + + + @JsonKey( + + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; + + factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + + Map toJson() => _$EnumTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumTestEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumStringRequiredEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-1) + numberNegative1, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumNumberEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart new file mode 100644 index 000000000000..965257f0a076 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fake_big_decimal_map200_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FakeBigDecimalMap200Response { + /// Returns a new [FakeBigDecimalMap200Response] instance. + FakeBigDecimalMap200Response({ + + this.someId, + + this.someMap, + }); + + @JsonKey( + + name: r'someId', + required: false, + includeIfNull: false + ) + + + final num? someId; + + + + @JsonKey( + + name: r'someMap', + required: false, + includeIfNull: false + ) + + + final Map? someMap; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && + other.someId == someId && + other.someMap == someMap; + + @override + int get hashCode => + someId.hashCode + + someMap.hashCode; + + factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); + + Map toJson() => _$FakeBigDecimalMap200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..bd2a9dc6f2fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/model_file.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'file_schema_test_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FileSchemaTestClass { + /// Returns a new [FileSchemaTestClass] instance. + FileSchemaTestClass({ + + this.file, + + this.files, + }); + + @JsonKey( + + name: r'file', + required: false, + includeIfNull: false + ) + + + final ModelFile? file; + + + + @JsonKey( + + name: r'files', + required: false, + includeIfNull: false + ) + + + final List? files; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => + file.hashCode + + files.hashCode; + + factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + + Map toJson() => _$FileSchemaTestClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..b43572d222cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + + this.bar = 'bar', + }); + + @JsonKey( + defaultValue: 'bar', + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Foo && + other.bar == bar; + + @override + int get hashCode => + bar.hashCode; + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart new file mode 100644 index 000000000000..acc1c60e4353 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_get_default_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooGetDefaultResponse { + /// Returns a new [FooGetDefaultResponse] instance. + FooGetDefaultResponse({ + + this.string, + }); + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final Foo? string; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && + other.string == string; + + @override + int get hashCode => + string.hashCode; + + factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); + + Map toJson() => _$FooGetDefaultResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..91b35595a34d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,302 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:dio/dio.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + + this.integer, + + this.int32, + + this.int64, + + required this.number, + + this.float, + + this.double_, + + this.decimal, + + this.string, + + required this.byte, + + this.binary, + + required this.date, + + this.dateTime, + + this.uuid, + + required this.password, + + this.patternWithDigits, + + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey( + + name: r'integer', + required: false, + includeIfNull: false + ) + + + final int? integer; + + + + // minimum: 20 + // maximum: 200 + @JsonKey( + + name: r'int32', + required: false, + includeIfNull: false + ) + + + final int? int32; + + + + @JsonKey( + + name: r'int64', + required: false, + includeIfNull: false + ) + + + final int? int64; + + + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey( + + name: r'number', + required: true, + includeIfNull: false + ) + + + final num number; + + + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey( + + name: r'float', + required: false, + includeIfNull: false + ) + + + final double? float; + + + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey( + + name: r'double', + required: false, + includeIfNull: false + ) + + + final double? double_; + + + + @JsonKey( + + name: r'decimal', + required: false, + includeIfNull: false + ) + + + final double? decimal; + + + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final String? string; + + + + @JsonKey( + + name: r'byte', + required: true, + includeIfNull: false + ) + + + final String byte; + + + + @JsonKey(ignore: true) + + + final MultipartFile? binary; + + + + @JsonKey( + + name: r'date', + required: true, + includeIfNull: false + ) + + + final DateTime date; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'password', + required: true, + includeIfNull: false + ) + + + final String password; + + + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey( + + name: r'pattern_with_digits', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigits; + + + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigitsAndDelimiter; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; + + factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..84c99fbc188c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'has_only_read_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HasOnlyReadOnly { + /// Returns a new [HasOnlyReadOnly] instance. + HasOnlyReadOnly({ + + this.bar, + + this.foo, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'foo', + required: false, + includeIfNull: false + ) + + + final String? foo; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && + other.bar == bar && + other.foo == foo; + + @override + int get hashCode => + bar.hashCode + + foo.hashCode; + + factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + + Map toJson() => _$HasOnlyReadOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..fcb2973b7514 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'health_check_result.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HealthCheckResult { + /// Returns a new [HealthCheckResult] instance. + HealthCheckResult({ + + this.nullableMessage, + }); + + @JsonKey( + + name: r'NullableMessage', + required: false, + includeIfNull: false + ) + + + final String? nullableMessage; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && + other.nullableMessage == nullableMessage; + + @override + int get hashCode => + (nullableMessage == null ? 0 : nullableMessage.hashCode); + + factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + + Map toJson() => _$HealthCheckResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart new file mode 100644 index 000000000000..9f1eefd4c1a3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/foo.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'inline_response_default.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class InlineResponseDefault { + /// Returns a new [InlineResponseDefault] instance. + InlineResponseDefault({ + + this.string, + }); + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final Foo? string; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is InlineResponseDefault && + other.string == string; + + @override + int get hashCode => + string.hashCode; + + factory InlineResponseDefault.fromJson(Map json) => _$InlineResponseDefaultFromJson(json); + + Map toJson() => _$InlineResponseDefaultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..7ab19eabd5cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + + this.mapMapOfString, + + this.mapOfEnumString, + + this.directMap, + + this.indirectMap, + }); + + @JsonKey( + + name: r'map_map_of_string', + required: false, + includeIfNull: false + ) + + + final Map>? mapMapOfString; + + + + @JsonKey( + + name: r'map_of_enum_string', + required: false, + includeIfNull: false + ) + + + final Map? mapOfEnumString; + + + + @JsonKey( + + name: r'direct_map', + required: false, + includeIfNull: false + ) + + + final Map? directMap; + + + + @JsonKey( + + name: r'indirect_map', + required: false, + includeIfNull: false + ) + + + final Map? indirectMap; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; + + factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum MapTestMapOfEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..e2e3cd0b857a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + + this.uuid, + + this.dateTime, + + this.map, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'map', + required: false, + includeIfNull: false + ) + + + final Map? map; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => + uuid.hashCode + + dateTime.hashCode + + map.hashCode; + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..346f1257555f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model200_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Model200Response { + /// Returns a new [Model200Response] instance. + Model200Response({ + + this.name, + + this.class_, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final int? name; + + + + @JsonKey( + + name: r'class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Model200Response && + other.name == name && + other.class_ == class_; + + @override + int get hashCode => + name.hashCode + + class_.hashCode; + + factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + + Map toJson() => _$Model200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart new file mode 100644 index 000000000000..14e22005a161 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_client.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelClient { + /// Returns a new [ModelClient] instance. + ModelClient({ + + this.client, + }); + + @JsonKey( + + name: r'client', + required: false, + includeIfNull: false + ) + + + final String? client; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelClient && + other.client == client; + + @override + int get hashCode => + client.hashCode; + + factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + + Map toJson() => _$ModelClientToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..8abf107d98e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum ModelEnumClass { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart new file mode 100644 index 000000000000..fe95e3ff0029 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_file.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelFile { + /// Returns a new [ModelFile] instance. + ModelFile({ + + this.sourceURI, + }); + + /// Test capitalization + @JsonKey( + + name: r'sourceURI', + required: false, + includeIfNull: false + ) + + + final String? sourceURI; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelFile && + other.sourceURI == sourceURI; + + @override + int get hashCode => + sourceURI.hashCode; + + factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + + Map toJson() => _$ModelFileToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart new file mode 100644 index 000000000000..543b79ac9f13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_list.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelList { + /// Returns a new [ModelList] instance. + ModelList({ + + this.n123list, + }); + + @JsonKey( + + name: r'123-list', + required: false, + includeIfNull: false + ) + + + final String? n123list; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelList && + other.n123list == n123list; + + @override + int get hashCode => + n123list.hashCode; + + factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + + Map toJson() => _$ModelListToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart new file mode 100644 index 000000000000..192b134d8fc6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_return.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelReturn { + /// Returns a new [ModelReturn] instance. + ModelReturn({ + + this.return_, + }); + + @JsonKey( + + name: r'return', + required: false, + includeIfNull: false + ) + + + final int? return_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelReturn && + other.return_ == return_; + + @override + int get hashCode => + return_.hashCode; + + factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + + Map toJson() => _$ModelReturnToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..6613fa3afc8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + + required this.name, + + this.snakeCase, + + this.property, + + this.n123number, + }); + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final int name; + + + + @JsonKey( + + name: r'snake_case', + required: false, + includeIfNull: false + ) + + + final int? snakeCase; + + + + @JsonKey( + + name: r'property', + required: false, + includeIfNull: false + ) + + + final String? property; + + + + @JsonKey( + + name: r'123Number', + required: false, + includeIfNull: false + ) + + + final int? n123number; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..897d489ba450 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,230 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + + this.integerProp, + + this.numberProp, + + this.booleanProp, + + this.stringProp, + + this.dateProp, + + this.datetimeProp, + + this.arrayNullableProp, + + this.arrayAndItemsNullableProp, + + this.arrayItemsNullable, + + this.objectNullableProp, + + this.objectAndItemsNullableProp, + + this.objectItemsNullable, + }); + + @JsonKey( + + name: r'integer_prop', + required: false, + includeIfNull: false + ) + + + final int? integerProp; + + + + @JsonKey( + + name: r'number_prop', + required: false, + includeIfNull: false + ) + + + final num? numberProp; + + + + @JsonKey( + + name: r'boolean_prop', + required: false, + includeIfNull: false + ) + + + final bool? booleanProp; + + + + @JsonKey( + + name: r'string_prop', + required: false, + includeIfNull: false + ) + + + final String? stringProp; + + + + @JsonKey( + + name: r'date_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? dateProp; + + + + @JsonKey( + + name: r'datetime_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? datetimeProp; + + + + @JsonKey( + + name: r'array_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayNullableProp; + + + + @JsonKey( + + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayAndItemsNullableProp; + + + + @JsonKey( + + name: r'array_items_nullable', + required: false, + includeIfNull: false + ) + + + final List? arrayItemsNullable; + + + + @JsonKey( + + name: r'object_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectNullableProp; + + + + @JsonKey( + + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectAndItemsNullableProp; + + + + @JsonKey( + + name: r'object_items_nullable', + required: false, + includeIfNull: false + ) + + + final Map? objectItemsNullable; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; + + factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart new file mode 100644 index 000000000000..3ca6bf704b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NumberOnly { + /// Returns a new [NumberOnly] instance. + NumberOnly({ + + this.justNumber, + }); + + @JsonKey( + + name: r'JustNumber', + required: false, + includeIfNull: false + ) + + + final num? justNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NumberOnly && + other.justNumber == justNumber; + + @override + int get hashCode => + justNumber.hashCode; + + factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + + Map toJson() => _$NumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..e4eb52631133 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'object_with_deprecated_fields.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ObjectWithDeprecatedFields { + /// Returns a new [ObjectWithDeprecatedFields] instance. + ObjectWithDeprecatedFields({ + + this.uuid, + + this.id, + + this.deprecatedRef, + + this.bars, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @Deprecated('id has been deprecated') + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final num? id; + + + + @Deprecated('deprecatedRef has been deprecated') + @JsonKey( + + name: r'deprecatedRef', + required: false, + includeIfNull: false + ) + + + final DeprecatedObject? deprecatedRef; + + + + @Deprecated('bars has been deprecated') + @JsonKey( + + name: r'bars', + required: false, + includeIfNull: false + ) + + + final List? bars; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + uuid.hashCode + + id.hashCode + + deprecatedRef.hashCode + + bars.hashCode; + + factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + + Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..54134b511316 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -0,0 +1,148 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + + this.id, + + this.petId, + + this.quantity, + + this.shipDate, + + this.status, + + this.complete = false, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'petId', + required: false, + includeIfNull: false + ) + + + final int? petId; + + + + @JsonKey( + + name: r'quantity', + required: false, + includeIfNull: false + ) + + + final int? quantity; + + + + @JsonKey( + + name: r'shipDate', + required: false, + includeIfNull: false + ) + + + final DateTime? shipDate; + + + + /// Order Status + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final OrderStatusEnum? status; + + + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false + ) + + + final bool? complete; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..f2509cb99213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + + this.myNumber, + + this.myString, + + this.myBoolean, + }); + + @JsonKey( + + name: r'my_number', + required: false, + includeIfNull: false + ) + + + final num? myNumber; + + + + @JsonKey( + + name: r'my_string', + required: false, + includeIfNull: false + ) + + + final String? myString; + + + + @JsonKey( + + name: r'my_boolean', + required: false, + includeIfNull: false + ) + + + final bool? myBoolean; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + + myString.hashCode + + myBoolean.hashCode; + + factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..514507968c66 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..0c8116edea96 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumDefaultValue { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..34268d0e9c53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumInteger { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..97b325938828 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumIntegerDefaultValue { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..76d18676a110 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_object_with_enum_property.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterObjectWithEnumProperty { + /// Returns a new [OuterObjectWithEnumProperty] instance. + OuterObjectWithEnumProperty({ + + required this.value, + }); + + @JsonKey( + + name: r'value', + required: true, + includeIfNull: false + ) + + + final OuterEnumInteger value; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && + other.value == value; + + @override + int get hashCode => + value.hashCode; + + factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + + Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..28d6294bae59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -0,0 +1,150 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + + this.id, + + this.category, + + required this.name, + + required this.photoUrls, + + this.tags, + + this.status, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'category', + required: false, + includeIfNull: false + ) + + + final Category? category; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @JsonKey( + + name: r'photoUrls', + required: true, + includeIfNull: false + ) + + + final Set photoUrls; + + + + @JsonKey( + + name: r'tags', + required: false, + includeIfNull: false + ) + + + final List? tags; + + + + /// pet status in the store + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final PetStatusEnum? status; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..c71c088f1381 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'read_only_first.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReadOnlyFirst { + /// Returns a new [ReadOnlyFirst] instance. + ReadOnlyFirst({ + + this.bar, + + this.baz, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'baz', + required: false, + includeIfNull: false + ) + + + final String? baz; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && + other.bar == bar && + other.baz == baz; + + @override + int get hashCode => + bar.hashCode + + baz.hashCode; + + factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + + Map toJson() => _$ReadOnlyFirstToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..ca56d9841a5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum SingleRefType { + @JsonValue(r'admin') + admin, + @JsonValue(r'user') + user, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..acd3ba099576 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'special_model_name.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialModelName { + /// Returns a new [SpecialModelName] instance. + SpecialModelName({ + + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + }); + + @JsonKey( + + name: r'$special[property.name]', + required: false, + includeIfNull: false + ) + + + final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; + + factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + + Map toJson() => _$SpecialModelNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart new file mode 100644 index 000000000000..d8a87eec1820 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'tag.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Tag { + /// Returns a new [Tag] instance. + Tag({ + + this.id, + + this.name, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Tag && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + Map toJson() => _$TagToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..62f132ce776d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart @@ -0,0 +1,167 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + + this.id, + + this.username, + + this.firstName, + + this.lastName, + + this.email, + + this.password, + + this.phone, + + this.userStatus, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'username', + required: false, + includeIfNull: false + ) + + + final String? username; + + + + @JsonKey( + + name: r'firstName', + required: false, + includeIfNull: false + ) + + + final String? firstName; + + + + @JsonKey( + + name: r'lastName', + required: false, + includeIfNull: false + ) + + + final String? lastName; + + + + @JsonKey( + + name: r'email', + required: false, + includeIfNull: false + ) + + + final String? email; + + + + @JsonKey( + + name: r'password', + required: false, + includeIfNull: false + ) + + + final String? password; + + + + @JsonKey( + + name: r'phone', + required: false, + includeIfNull: false + ) + + + final String? phone; + + + + /// User Status + @JsonKey( + + name: r'userStatus', + required: false, + includeIfNull: false + ) + + + final int? userStatus; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml new file mode 100644 index 000000000000..f7d20e4d37a7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + org.openapitools + DartDioPetstoreClientLibFakeJsonSerializableTests + pom + 1.0.0-SNAPSHOT + DartDio Petstore Client Lib Fake Json Serializable + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml new file mode 100644 index 000000000000..d005a785419f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -0,0 +1,16 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + json_annotation: '^4.4.0' + +dev_dependencies: + build_runner: any + json_serializable: '^6.1.5' + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..fd8299fb998f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + group(AdditionalPropertiesClass, () { + // Map mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // Map> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..ad5da909f6e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/all_of_with_single_ref_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AllOfWithSingleRef +void main() { + final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; + // TODO add properties to the entity + + group(AllOfWithSingleRef, () { + // String username + test('to test the property `username`', () async { + // TODO + }); + + // SingleRefType singleRefType + test('to test the property `singleRefType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart new file mode 100644 index 000000000000..83c65b22bfc3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/another_fake_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for AnotherFakeApi +void main() { + final instance = Openapi().getAnotherFakeApi(); + + group(AnotherFakeApi, () { + // To test special tags + // + // To test special tags and operation ID starting with number + // + //Future call123testSpecialTags(ModelClient modelClient) async + test('test call123testSpecialTags', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart new file mode 100644 index 000000000000..9487afd7f58c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final ApiResponse? instance = /* ApiResponse(...) */ null; + // TODO add properties to the entity + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..79c0d3f3bba8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfArrayOfNumberOnly, () { + // List> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..d80be97cf147 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfNumberOnly, () { + // List arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart new file mode 100644 index 000000000000..bfe7c84fd122 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final ArrayTest? instance = /* ArrayTest(...) */ null; + // TODO add properties to the entity + + group(ArrayTest, () { + // List arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // List> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // List> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart new file mode 100644 index 000000000000..156b0ee4993c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final Capitalization? instance = /* Capitalization(...) */ null; + // TODO add properties to the entity + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart new file mode 100644 index 000000000000..0a8811bd37f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart new file mode 100644 index 000000000000..0ed6921ae7fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final Category? instance = /* Category(...) */ null; + // TODO add properties to the entity + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: 'default-name') + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart new file mode 100644 index 000000000000..e2dda7bab74e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final ClassModel? instance = /* ClassModel(...) */ null; + // TODO add properties to the entity + + group(ClassModel, () { + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart new file mode 100644 index 000000000000..f079565f9785 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/default_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooGet() async + test('test fooGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart new file mode 100644 index 000000000000..1b2214668577 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; + // TODO add properties to the entity + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart new file mode 100644 index 000000000000..98097bd4bf25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart new file mode 100644 index 000000000000..30d12204ba17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final EnumArrays? instance = /* EnumArrays(...) */ null; + // TODO add properties to the entity + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // List arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart new file mode 100644 index 000000000000..befb9901ce9d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final EnumTest? instance = /* EnumTest(...) */ null; + // TODO add properties to the entity + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart new file mode 100644 index 000000000000..06418dfa53c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart @@ -0,0 +1,140 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // Health check endpoint + // + //Future fakeHealthGet() async + test('test fakeHealthGet', () async { + // TODO + }); + + // test http signature authentication + // + //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async + test('test fakeHttpSignatureTest', () async { + // TODO + }); + + // Test serialization of outer boolean types + // + //Future fakeOuterBooleanSerialize({ bool body }) async + test('test fakeOuterBooleanSerialize', () async { + // TODO + }); + + // Test serialization of object with outer number type + // + //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async + test('test fakeOuterCompositeSerialize', () async { + // TODO + }); + + // Test serialization of outer number types + // + //Future fakeOuterNumberSerialize({ num body }) async + test('test fakeOuterNumberSerialize', () async { + // TODO + }); + + // Test serialization of outer string types + // + //Future fakeOuterStringSerialize({ String body }) async + test('test fakeOuterStringSerialize', () async { + // TODO + }); + + // Test serialization of enum (int) properties with examples + // + //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async + test('test fakePropertyEnumIntegerSerialize', () async { + // TODO + }); + + // For this test, the body has to be a binary file. + // + //Future testBodyWithBinary(MultipartFile body) async + test('test testBodyWithBinary', () async { + // TODO + }); + + // For this test, the body for this request must reference a schema named `File`. + // + //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async + test('test testBodyWithFileSchema', () async { + // TODO + }); + + //Future testBodyWithQueryParams(String query, User user) async + test('test testBodyWithQueryParams', () async { + // TODO + }); + + // To test \"client\" model + // + // To test \"client\" model + // + //Future testClientModel(ModelClient modelClient) async + test('test testClientModel', () async { + // TODO + }); + + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async + test('test testEndpointParameters', () async { + // TODO + }); + + // To test enum parameters + // + // To test enum parameters + // + //Future testEnumParameters({ List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString }) async + test('test testEnumParameters', () async { + // TODO + }); + + // Fake endpoint to test group parameters (optional) + // + // Fake endpoint to test group parameters (optional) + // + //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async + test('test testGroupParameters', () async { + // TODO + }); + + // test inline additionalProperties + // + // + // + //Future testInlineAdditionalProperties(Map requestBody) async + test('test testInlineAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // To test the collection format in query parameters + // + //Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async + test('test testQueryParameterCollectionFormat', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_big_decimal_map200_response_test.dart new file mode 100644 index 000000000000..1279b8d0ff25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_big_decimal_map200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FakeBigDecimalMap200Response +void main() { + final FakeBigDecimalMap200Response? instance = /* FakeBigDecimalMap200Response(...) */ null; + // TODO add properties to the entity + + group(FakeBigDecimalMap200Response, () { + // num someId + test('to test the property `someId`', () async { + // TODO + }); + + // Map someMap + test('to test the property `someMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_classname_tags123_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeClassnameTags123Api +void main() { + final instance = Openapi().getFakeClassnameTags123Api(); + + group(FakeClassnameTags123Api, () { + // To test class name in snake case + // + // To test class name in snake case + // + //Future testClassname(ModelClient modelClient) async + test('test testClassname', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..2ccd0d450ce7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; + // TODO add properties to the entity + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // List files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart new file mode 100644 index 000000000000..4282326fe61f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_get_default_response_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooGetDefaultResponse +void main() { + final FooGetDefaultResponse? instance = /* FooGetDefaultResponse(...) */ null; + // TODO add properties to the entity + + group(FooGetDefaultResponse, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..28ae9a5b5e13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/foo_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String bar (default value: 'bar') + test('to test the property `bar`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart new file mode 100644 index 000000000000..b08838d81a37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final FormatTest? instance = /* FormatTest(...) */ null; + // TODO add properties to the entity + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // MultipartFile binary + test('to test the property `binary`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // A string that is a 10 digit number. Can have leading zeros. + // String patternWithDigits + test('to test the property `patternWithDigits`', () async { + // TODO + }); + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + // String patternWithDigitsAndDelimiter + test('to test the property `patternWithDigitsAndDelimiter`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..d72429a31bb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; + // TODO add properties to the entity + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart new file mode 100644 index 000000000000..b2b48337b76c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; + // TODO add properties to the entity + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart new file mode 100644 index 000000000000..909415df7540 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final MapTest? instance = /* MapTest(...) */ null; + // TODO add properties to the entity + + group(MapTest, () { + // Map> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // Map mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // Map directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // Map indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..0115f01ed6be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // Map map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart new file mode 100644 index 000000000000..de8cf3037b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final Model200Response? instance = /* Model200Response(...) */ null; + // TODO add properties to the entity + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart new file mode 100644 index 000000000000..44faf62f15b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final ModelClient? instance = /* ModelClient(...) */ null; + // TODO add properties to the entity + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_enum_class_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + + group(ModelEnumClass, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart new file mode 100644 index 000000000000..8ea65f6ccb41 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final ModelFile? instance = /* ModelFile(...) */ null; + // TODO add properties to the entity + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart new file mode 100644 index 000000000000..f748eee993ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final ModelList? instance = /* ModelList(...) */ null; + // TODO add properties to the entity + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart new file mode 100644 index 000000000000..cfc17807c151 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final ModelReturn? instance = /* ModelReturn(...) */ null; + // TODO add properties to the entity + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart new file mode 100644 index 000000000000..4f3f7f633728 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final Name? instance = /* Name(...) */ null; + // TODO add properties to the entity + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart new file mode 100644 index 000000000000..0ab76167983b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final NullableClass? instance = /* NullableClass(...) */ null; + // TODO add properties to the entity + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // DateTime dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // List arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // List arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // List arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // Map objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // Map objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // Map objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart new file mode 100644 index 000000000000..12b19c59dfb7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final NumberOnly? instance = /* NumberOnly(...) */ null; + // TODO add properties to the entity + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..e197bd0ad807 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + // TODO add properties to the entity + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // List bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart new file mode 100644 index 000000000000..45b02097daed --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final Order? instance = /* Order(...) */ null; + // TODO add properties to the entity + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart new file mode 100644 index 000000000000..a5f0172ba21c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final OuterComposite? instance = /* OuterComposite(...) */ null; + // TODO add properties to the entity + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + + group(OuterEnumDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + + group(OuterEnumIntegerDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_integer_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + + group(OuterEnumInteger, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_enum_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + + group(OuterEnum, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..3d72c6188e17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + // TODO add properties to the entity + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart new file mode 100644 index 000000000000..85a28bcfbe53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_api_test.dart @@ -0,0 +1,92 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PetApi +void main() { + final instance = Openapi().getPetApi(); + + group(PetApi, () { + // Add a new pet to the store + // + // + // + //Future addPet(Pet pet) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + // + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(Set tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + // + // + //Future updatePet(Pet pet) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + // + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + // + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + // uploads an image (required) + // + // + // + //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async + test('test uploadFileWithRequiredFile', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart new file mode 100644 index 000000000000..20b5e3e06735 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final Pet? instance = /* Pet(...) */ null; + // TODO add properties to the entity + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Set photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart new file mode 100644 index 000000000000..bcefd75befb6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; + // TODO add properties to the entity + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/single_ref_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + + group(SingleRefType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart new file mode 100644 index 000000000000..23b58324ef99 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final SpecialModelName? instance = /* SpecialModelName(...) */ null; + // TODO add properties to the entity + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart new file mode 100644 index 000000000000..08f7f738043b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/store_api_test.dart @@ -0,0 +1,47 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for StoreApi +void main() { + final instance = Openapi().getStoreApi(); + + group(StoreApi, () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + // + // + //Future placeOrder(Order order) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart new file mode 100644 index 000000000000..ffe49b3179c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final Tag? instance = /* Tag(...) */ null; + // TODO add properties to the entity + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart new file mode 100644 index 000000000000..4bf28b67623b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_api_test.dart @@ -0,0 +1,83 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for UserApi +void main() { + final instance = Openapi().getUserApi(); + + group(UserApi, () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User user) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithArrayInput(List user) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithListInput(List user) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + // + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + // + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + // + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User user) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart new file mode 100644 index 000000000000..847b14196b93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final User? instance = /* User(...) */ null; + // TODO add properties to the entity + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES new file mode 100644 index 000000000000..1172e4bb425f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -0,0 +1,123 @@ +.gitignore +README.md +analysis_options.yaml +doc/AdditionalPropertiesClass.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Capitalization.md +doc/Cat.md +doc/Category.md +doc/ClassModel.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/Dog.md +doc/EnumArrays.md +doc/EnumTest.md +doc/FakeApi.md +doc/FakeBigDecimalMap200Response.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooGetDefaultResponse.md +doc/FormatTest.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Pet.md +doc/PetApi.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/another_fake_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/api_util.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/date_serializer.dart +lib/src/model/additional_properties_class.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/date.dart +lib/src/model/deprecated_object.dart +lib/src/model/dog.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/fake_big_decimal_map200_response.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_get_default_response.dart +lib/src/model/format_test.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/pet.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +lib/src/serializers.dart +pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md new file mode 100644 index 000000000000..db7ed486d769 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -0,0 +1,203 @@ +# openapi (EXPERIMENTAL) +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = await api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | +[*FakeApi*](doc/FakeApi.md) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [Category](doc/Category.md) + - [ClassModel](doc/ClassModel.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [Dog](doc/Dog.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooGetDefaultResponse](doc/FooGetDefaultResponse.md) + - [FormatTest](doc/FormatTest.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.md) + - [MapTest](doc/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc/Model200Response.md) + - [ModelClient](doc/ModelClient.md) + - [ModelEnumClass](doc/ModelEnumClass.md) + - [ModelFile](doc/ModelFile.md) + - [ModelList](doc/ModelList.md) + - [ModelReturn](doc/ModelReturn.md) + - [Name](doc/Name.md) + - [NullableClass](doc/NullableClass.md) + - [NumberOnly](doc/NumberOnly.md) + - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [Order](doc/Order.md) + - [OuterComposite](doc/OuterComposite.md) + - [OuterEnum](doc/OuterEnum.md) + - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Pet](doc/Pet.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### bearer_test + +- **Type**: HTTP Bearer Token authentication (JWT) + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml new file mode 100644 index 000000000000..139ad7abf559 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/analysis_options.yaml @@ -0,0 +1,11 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + errors: + deprecated_member_use_from_same_package: ignore 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 new file mode 100644 index 000000000000..f9f7857894d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **BuiltMap<String, String>** | | [optional] +**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AllOfWithSingleRef.md @@ -0,0 +1,16 @@ +# openapi.model.AllOfWithSingleRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..36a94e6bb703 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# openapi.api.AnotherFakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call123testSpecialTags** +> ModelClient call123testSpecialTags(modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..d1a272ab6023 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..94b60f272fd4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **BuiltList<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..0813d4fa93c6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **BuiltList<String>** | | [optional] +**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] +**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md new file mode 100644 index 000000000000..36b2ae0e8ab3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.CatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [default to 'default-name'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md new file mode 100644 index 000000000000..9b80d4f71eea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classField** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..6abd2b44f9c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DefaultApi.md @@ -0,0 +1,51 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | + + +# **fooGet** +> FooGetDefaultResponse fooGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->fooGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md new file mode 100644 index 000000000000..97a7c8fba492 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.DogAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..06170bb8f51d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **BuiltList<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..da73b9acb516 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -0,0 +1,856 @@ +# openapi.api.FakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeBigDecimalMap**](FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap | +[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | + + +# **fakeBigDecimalMap** +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeBigDecimalMap(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeBigDecimalMap: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeHealthGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHealthGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeHttpSignatureTest(pet, query1, header1); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterBooleanSerialize** +> bool fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final bool body = true; // bool | Input boolean as post body + +try { + final response = api.fakeOuterBooleanSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body + +try { + final response = api.fakeOuterCompositeSerialize(outerComposite); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterNumberSerialize** +> num fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final num body = 8.14; // num | Input number as post body + +try { + final response = api.fakeOuterNumberSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **num**| Input number as post body | [optional] + +### Return type + +**num** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String body = body_example; // String | Input string as post body + +try { + final response = api.fakeOuterStringSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakePropertyEnumIntegerSerialize** +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body + +try { + final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithBinary** +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload + +try { + api.testBodyWithBinary(body); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **MultipartFile**| image to upload | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: image/png + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | + +try { + api.testBodyWithFileSchema(fileSchemaTestClass); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String query = query_example; // String | +final User user = ; // User | + +try { + api.testBodyWithQueryParams(query, user); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testClientModel** +> ModelClient testClientModel(modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClientModel(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->testClientModel: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEndpointParameters** +> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: http_basic_test +//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final num number = 8.14; // num | None +final double double_ = 1.2; // double | None +final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None +final String byte = BYTE_ARRAY_DATA_HERE; // String | None +final int integer = 56; // int | None +final int int32 = 56; // int | None +final int int64 = 789; // int | None +final double float = 3.4; // double | None +final String string = string_example; // String | None +final Uint8List binary = BINARY_DATA_HERE; // Uint8List | None +final Date date = 2013-10-20; // Date | None +final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None +final String password = password_example; // String | None +final String callback = callback_example; // String | None + +try { + api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEndpointParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **num**| None | + **double_** | **double**| None | + **patternWithoutDelimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **double**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **Uint8List**| None | [optional] + **date** | **Date**| None | [optional] + **dateTime** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final BuiltList enumHeaderStringArray = ; // BuiltList | Header parameter enum test (string array) +final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) +final BuiltList enumQueryStringArray = ; // BuiltList | Query parameter enum test (string array) +final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) +final int enumQueryInteger = 56; // int | Query parameter enum test (double) +final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) +final BuiltList enumQueryModelArray = ; // BuiltList | +final BuiltList enumFormStringArray = ; // BuiltList | Form parameter enum test (string array) +final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) + +try { + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEnumParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] + **enumQueryModelArray** | [**BuiltList<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final int requiredStringGroup = 56; // int | Required String in group parameters +final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters +final int requiredInt64Group = 789; // int | Required Integer in group parameters +final int stringGroup = 56; // int | String in group parameters +final bool booleanGroup = true; // bool | Boolean in group parameters +final int int64Group = 789; // int | Integer in group parameters + +try { + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); +} catch on DioException (e) { + print('Exception when calling FakeApi->testGroupParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **int**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final BuiltMap requestBody = ; // BuiltMap | request body + +try { + api.testInlineAdditionalProperties(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**BuiltMap<String, String>**](String.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String param = param_example; // String | field1 +final String param2 = param2_example; // String | field2 + +try { + api.testJsonFormData(param, param2); +} catch on DioException (e) { + print('Exception when calling FakeApi->testJsonFormData: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final BuiltList pipe = ; // BuiltList | +final BuiltList ioutil = ; // BuiltList | +final BuiltList http = ; // BuiltList | +final BuiltList url = ; // BuiltList | +final BuiltList context = ; // BuiltList | +final String allowEmpty = allowEmpty_example; // String | +final BuiltMap language = ; // BuiltMap | + +try { + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); +} catch on DioException (e) { + print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**BuiltList<String>**](String.md)| | + **ioutil** | [**BuiltList<String>**](String.md)| | + **http** | [**BuiltList<String>**](String.md)| | + **url** | [**BuiltList<String>**](String.md)| | + **context** | [**BuiltList<String>**](String.md)| | + **allowEmpty** | **String**| | + **language** | [**BuiltMap<String, String>**](String.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..cedb487c954d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeBigDecimalMap200Response.md @@ -0,0 +1,16 @@ +# openapi.model.FakeBigDecimalMap200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**someId** | **num** | | [optional] +**someMap** | **BuiltMap<String, num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..645aebf399f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# openapi.api.FakeClassnameTags123Api + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> ModelClient testClassname(modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key_query +//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getFakeClassnameTags123Api(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClassname(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/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 new file mode 100644 index 000000000000..105fece87f1d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**BuiltList<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md new file mode 100644 index 000000000000..185b76e3f5b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Foo.md @@ -0,0 +1,15 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [default to 'bar'] + +[[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/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md new file mode 100644 index 000000000000..10d0133abd95 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FooGetDefaultResponse.md @@ -0,0 +1,15 @@ +# openapi.model.FooGetDefaultResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md new file mode 100644 index 000000000000..f811264ca2ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**Uint8List**](Uint8List.md) | | [optional] +**date** | [**Date**](Date.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md new file mode 100644 index 000000000000..c5e61e1162bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md @@ -0,0 +1,15 @@ +# openapi.model.InlineResponseDefault + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md new file mode 100644 index 000000000000..4ad87df64232 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] +**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] +**directMap** | **BuiltMap<String, bool>** | | [optional] +**indirectMap** | **BuiltMap<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..b1a4c4ccc401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md new file mode 100644 index 000000000000..e8b088ca1afa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**classField** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..4ce8d5e17576 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**Date**](Date.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] +**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..3e7848d382c2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | **BuiltList<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..08e0aeedd784 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **BuiltSet<String>** | | +**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..2b7766eb60d4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/PetApi.md @@ -0,0 +1,439 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.addPet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->addPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | Pet id to delete +final String apiKey = apiKey_example; // String | + +try { + api.deletePet(petId, apiKey); +} catch on DioException (e) { + print('Exception when calling PetApi->deletePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> BuiltList findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final BuiltList status = ; // BuiltList | Status values that need to be considered for filter + +try { + final response = api.findPetsByStatus(status); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByStatus: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**BuiltList<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> BuiltSet findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final BuiltSet tags = ; // BuiltSet | Tags to filter by + +try { + final response = api.findPetsByTags(tags); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by | + +### Return type + +[**BuiltSet<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to return + +try { + final response = api.getPetById(petId); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->getPetById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(pet) + +Update an existing pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.updatePet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet that needs to be updated +final String name = name_example; // String | Updated name of the pet +final String status = status_example; // String | Updated status of the pet + +try { + api.updatePetWithForm(petId, name, status); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePetWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + final response = api.uploadFile(petId, additionalMetadata, file); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server + +try { + final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **requiredFile** | **MultipartFile**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SingleRefType.md @@ -0,0 +1,14 @@ +# openapi.model.SingleRefType + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..3616fd734377 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/StoreApi.md @@ -0,0 +1,188 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final String orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api.deleteOrder(orderId); +} catch on DioException (e) { + print('Exception when calling StoreApi->deleteOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> BuiltMap getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getStoreApi(); + +try { + final response = api.getInventory(); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getInventory: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**BuiltMap<String, int>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final int orderId = 789; // int | ID of pet that needs to be fetched + +try { + final response = api.getOrderById(orderId); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final Order order = ; // Order | order placed for purchasing the pet + +try { + final response = api.placeOrder(order); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->placeOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/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 new file mode 100644 index 000000000000..571896708968 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/UserApi.md @@ -0,0 +1,359 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final User user = ; // User | Created user object + +try { + api.createUser(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final BuiltList user = ; // BuiltList | List of user object + +try { + api.createUsersWithArrayInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**BuiltList<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final BuiltList user = ; // BuiltList | List of user object + +try { + api.createUsersWithListInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**BuiltList<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be deleted + +try { + api.deleteUser(username); +} catch on DioException (e) { + print('Exception when calling UserApi->deleteUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + final response = api.getUserByName(username); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->getUserByName: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The user name for login +final String password = password_example; // String | The password for login in clear text + +try { + final response = api.loginUser(username, password); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->loginUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); + +try { + api.logoutUser(); +} catch on DioException (e) { + print('Exception when calling UserApi->logoutUser: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | name that need to be deleted +final User user = ; // User | Updated user object + +try { + api.updateUser(username, user); +} catch on DioException (e) { + print('Exception when calling UserApi->updateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart new file mode 100644 index 000000000000..76140c466d31 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; +export 'package:openapi/src/serializers.dart'; +export 'package:openapi/src/model/date.dart'; + +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_get_default_response.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart new file mode 100644 index 000000000000..53d0c5a524bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/serializers.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/another_fake_api.dart'; +import 'package:openapi/src/api/default_api.dart'; +import 'package:openapi/src/api/fake_api.dart'; +import 'package:openapi/src/api/fake_classname_tags123_api.dart'; +import 'package:openapi/src/api/pet_api.dart'; +import 'package:openapi/src/api/store_api.dart'; +import 'package:openapi/src/api/user_api.dart'; + +class Openapi { + static const String basePath = r'http://petstore.swagger.io:80/v2'; + + final Dio dio; + final Serializers serializers; + + Openapi({ + Dio? dio, + Serializers? serializers, + String? basePathOverride, + List? interceptors, + }) : this.serializers = serializers ?? standardSerializers, + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + AnotherFakeApi getAnotherFakeApi() { + return AnotherFakeApi(dio, serializers); + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio, serializers); + } + + /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeApi getFakeApi() { + return FakeApi(dio, serializers); + } + + /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeClassnameTags123Api getFakeClassnameTags123Api() { + return FakeClassnameTags123Api(dio, serializers); + } + + /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PetApi getPetApi() { + return PetApi(dio, serializers); + } + + /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + StoreApi getStoreApi() { + return StoreApi(dio, serializers); + } + + /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + UserApi getUserApi() { + return UserApi(dio, serializers); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..37e9fdd31c7d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/another_fake_api.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class AnotherFakeApi { + + final Dio _dio; + + final Serializers _serializers; + + const AnotherFakeApi(this._dio, this._serializers); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> call123testSpecialTags({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(ModelClient); + _bodyData = _serializers.serialize(modelClient, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ModelClient), + ) as ModelClient; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart new file mode 100644 index 000000000000..2646f8a0b330 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/default_api.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/foo_get_default_response.dart'; + +class DefaultApi { + + final Dio _dio; + + final Serializers _serializers; + + const DefaultApi(this._dio, this._serializers); + + /// fooGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> fooGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooGetDefaultResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(FooGetDefaultResponse), + ) as FooGetDefaultResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..de710128f4ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -0,0 +1,1519 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'dart:typed_data'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/date.dart'; +import 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/user.dart'; + +class FakeApi { + + final Dio _dio; + + final Serializers _serializers; + + const FakeApi(this._dio, this._serializers); + + /// fakeBigDecimalMap + /// for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FakeBigDecimalMap200Response] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeBigDecimalMap({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/BigDecimalMap'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FakeBigDecimalMap200Response? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(FakeBigDecimalMap200Response), + ) as FakeBigDecimalMap200Response; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeHealthGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + HealthCheckResult? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(HealthCheckResult), + ) as HealthCheckResult; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> fakeHttpSignatureTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + bool? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : rawResponse as bool; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + OuterComposite? outerComposite, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(OuterComposite); + _bodyData = outerComposite == null ? null : _serializers.serialize(outerComposite, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(OuterComposite), + ) as OuterComposite; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + num? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : rawResponse as num; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/string'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = body; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : rawResponse as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioException] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/property/enum-int'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(OuterObjectWithEnumProperty); + _bodyData = _serializers.serialize(outerObjectWithEnumProperty, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(OuterObjectWithEnumProperty), + ) as OuterObjectWithEnumProperty; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-binary'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'image/png', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = body?.finalize(); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-file-schema'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(FileSchemaTestClass); + _bodyData = _serializers.serialize(fileSchemaTestClass, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-query-params'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'query': encodeQueryParameter(_serializers, query, const FullType(String)), + }; + + dynamic _bodyData; + + try { + const _type = FullType(User); + _bodyData = _serializers.serialize(user, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(ModelClient); + _bodyData = _serializers.serialize(modelClient, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ModelClient), + ) as ModelClient; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + Uint8List? binary, + Date? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'basic', + 'name': 'http_basic_test', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = { + if (integer != null) r'integer': encodeQueryParameter(_serializers, integer, const FullType(int)), + if (int32 != null) r'int32': encodeQueryParameter(_serializers, int32, const FullType(int)), + if (int64 != null) r'int64': encodeQueryParameter(_serializers, int64, const FullType(int)), + r'number': encodeQueryParameter(_serializers, number, const FullType(num)), + if (float != null) r'float': encodeQueryParameter(_serializers, float, const FullType(double)), + r'double': encodeQueryParameter(_serializers, double_, const FullType(double)), + if (string != null) r'string': encodeQueryParameter(_serializers, string, const FullType(String)), + r'pattern_without_delimiter': encodeQueryParameter(_serializers, patternWithoutDelimiter, const FullType(String)), + r'byte': encodeQueryParameter(_serializers, byte, const FullType(String)), + if (binary != null) r'binary': encodeQueryParameter(_serializers, binary, const FullType(Uint8List)), + if (date != null) r'date': encodeQueryParameter(_serializers, date, const FullType(Date)), + if (dateTime != null) r'dateTime': encodeQueryParameter(_serializers, dateTime, const FullType(DateTime)), + if (password != null) r'password': encodeQueryParameter(_serializers, password, const FullType(String)), + if (callback != null) r'callback': encodeQueryParameter(_serializers, callback, const FullType(String)), + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEnumParameters({ + BuiltList? enumHeaderStringArray, + String? enumHeaderString = '-efg', + BuiltList? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + BuiltList? enumQueryModelArray, + BuiltList? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'GET', + headers: { + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (enumQueryStringArray != null) r'enum_query_string_array': encodeCollectionQueryParameter(_serializers, enumQueryStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), + if (enumQueryString != null) r'enum_query_string': encodeQueryParameter(_serializers, enumQueryString, const FullType(String)), + if (enumQueryInteger != null) r'enum_query_integer': encodeQueryParameter(_serializers, enumQueryInteger, const FullType(int)), + if (enumQueryDouble != null) r'enum_query_double': encodeQueryParameter(_serializers, enumQueryDouble, const FullType(double)), + if (enumQueryModelArray != null) r'enum_query_model_array': encodeCollectionQueryParameter(_serializers, enumQueryModelArray, const FullType(BuiltList, [FullType(ModelEnumClass)]), format: ListFormat.multi,), + }; + + dynamic _bodyData; + + try { + _bodyData = { + if (enumFormStringArray != null) r'enum_form_string_array': encodeCollectionQueryParameter(_serializers, enumFormStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), + if (enumFormString != null) r'enum_form_string': encodeQueryParameter(_serializers, enumFormString, const FullType(String)), + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'DELETE', + headers: { + r'required_boolean_group': requiredBooleanGroup, + if (booleanGroup != null) r'boolean_group': booleanGroup, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearer_test', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'required_string_group': encodeQueryParameter(_serializers, requiredStringGroup, const FullType(int)), + r'required_int64_group': encodeQueryParameter(_serializers, requiredInt64Group, const FullType(int)), + if (stringGroup != null) r'string_group': encodeQueryParameter(_serializers, stringGroup, const FullType(int)), + if (int64Group != null) r'int64_group': encodeQueryParameter(_serializers, int64Group, const FullType(int)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required BuiltMap requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(BuiltMap, [FullType(String), FullType(String)]); + _bodyData = _serializers.serialize(requestBody, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/jsonFormData'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = { + r'param': encodeQueryParameter(_serializers, param, const FullType(String)), + r'param2': encodeQueryParameter(_serializers, param2, const FullType(String)), + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required BuiltList pipe, + required BuiltList ioutil, + required BuiltList http, + required BuiltList url, + required BuiltList context, + required String allowEmpty, + BuiltMap? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/test-query-parameters'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'pipe': encodeCollectionQueryParameter(_serializers, pipe, const FullType(BuiltList, [FullType(String)]), format: ListFormat.pipes,), + r'ioutil': encodeCollectionQueryParameter(_serializers, ioutil, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), + r'http': encodeCollectionQueryParameter(_serializers, http, const FullType(BuiltList, [FullType(String)]), format: ListFormat.ssv,), + r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), + r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), + if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), + r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..466b9356ee06 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,122 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class FakeClassnameTags123Api { + + final Dio _dio; + + final Serializers _serializers; + + const FakeClassnameTags123Api(this._dio, this._serializers); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClassname({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(ModelClient); + _bodyData = _serializers.serialize(modelClient, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ModelClient), + ) as ModelClient; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..aad1031369c7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/pet_api.dart @@ -0,0 +1,765 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final Dio _dio; + + final Serializers _serializers; + + const PetApi(this._dio, this._serializers); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (apiKey != null) r'api_key': apiKey, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltList] as data + /// Throws [DioException] if API call or serialization fails + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required BuiltList status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByStatus'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'status': encodeCollectionQueryParameter(_serializers, status, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltList? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(BuiltList, [FullType(Pet)]), + ) as BuiltList; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltSet] as data + /// Throws [DioException] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required BuiltSet tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByTags'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'tags': encodeCollectionQueryParameter(_serializers, tags, const FullType(BuiltSet, [FullType(String)]), format: ListFormat.csv,), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltSet? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(BuiltSet, [FullType(Pet)]), + ) as BuiltSet; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioException] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Pet), + ) as Pet; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Pet); + _bodyData = _serializers.serialize(pet, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = { + if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)), + if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)), + }; + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), + if (file != null) r'file': file, + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ApiResponse), + ) as ApiResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = FormData.fromMap({ + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), + r'requiredFile': requiredFile, + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ApiResponse), + ) as ApiResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart new file mode 100644 index 000000000000..46bb2237d4c5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/store_api.dart @@ -0,0 +1,319 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/order.dart'; + +class StoreApi { + + final Dio _dio; + + final Serializers _serializers; + + const 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 + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [BuiltMap] as data + /// Throws [DioException] if API call or serialization fails + Future>> getInventory({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BuiltMap? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(int)]), + ) as BuiltMap; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> getOrderById({ + required int orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(int)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Order), + ) as Order; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> placeOrder({ + required Order order, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(Order); + _bodyData = _serializers.serialize(order, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(Order), + ) as Order; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart new file mode 100644 index 000000000000..b4f78fd687bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api/user_api.dart @@ -0,0 +1,539 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:openapi/src/model/user.dart'; + +class UserApi { + + final Dio _dio; + + final Serializers _serializers; + + const UserApi(this._dio, this._serializers); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUser({ + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(User); + _bodyData = _serializers.serialize(user, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithArrayInput({ + required BuiltList user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithArray'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(BuiltList, [FullType(User)]); + _bodyData = _serializers.serialize(user, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithListInput({ + required BuiltList user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithList'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(BuiltList, [FullType(User)]); + _bodyData = _serializers.serialize(user, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioException] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(User), + ) as User; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/login'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'username': encodeQueryParameter(_serializers, username, const FullType(String)), + r'password': encodeQueryParameter(_serializers, password, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : rawResponse as String; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/logout'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(User); + _bodyData = _serializers.serialize(user, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart new file mode 100644 index 000000000000..ed3bb12f25b8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/api_util.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized is String) { + return serialized; + } + if (value is BuiltList || value is BuiltSet || value is BuiltMap) { + return serialized; + } + return json.encode(serialized); +} + +dynamic encodeQueryParameter( + Serializers serializers, + dynamic value, + FullType type, +) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (serialized == null) { + return ''; + } + if (serialized is String) { + return serialized; + } + return serialized; +} + +ListParam encodeCollectionQueryParameter( + Serializers serializers, + dynamic value, + FullType type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = serializers.serialize( + value as Object, + specifiedType: type, + ); + if (value is BuiltList || value is BuiltSet) { + return ListParam(List.of((serialized as Iterable).cast()), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart new file mode 100644 index 000000000000..db3c5c437db1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/date_serializer.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +class DateSerializer implements PrimitiveSerializer { + + const DateSerializer(); + + @override + Iterable get types => BuiltList.of([Date]); + + @override + String get wireName => 'Date'; + + @override + Date deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final parsed = DateTime.parse(serialized as String); + return Date(parsed.year, parsed.month, parsed.day); + } + + @override + Object serialize(Serializers serializers, Date date, + {FullType specifiedType = FullType.unspecified}) { + return date.toString(); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..3fdac6d5a44f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/additional_properties_class.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'additional_properties_class.g.dart'; + +/// AdditionalPropertiesClass +/// +/// Properties: +/// * [mapProperty] +/// * [mapOfMapProperty] +@BuiltValue() +abstract class AdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'map_property') + BuiltMap? get mapProperty; + + @BuiltValueField(wireName: r'map_of_map_property') + BuiltMap>? get mapOfMapProperty; + + AdditionalPropertiesClass._(); + + factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); +} + +class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; + + @override + final String wireName = r'AdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapProperty != null) { + yield r'map_property'; + yield serializers.serialize( + object.mapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ); + } + if (object.mapOfMapProperty != null) { + yield r'map_of_map_property'; + yield serializers.serialize( + object.mapOfMapProperty, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + ) as BuiltMap; + result.mapProperty.replace(valueDes); + break; + case r'map_of_map_property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapOfMapProperty.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..5bcd7d9dee8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'all_of_with_single_ref.g.dart'; + +/// AllOfWithSingleRef +/// +/// Properties: +/// * [username] +/// * [singleRefType] +@BuiltValue() +abstract class AllOfWithSingleRef implements Built { + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'SingleRefType') + SingleRefType? get singleRefType; + // enum singleRefTypeEnum { admin, user, }; + + AllOfWithSingleRef._(); + + factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = _$AllOfWithSingleRef; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(AllOfWithSingleRefBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AllOfWithSingleRefSerializer(); +} + +class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; + + @override + final String wireName = r'AllOfWithSingleRef'; + + Iterable _serializeProperties( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.singleRefType != null) { + yield r'SingleRefType'; + yield serializers.serialize( + object.singleRefType, + specifiedType: const FullType(SingleRefType), + ); + } + } + + @override + Object serialize( + Serializers serializers, + AllOfWithSingleRef object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AllOfWithSingleRefBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'SingleRefType': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(SingleRefType), + ) as SingleRefType; + result.singleRefType = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + AllOfWithSingleRef deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = AllOfWithSingleRefBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart new file mode 100644 index 000000000000..20b3f9f50b71 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart @@ -0,0 +1,205 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'animal.g.dart'; + +/// Animal +/// +/// Properties: +/// * [className] +/// * [color] +@BuiltValue(instantiable: false) +abstract class Animal { + @BuiltValueField(wireName: r'className') + String get className; + + @BuiltValueField(wireName: r'color') + String? get color; + + static const String discriminatorFieldName = r'className'; + + static const Map discriminatorMapping = { + r'CAT': Cat, + r'DOG': Dog, + }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$AnimalSerializer(); +} + +extension AnimalDiscriminatorExt on Animal { + String? get discriminatorValue { + if (this is Cat) { + return r'CAT'; + } + if (this is Dog) { + return r'DOG'; + } + return null; + } +} +extension AnimalBuilderDiscriminatorExt on AnimalBuilder { + String? get discriminatorValue { + if (this is CatBuilder) { + return r'CAT'; + } + if (this is DogBuilder) { + return r'DOG'; + } + return null; + } +} + +class _$AnimalSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Animal]; + + @override + final String wireName = r'Animal'; + + Iterable _serializeProperties( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + if (object is Cat) { + return serializers.serialize(object, specifiedType: FullType(Cat))!; + } + if (object is Dog) { + return serializers.serialize(object, specifiedType: FullType(Dog))!; + } + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'CAT': + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; + case r'DOG': + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; + } + } +} + +/// a concrete implementation of [Animal], since [Animal] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Animal implements Animal, Built<$Animal, $AnimalBuilder> { + $Animal._(); + + factory $Animal([void Function($AnimalBuilder)? updates]) = _$$Animal; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($AnimalBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Animal> get serializer => _$$AnimalSerializer(); +} + +class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { + @override + final Iterable types = const [$Animal, _$$Animal]; + + @override + final String wireName = r'$Animal'; + + @override + Object serialize( + Serializers serializers, + $Animal object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Animal))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required AnimalBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $Animal deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $AnimalBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart new file mode 100644 index 000000000000..aadcd792e2bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/api_response.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'api_response.g.dart'; + +/// ApiResponse +/// +/// Properties: +/// * [code] +/// * [type] +/// * [message] +@BuiltValue() +abstract class ApiResponse implements Built { + @BuiltValueField(wireName: r'code') + int? get code; + + @BuiltValueField(wireName: r'type') + String? get type; + + @BuiltValueField(wireName: r'message') + String? get message; + + ApiResponse._(); + + factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ApiResponseSerializer(); +} + +class _$ApiResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ApiResponse, _$ApiResponse]; + + @override + final String wireName = r'ApiResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.code != null) { + yield r'code'; + yield serializers.serialize( + object.code, + specifiedType: const FullType(int), + ); + } + if (object.type != null) { + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + } + if (object.message != null) { + yield r'message'; + yield serializers.serialize( + object.message, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ApiResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ApiResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'code': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.code = valueDes; + break; + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + case r'message': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.message = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ApiResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ApiResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..5bc0982b8ab0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_array_of_number_only.g.dart'; + +/// ArrayOfArrayOfNumberOnly +/// +/// Properties: +/// * [arrayArrayNumber] +@BuiltValue() +abstract class ArrayOfArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayArrayNumber') + BuiltList>? get arrayArrayNumber; + + ArrayOfArrayOfNumberOnly._(); + + factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayArrayNumber != null) { + yield r'ArrayArrayNumber'; + yield serializers.serialize( + object.arrayArrayNumber, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), + ) as BuiltList>; + result.arrayArrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..72239924f5ec --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_of_number_only.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_of_number_only.g.dart'; + +/// ArrayOfNumberOnly +/// +/// Properties: +/// * [arrayNumber] +@BuiltValue() +abstract class ArrayOfNumberOnly implements Built { + @BuiltValueField(wireName: r'ArrayNumber') + BuiltList? get arrayNumber; + + ArrayOfNumberOnly._(); + + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayOfNumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); +} + +class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; + + @override + final String wireName = r'ArrayOfNumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayNumber != null) { + yield r'ArrayNumber'; + yield serializers.serialize( + object.arrayNumber, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayOfNumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayOfNumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'ArrayNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(num)]), + ) as BuiltList; + result.arrayNumber.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayOfNumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayOfNumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_test.dart new file mode 100644 index 000000000000..21f3a5a4c2d5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/array_test.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'array_test.g.dart'; + +/// ArrayTest +/// +/// Properties: +/// * [arrayOfString] +/// * [arrayArrayOfInteger] +/// * [arrayArrayOfModel] +@BuiltValue() +abstract class ArrayTest implements Built { + @BuiltValueField(wireName: r'array_of_string') + BuiltList? get arrayOfString; + + @BuiltValueField(wireName: r'array_array_of_integer') + BuiltList>? get arrayArrayOfInteger; + + @BuiltValueField(wireName: r'array_array_of_model') + BuiltList>? get arrayArrayOfModel; + + ArrayTest._(); + + factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ArrayTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ArrayTestSerializer(); +} + +class _$ArrayTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ArrayTest, _$ArrayTest]; + + @override + final String wireName = r'ArrayTest'; + + Iterable _serializeProperties( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.arrayOfString != null) { + yield r'array_of_string'; + yield serializers.serialize( + object.arrayOfString, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + if (object.arrayArrayOfInteger != null) { + yield r'array_array_of_integer'; + yield serializers.serialize( + object.arrayArrayOfInteger, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ); + } + if (object.arrayArrayOfModel != null) { + yield r'array_array_of_model'; + yield serializers.serialize( + object.arrayArrayOfModel, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ArrayTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ArrayTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'array_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.arrayOfString.replace(valueDes); + break; + case r'array_array_of_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), + ) as BuiltList>; + result.arrayArrayOfInteger.replace(valueDes); + break; + case r'array_array_of_model': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), + ) as BuiltList>; + result.arrayArrayOfModel.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ArrayTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ArrayTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..75827b9a429e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/capitalization.dart @@ -0,0 +1,199 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'capitalization.g.dart'; + +/// Capitalization +/// +/// Properties: +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet +@BuiltValue() +abstract class Capitalization implements Built { + @BuiltValueField(wireName: r'smallCamel') + String? get smallCamel; + + @BuiltValueField(wireName: r'CapitalCamel') + String? get capitalCamel; + + @BuiltValueField(wireName: r'small_Snake') + String? get smallSnake; + + @BuiltValueField(wireName: r'Capital_Snake') + String? get capitalSnake; + + @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') + String? get sCAETHFlowPoints; + + /// Name of the pet + @BuiltValueField(wireName: r'ATT_NAME') + String? get ATT_NAME; + + Capitalization._(); + + factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CapitalizationBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CapitalizationSerializer(); +} + +class _$CapitalizationSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Capitalization, _$Capitalization]; + + @override + final String wireName = r'Capitalization'; + + Iterable _serializeProperties( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.smallCamel != null) { + yield r'smallCamel'; + yield serializers.serialize( + object.smallCamel, + specifiedType: const FullType(String), + ); + } + if (object.capitalCamel != null) { + yield r'CapitalCamel'; + yield serializers.serialize( + object.capitalCamel, + specifiedType: const FullType(String), + ); + } + if (object.smallSnake != null) { + yield r'small_Snake'; + yield serializers.serialize( + object.smallSnake, + specifiedType: const FullType(String), + ); + } + if (object.capitalSnake != null) { + yield r'Capital_Snake'; + yield serializers.serialize( + object.capitalSnake, + specifiedType: const FullType(String), + ); + } + if (object.sCAETHFlowPoints != null) { + yield r'SCA_ETH_Flow_Points'; + yield serializers.serialize( + object.sCAETHFlowPoints, + specifiedType: const FullType(String), + ); + } + if (object.ATT_NAME != null) { + yield r'ATT_NAME'; + yield serializers.serialize( + object.ATT_NAME, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Capitalization object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CapitalizationBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'smallCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallCamel = valueDes; + break; + case r'CapitalCamel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalCamel = valueDes; + break; + case r'small_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.smallSnake = valueDes; + break; + case r'Capital_Snake': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.capitalSnake = valueDes; + break; + case r'SCA_ETH_Flow_Points': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sCAETHFlowPoints = valueDes; + break; + case r'ATT_NAME': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.ATT_NAME = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Capitalization deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CapitalizationBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart new file mode 100644 index 000000000000..af1faeef25cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat.g.dart'; + +/// Cat +/// +/// Properties: +/// * [className] +/// * [color] +/// * [declawed] +@BuiltValue() +abstract class Cat implements Animal, Built { + @BuiltValueField(wireName: r'declawed') + bool? get declawed; + + Cat._(); + + factory Cat([void updates(CatBuilder b)]) = _$Cat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatSerializer(); +} + +class _$CatSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Cat, _$Cat]; + + @override + final String wireName = r'Cat'; + + Iterable _serializeProperties( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Cat object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Cat deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CatBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart new file mode 100644 index 000000000000..02d9cce0cae1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'cat_all_of.g.dart'; + +/// CatAllOf +/// +/// Properties: +/// * [declawed] +@BuiltValue(instantiable: false) +abstract class CatAllOf { + @BuiltValueField(wireName: r'declawed') + bool? get declawed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CatAllOfSerializer(); +} + +class _$CatAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [CatAllOf]; + + @override + final String wireName = r'CatAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; + } +} + +/// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { + $CatAllOf._(); + + factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($CatAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$CatAllOf> get serializer => _$$CatAllOfSerializer(); +} + +class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { + @override + final Iterable types = const [$CatAllOf, _$$CatAllOf]; + + @override + final String wireName = r'$CatAllOf'; + + @override + Object serialize( + Serializers serializers, + $CatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(CatAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CatAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $CatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $CatAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart new file mode 100644 index 000000000000..3a541dd1fa92 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/category.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'category.g.dart'; + +/// Category +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Category implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String get name; + + Category._(); + + factory Category([void updates(CategoryBuilder b)]) = _$Category; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CategoryBuilder b) => b + ..name = 'default-name'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$CategorySerializer(); +} + +class _$CategorySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Category, _$Category]; + + @override + final String wireName = r'Category'; + + Iterable _serializeProperties( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Category object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required CategoryBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Category deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = CategoryBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart new file mode 100644 index 000000000000..51166943c6cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/class_model.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'class_model.g.dart'; + +/// Model for testing model with \"_class\" property +/// +/// Properties: +/// * [classField] +@BuiltValue() +abstract class ClassModel implements Built { + @BuiltValueField(wireName: r'_class') + String? get classField; + + ClassModel._(); + + factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ClassModelBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ClassModelSerializer(); +} + +class _$ClassModelSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ClassModel, _$ClassModel]; + + @override + final String wireName = r'ClassModel'; + + Iterable _serializeProperties( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.classField != null) { + yield r'_class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ClassModel object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ClassModelBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'_class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ClassModel deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ClassModelBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart new file mode 100644 index 000000000000..b21c7f544bee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/date.dart @@ -0,0 +1,70 @@ +/// A gregorian calendar date generated by +/// OpenAPI generator to differentiate +/// between [DateTime] and [Date] formats. +class Date implements Comparable { + final int year; + + /// January is 1. + final int month; + + /// First day is 1. + final int day; + + Date(this.year, this.month, this.day); + + /// The current date + static Date now({bool utc = false}) { + var now = DateTime.now(); + if (utc) { + now = now.toUtc(); + } + return now.toDate(); + } + + /// Convert to a [DateTime]. + DateTime toDateTime({bool utc = false}) { + if (utc) { + return DateTime.utc(year, month, day); + } else { + return DateTime(year, month, day); + } + } + + @override + int compareTo(Date other) { + int d = year.compareTo(other.year); + if (d != 0) { + return d; + } + d = month.compareTo(other.month); + if (d != 0) { + return d; + } + return day.compareTo(other.day); + } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Date && + runtimeType == other.runtimeType && + year == other.year && + month == other.month && + day == other.day; + + @override + int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; + + @override + String toString() { + final yyyy = year.toString(); + final mm = month.toString().padLeft(2, '0'); + final dd = day.toString().padLeft(2, '0'); + + return '$yyyy-$mm-$dd'; + } +} + +extension DateTimeToDate on DateTime { + Date toDate() => Date(year, month, day); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..57f089c899c8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/deprecated_object.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'deprecated_object.g.dart'; + +/// DeprecatedObject +/// +/// Properties: +/// * [name] +@Deprecated('DeprecatedObject has been deprecated') +@BuiltValue() +abstract class DeprecatedObject implements Built { + @BuiltValueField(wireName: r'name') + String? get name; + + DeprecatedObject._(); + + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DeprecatedObjectBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DeprecatedObjectSerializer(); +} + +class _$DeprecatedObjectSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; + + @override + final String wireName = r'DeprecatedObject'; + + Iterable _serializeProperties( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DeprecatedObject object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DeprecatedObjectBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + DeprecatedObject deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DeprecatedObjectBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart new file mode 100644 index 000000000000..8d3d3e27a17f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog.g.dart'; + +/// Dog +/// +/// Properties: +/// * [className] +/// * [color] +/// * [breed] +@BuiltValue() +abstract class Dog implements Animal, Built { + @BuiltValueField(wireName: r'breed') + String? get breed; + + Dog._(); + + factory Dog([void updates(DogBuilder b)]) = _$Dog; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogSerializer(); +} + +class _$DogSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Dog, _$Dog]; + + @override + final String wireName = r'Dog'; + + Iterable _serializeProperties( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + Dog object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Dog deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = DogBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart new file mode 100644 index 000000000000..bd52567fa60a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'dog_all_of.g.dart'; + +/// DogAllOf +/// +/// Properties: +/// * [breed] +@BuiltValue(instantiable: false) +abstract class DogAllOf { + @BuiltValueField(wireName: r'breed') + String? get breed; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$DogAllOfSerializer(); +} + +class _$DogAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [DogAllOf]; + + @override + final String wireName = r'DogAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.breed != null) { + yield r'breed'; + yield serializers.serialize( + object.breed, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; + } +} + +/// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { + $DogAllOf._(); + + factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($DogAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$DogAllOf> get serializer => _$$DogAllOfSerializer(); +} + +class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { + @override + final Iterable types = const [$DogAllOf, _$$DogAllOf]; + + @override + final String wireName = r'$DogAllOf'; + + @override + Object serialize( + Serializers serializers, + $DogAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(DogAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required DogAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'breed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.breed = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $DogAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $DogAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..b79a175e833c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_arrays.dart @@ -0,0 +1,163 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_arrays.g.dart'; + +/// EnumArrays +/// +/// Properties: +/// * [justSymbol] +/// * [arrayEnum] +@BuiltValue() +abstract class EnumArrays implements Built { + @BuiltValueField(wireName: r'just_symbol') + EnumArraysJustSymbolEnum? get justSymbol; + // enum justSymbolEnum { >=, $, }; + + @BuiltValueField(wireName: r'array_enum') + BuiltList? get arrayEnum; + // enum arrayEnumEnum { fish, crab, }; + + EnumArrays._(); + + factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumArraysBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumArraysSerializer(); +} + +class _$EnumArraysSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumArrays, _$EnumArrays]; + + @override + final String wireName = r'EnumArrays'; + + Iterable _serializeProperties( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justSymbol != null) { + yield r'just_symbol'; + yield serializers.serialize( + object.justSymbol, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ); + } + if (object.arrayEnum != null) { + yield r'array_enum'; + yield serializers.serialize( + object.arrayEnum, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumArrays object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumArraysBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'just_symbol': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumArraysJustSymbolEnum), + ) as EnumArraysJustSymbolEnum; + result.justSymbol = valueDes; + break; + case r'array_enum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + ) as BuiltList; + result.arrayEnum.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumArrays deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumArraysBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumArraysJustSymbolEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'>=') + static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; + @BuiltValueEnumConst(wireName: r'$') + static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; + + const EnumArraysJustSymbolEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); +} + +class EnumArraysArrayEnumEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'fish') + static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; + @BuiltValueEnumConst(wireName: r'crab') + static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; + + const EnumArraysArrayEnumEnum._(String name): super(name); + + static BuiltSet get values => _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..831f5b9d6d2d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/enum_test.dart @@ -0,0 +1,318 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'enum_test.g.dart'; + +/// EnumTest +/// +/// Properties: +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] +@BuiltValue() +abstract class EnumTest implements Built { + @BuiltValueField(wireName: r'enum_string') + EnumTestEnumStringEnum? get enumString; + // enum enumStringEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_string_required') + EnumTestEnumStringRequiredEnum get enumStringRequired; + // enum enumStringRequiredEnum { UPPER, lower, , }; + + @BuiltValueField(wireName: r'enum_integer') + EnumTestEnumIntegerEnum? get enumInteger; + // enum enumIntegerEnum { 1, -1, }; + + @BuiltValueField(wireName: r'enum_number') + EnumTestEnumNumberEnum? get enumNumber; + // enum enumNumberEnum { 1.1, -1.2, }; + + @BuiltValueField(wireName: r'outerEnum') + OuterEnum? get outerEnum; + // enum outerEnumEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumInteger') + OuterEnumInteger? get outerEnumInteger; + // enum outerEnumIntegerEnum { 0, 1, 2, }; + + @BuiltValueField(wireName: r'outerEnumDefaultValue') + OuterEnumDefaultValue? get outerEnumDefaultValue; + // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') + OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue; + // enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, }; + + EnumTest._(); + + factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(EnumTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$EnumTestSerializer(); +} + +class _$EnumTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [EnumTest, _$EnumTest]; + + @override + final String wireName = r'EnumTest'; + + Iterable _serializeProperties( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.enumString != null) { + yield r'enum_string'; + yield serializers.serialize( + object.enumString, + specifiedType: const FullType(EnumTestEnumStringEnum), + ); + } + yield r'enum_string_required'; + yield serializers.serialize( + object.enumStringRequired, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ); + if (object.enumInteger != null) { + yield r'enum_integer'; + yield serializers.serialize( + object.enumInteger, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ); + } + if (object.enumNumber != null) { + yield r'enum_number'; + yield serializers.serialize( + object.enumNumber, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ); + } + if (object.outerEnum != null) { + yield r'outerEnum'; + yield serializers.serialize( + object.outerEnum, + specifiedType: const FullType.nullable(OuterEnum), + ); + } + if (object.outerEnumInteger != null) { + yield r'outerEnumInteger'; + yield serializers.serialize( + object.outerEnumInteger, + specifiedType: const FullType(OuterEnumInteger), + ); + } + if (object.outerEnumDefaultValue != null) { + yield r'outerEnumDefaultValue'; + yield serializers.serialize( + object.outerEnumDefaultValue, + specifiedType: const FullType(OuterEnumDefaultValue), + ); + } + if (object.outerEnumIntegerDefaultValue != null) { + yield r'outerEnumIntegerDefaultValue'; + yield serializers.serialize( + object.outerEnumIntegerDefaultValue, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ); + } + } + + @override + Object serialize( + Serializers serializers, + EnumTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required EnumTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringEnum), + ) as EnumTestEnumStringEnum; + result.enumString = valueDes; + break; + case r'enum_string_required': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumStringRequiredEnum), + ) as EnumTestEnumStringRequiredEnum; + result.enumStringRequired = valueDes; + break; + case r'enum_integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumIntegerEnum), + ) as EnumTestEnumIntegerEnum; + result.enumInteger = valueDes; + break; + case r'enum_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(EnumTestEnumNumberEnum), + ) as EnumTestEnumNumberEnum; + result.enumNumber = valueDes; + break; + case r'outerEnum': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(OuterEnum), + ) as OuterEnum?; + if (valueDes == null) continue; + result.outerEnum = valueDes; + break; + case r'outerEnumInteger': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.outerEnumInteger = valueDes; + break; + case r'outerEnumDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumDefaultValue), + ) as OuterEnumDefaultValue; + result.outerEnumDefaultValue = valueDes; + break; + case r'outerEnumIntegerDefaultValue': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumIntegerDefaultValue), + ) as OuterEnumIntegerDefaultValue; + result.outerEnumIntegerDefaultValue = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + EnumTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = EnumTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class EnumTestEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringEnumSerializer; + + const EnumTestEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); +} + +class EnumTestEnumStringRequiredEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; + @BuiltValueEnumConst(wireName: r'') + static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; + + const EnumTestEnumStringRequiredEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); +} + +class EnumTestEnumIntegerEnum extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 1) + static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; + @BuiltValueEnumConst(wireNumber: -1) + static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; + + const EnumTestEnumIntegerEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); +} + +class EnumTestEnumNumberEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'1.1') + static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; + @BuiltValueEnumConst(wireName: r'-1.2') + static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; + @BuiltValueEnumConst(wireName: r'11184809', fallback: true) + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; + + const EnumTestEnumNumberEnum._(String name): super(name); + + static BuiltSet get values => _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart new file mode 100644 index 000000000000..ddfab9d2b56b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/fake_big_decimal_map200_response.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'fake_big_decimal_map200_response.g.dart'; + +/// FakeBigDecimalMap200Response +/// +/// Properties: +/// * [someId] +/// * [someMap] +@BuiltValue() +abstract class FakeBigDecimalMap200Response implements Built { + @BuiltValueField(wireName: r'someId') + num? get someId; + + @BuiltValueField(wireName: r'someMap') + BuiltMap? get someMap; + + FakeBigDecimalMap200Response._(); + + factory FakeBigDecimalMap200Response([void updates(FakeBigDecimalMap200ResponseBuilder b)]) = _$FakeBigDecimalMap200Response; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FakeBigDecimalMap200ResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FakeBigDecimalMap200ResponseSerializer(); +} + +class _$FakeBigDecimalMap200ResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FakeBigDecimalMap200Response, _$FakeBigDecimalMap200Response]; + + @override + final String wireName = r'FakeBigDecimalMap200Response'; + + Iterable _serializeProperties( + Serializers serializers, + FakeBigDecimalMap200Response object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.someId != null) { + yield r'someId'; + yield serializers.serialize( + object.someId, + specifiedType: const FullType(num), + ); + } + if (object.someMap != null) { + yield r'someMap'; + yield serializers.serialize( + object.someMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FakeBigDecimalMap200Response object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FakeBigDecimalMap200ResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'someId': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.someId = valueDes; + break; + case r'someMap': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]), + ) as BuiltMap; + result.someMap.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FakeBigDecimalMap200Response deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FakeBigDecimalMap200ResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..5ab41d14f437 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'file_schema_test_class.g.dart'; + +/// FileSchemaTestClass +/// +/// Properties: +/// * [file] +/// * [files] +@BuiltValue() +abstract class FileSchemaTestClass implements Built { + @BuiltValueField(wireName: r'file') + ModelFile? get file; + + @BuiltValueField(wireName: r'files') + BuiltList? get files; + + FileSchemaTestClass._(); + + factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FileSchemaTestClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FileSchemaTestClassSerializer(); +} + +class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; + + @override + final String wireName = r'FileSchemaTestClass'; + + Iterable _serializeProperties( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.file != null) { + yield r'file'; + yield serializers.serialize( + object.file, + specifiedType: const FullType(ModelFile), + ); + } + if (object.files != null) { + yield r'files'; + yield serializers.serialize( + object.files, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FileSchemaTestClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FileSchemaTestClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'file': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(ModelFile), + ) as ModelFile; + result.file.replace(valueDes); + break; + case r'files': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(ModelFile)]), + ) as BuiltList; + result.files.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FileSchemaTestClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FileSchemaTestClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart new file mode 100644 index 000000000000..57e0992c67cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo.g.dart'; + +/// Foo +/// +/// Properties: +/// * [bar] +@BuiltValue() +abstract class Foo implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + Foo._(); + + factory Foo([void updates(FooBuilder b)]) = _$Foo; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooBuilder b) => b + ..bar = 'bar'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooSerializer(); +} + +class _$FooSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Foo, _$Foo]; + + @override + final String wireName = r'Foo'; + + Iterable _serializeProperties( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Foo object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Foo deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart new file mode 100644 index 000000000000..b5903ebd5dbf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/foo_get_default_response.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'foo_get_default_response.g.dart'; + +/// FooGetDefaultResponse +/// +/// Properties: +/// * [string] +@BuiltValue() +abstract class FooGetDefaultResponse implements Built { + @BuiltValueField(wireName: r'string') + Foo? get string; + + FooGetDefaultResponse._(); + + factory FooGetDefaultResponse([void updates(FooGetDefaultResponseBuilder b)]) = _$FooGetDefaultResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FooGetDefaultResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FooGetDefaultResponseSerializer(); +} + +class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FooGetDefaultResponse, _$FooGetDefaultResponse]; + + @override + final String wireName = r'FooGetDefaultResponse'; + + Iterable _serializeProperties( + Serializers serializers, + FooGetDefaultResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.string != null) { + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(Foo), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FooGetDefaultResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FooGetDefaultResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Foo), + ) as Foo; + result.string.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FooGetDefaultResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FooGetDefaultResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart new file mode 100644 index 000000000000..33775231476e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/format_test.dart @@ -0,0 +1,374 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'dart:typed_data'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'format_test.g.dart'; + +/// FormatTest +/// +/// Properties: +/// * [integer] +/// * [int32] +/// * [int64] +/// * [number] +/// * [float] +/// * [double_] +/// * [decimal] +/// * [string] +/// * [byte] +/// * [binary] +/// * [date] +/// * [dateTime] +/// * [uuid] +/// * [password] +/// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. +/// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. +@BuiltValue() +abstract class FormatTest implements Built { + @BuiltValueField(wireName: r'integer') + int? get integer; + + @BuiltValueField(wireName: r'int32') + int? get int32; + + @BuiltValueField(wireName: r'int64') + int? get int64; + + @BuiltValueField(wireName: r'number') + num get number; + + @BuiltValueField(wireName: r'float') + double? get float; + + @BuiltValueField(wireName: r'double') + double? get double_; + + @BuiltValueField(wireName: r'decimal') + double? get decimal; + + @BuiltValueField(wireName: r'string') + String? get string; + + @BuiltValueField(wireName: r'byte') + String get byte; + + @BuiltValueField(wireName: r'binary') + Uint8List? get binary; + + @BuiltValueField(wireName: r'date') + Date get date; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'password') + String get password; + + /// A string that is a 10 digit number. Can have leading zeros. + @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. + @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') + String? get patternWithDigitsAndDelimiter; + + FormatTest._(); + + factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(FormatTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$FormatTestSerializer(); +} + +class _$FormatTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [FormatTest, _$FormatTest]; + + @override + final String wireName = r'FormatTest'; + + Iterable _serializeProperties( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integer != null) { + yield r'integer'; + yield serializers.serialize( + object.integer, + specifiedType: const FullType(int), + ); + } + if (object.int32 != null) { + yield r'int32'; + yield serializers.serialize( + object.int32, + specifiedType: const FullType(int), + ); + } + if (object.int64 != null) { + yield r'int64'; + yield serializers.serialize( + object.int64, + specifiedType: const FullType(int), + ); + } + yield r'number'; + yield serializers.serialize( + object.number, + specifiedType: const FullType(num), + ); + if (object.float != null) { + yield r'float'; + yield serializers.serialize( + object.float, + specifiedType: const FullType(double), + ); + } + if (object.double_ != null) { + yield r'double'; + yield serializers.serialize( + object.double_, + specifiedType: const FullType(double), + ); + } + if (object.decimal != null) { + yield r'decimal'; + yield serializers.serialize( + object.decimal, + specifiedType: const FullType(double), + ); + } + if (object.string != null) { + yield r'string'; + yield serializers.serialize( + object.string, + specifiedType: const FullType(String), + ); + } + yield r'byte'; + yield serializers.serialize( + object.byte, + specifiedType: const FullType(String), + ); + if (object.binary != null) { + yield r'binary'; + yield serializers.serialize( + object.binary, + specifiedType: const FullType(Uint8List), + ); + } + yield r'date'; + yield serializers.serialize( + object.date, + specifiedType: const FullType(Date), + ); + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + if (object.patternWithDigits != null) { + yield r'pattern_with_digits'; + yield serializers.serialize( + object.patternWithDigits, + specifiedType: const FullType(String), + ); + } + if (object.patternWithDigitsAndDelimiter != null) { + yield r'pattern_with_digits_and_delimiter'; + yield serializers.serialize( + object.patternWithDigitsAndDelimiter, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + FormatTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required FormatTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.integer = valueDes; + break; + case r'int32': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int32 = valueDes; + break; + case r'int64': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.int64 = valueDes; + break; + case r'number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.number = valueDes; + break; + case r'float': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.float = valueDes; + break; + case r'double': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.double_ = valueDes; + break; + case r'decimal': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(double), + ) as double; + result.decimal = valueDes; + break; + case r'string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.string = valueDes; + break; + case r'byte': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.byte = valueDes; + break; + case r'binary': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Uint8List), + ) as Uint8List; + result.binary = valueDes; + break; + case r'date': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Date), + ) as Date; + result.date = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'pattern_with_digits': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigits = valueDes; + break; + case r'pattern_with_digits_and_delimiter': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.patternWithDigitsAndDelimiter = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + FormatTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = FormatTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..9683985cf198 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/has_only_read_only.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'has_only_read_only.g.dart'; + +/// HasOnlyReadOnly +/// +/// Properties: +/// * [bar] +/// * [foo] +@BuiltValue() +abstract class HasOnlyReadOnly implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'foo') + String? get foo; + + HasOnlyReadOnly._(); + + factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HasOnlyReadOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HasOnlyReadOnlySerializer(); +} + +class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; + + @override + final String wireName = r'HasOnlyReadOnly'; + + Iterable _serializeProperties( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.foo != null) { + yield r'foo'; + yield serializers.serialize( + object.foo, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HasOnlyReadOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HasOnlyReadOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'foo': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.foo = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HasOnlyReadOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HasOnlyReadOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..c092a535f2fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/health_check_result.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'health_check_result.g.dart'; + +/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +/// +/// Properties: +/// * [nullableMessage] +@BuiltValue() +abstract class HealthCheckResult implements Built { + @BuiltValueField(wireName: r'NullableMessage') + String? get nullableMessage; + + HealthCheckResult._(); + + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(HealthCheckResultBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$HealthCheckResultSerializer(); +} + +class _$HealthCheckResultSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; + + @override + final String wireName = r'HealthCheckResult'; + + Iterable _serializeProperties( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.nullableMessage != null) { + yield r'NullableMessage'; + yield serializers.serialize( + object.nullableMessage, + specifiedType: const FullType.nullable(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + HealthCheckResult object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required HealthCheckResultBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'NullableMessage': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.nullableMessage = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + HealthCheckResult deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = HealthCheckResultBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart new file mode 100644 index 000000000000..74d5ed70f1e8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:openapi/src/model/foo.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; +import 'package:one_of/any_of.dart'; +// ignore_for_file: unused_element, unused_import + +part 'inline_response_default.g.dart'; + +/// InlineResponseDefault +/// +/// Properties: +/// * [string] +@BuiltValue() +abstract class InlineResponseDefault implements Built { + @BuiltValueField(wireName: r'string') + Foo? get string; + + + InlineResponseDefault._(); + + factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(InlineResponseDefaultBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$InlineResponseDefaultSerializer(); + + +} + +class _$InlineResponseDefaultSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [InlineResponseDefault, _$InlineResponseDefault]; + + @override + final String wireName = r'InlineResponseDefault'; + + Iterable _serializeProperties(Serializers serializers, InlineResponseDefault object, + {FullType specifiedType = FullType.unspecified}) sync* { + if (object.string != null) { + yield r'string'; + yield serializers.serialize(object.string, + specifiedType: const FullType(Foo)); + } + } + + @override + Object serialize(Serializers serializers, InlineResponseDefault object, + {FullType specifiedType = FullType.unspecified}) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified, required List serializedList,required InlineResponseDefaultBuilder result, required List unhandled}) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'string': + final valueDes = serializers.deserialize(value, + specifiedType: const FullType(Foo)) as Foo; + result.string.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + InlineResponseDefault deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = InlineResponseDefaultBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties(serializers, serialized, specifiedType: specifiedType, serializedList: serializedList, unhandled: unhandled, result: result); + return result.build(); + } +} + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/map_test.dart new file mode 100644 index 000000000000..9fa58677a84a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/map_test.dart @@ -0,0 +1,181 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'map_test.g.dart'; + +/// MapTest +/// +/// Properties: +/// * [mapMapOfString] +/// * [mapOfEnumString] +/// * [directMap] +/// * [indirectMap] +@BuiltValue() +abstract class MapTest implements Built { + @BuiltValueField(wireName: r'map_map_of_string') + BuiltMap>? get mapMapOfString; + + @BuiltValueField(wireName: r'map_of_enum_string') + BuiltMap? get mapOfEnumString; + // enum mapOfEnumStringEnum { UPPER, lower, }; + + @BuiltValueField(wireName: r'direct_map') + BuiltMap? get directMap; + + @BuiltValueField(wireName: r'indirect_map') + BuiltMap? get indirectMap; + + MapTest._(); + + factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MapTestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MapTestSerializer(); +} + +class _$MapTestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MapTest, _$MapTest]; + + @override + final String wireName = r'MapTest'; + + Iterable _serializeProperties( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.mapMapOfString != null) { + yield r'map_map_of_string'; + yield serializers.serialize( + object.mapMapOfString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ); + } + if (object.mapOfEnumString != null) { + yield r'map_of_enum_string'; + yield serializers.serialize( + object.mapOfEnumString, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ); + } + if (object.directMap != null) { + yield r'direct_map'; + yield serializers.serialize( + object.directMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + if (object.indirectMap != null) { + yield r'indirect_map'; + yield serializers.serialize( + object.indirectMap, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MapTest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MapTestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'map_map_of_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), + ) as BuiltMap>; + result.mapMapOfString.replace(valueDes); + break; + case r'map_of_enum_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + ) as BuiltMap; + result.mapOfEnumString.replace(valueDes); + break; + case r'direct_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.directMap.replace(valueDes); + break; + case r'indirect_map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), + ) as BuiltMap; + result.indirectMap.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MapTest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MapTestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class MapTestMapOfEnumStringEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'UPPER') + static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; + @BuiltValueEnumConst(wireName: r'lower') + static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; + + const MapTestMapOfEnumStringEnum._(String name): super(name); + + static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..76b5933ae5a7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,146 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + +/// MixedPropertiesAndAdditionalPropertiesClass +/// +/// Properties: +/// * [uuid] +/// * [dateTime] +/// * [map] +@BuiltValue() +abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @BuiltValueField(wireName: r'dateTime') + DateTime? get dateTime; + + @BuiltValueField(wireName: r'map') + BuiltMap? get map; + + MixedPropertiesAndAdditionalPropertiesClass._(); + + factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); +} + +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; + + @override + final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; + + Iterable _serializeProperties( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.dateTime != null) { + yield r'dateTime'; + yield serializers.serialize( + object.dateTime, + specifiedType: const FullType(DateTime), + ); + } + if (object.map != null) { + yield r'map'; + yield serializers.serialize( + object.map, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + MixedPropertiesAndAdditionalPropertiesClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required MixedPropertiesAndAdditionalPropertiesClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'dateTime': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.dateTime = valueDes; + break; + case r'map': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + ) as BuiltMap; + result.map.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + MixedPropertiesAndAdditionalPropertiesClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..0a2cfb4411ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model200_response.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model200_response.g.dart'; + +/// Model for testing model name starting with number +/// +/// Properties: +/// * [name] +/// * [classField] +@BuiltValue() +abstract class Model200Response implements Built { + @BuiltValueField(wireName: r'name') + int? get name; + + @BuiltValueField(wireName: r'class') + String? get classField; + + Model200Response._(); + + factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(Model200ResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$Model200ResponseSerializer(); +} + +class _$Model200ResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Model200Response, _$Model200Response]; + + @override + final String wireName = r'Model200Response'; + + Iterable _serializeProperties( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + } + if (object.classField != null) { + yield r'class'; + yield serializers.serialize( + object.classField, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Model200Response object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required Model200ResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'class': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.classField = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Model200Response deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = Model200ResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_client.dart new file mode 100644 index 000000000000..36690977421b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_client.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_client.g.dart'; + +/// ModelClient +/// +/// Properties: +/// * [client] +@BuiltValue() +abstract class ModelClient implements Built { + @BuiltValueField(wireName: r'client') + String? get client; + + ModelClient._(); + + factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelClientBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelClientSerializer(); +} + +class _$ModelClientSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelClient, _$ModelClient]; + + @override + final String wireName = r'ModelClient'; + + Iterable _serializeProperties( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.client != null) { + yield r'client'; + yield serializers.serialize( + object.client, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelClient object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelClientBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'client': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.client = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelClient deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelClientBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..ac609bfd15ad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_enum_class.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_enum_class.g.dart'; + +class ModelEnumClass extends EnumClass { + + @BuiltValueEnumConst(wireName: r'_abc') + static const ModelEnumClass abc = _$abc; + @BuiltValueEnumConst(wireName: r'-efg') + static const ModelEnumClass efg = _$efg; + @BuiltValueEnumConst(wireName: r'(xyz)') + static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$modelEnumClassSerializer; + + const ModelEnumClass._(String name): super(name); + + static BuiltSet get values => _$values; + static ModelEnumClass valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart new file mode 100644 index 000000000000..2702c21d36f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_file.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_file.g.dart'; + +/// Must be named `File` for test. +/// +/// Properties: +/// * [sourceURI] - Test capitalization +@BuiltValue() +abstract class ModelFile implements Built { + /// Test capitalization + @BuiltValueField(wireName: r'sourceURI') + String? get sourceURI; + + ModelFile._(); + + factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelFileBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelFileSerializer(); +} + +class _$ModelFileSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelFile, _$ModelFile]; + + @override + final String wireName = r'ModelFile'; + + Iterable _serializeProperties( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.sourceURI != null) { + yield r'sourceURI'; + yield serializers.serialize( + object.sourceURI, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelFile object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelFileBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'sourceURI': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.sourceURI = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelFile deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelFileBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart new file mode 100644 index 000000000000..579853258f8e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_list.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_list.g.dart'; + +/// ModelList +/// +/// Properties: +/// * [n123list] +@BuiltValue() +abstract class ModelList implements Built { + @BuiltValueField(wireName: r'123-list') + String? get n123list; + + ModelList._(); + + factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelListBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelListSerializer(); +} + +class _$ModelListSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelList, _$ModelList]; + + @override + final String wireName = r'ModelList'; + + Iterable _serializeProperties( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.n123list != null) { + yield r'123-list'; + yield serializers.serialize( + object.n123list, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelList object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelListBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'123-list': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.n123list = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelList deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelListBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart new file mode 100644 index 000000000000..45a2f67f8a40 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/model_return.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'model_return.g.dart'; + +/// Model for testing reserved words +/// +/// Properties: +/// * [return_] +@BuiltValue() +abstract class ModelReturn implements Built { + @BuiltValueField(wireName: r'return') + int? get return_; + + ModelReturn._(); + + factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ModelReturnBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ModelReturnSerializer(); +} + +class _$ModelReturnSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ModelReturn, _$ModelReturn]; + + @override + final String wireName = r'ModelReturn'; + + Iterable _serializeProperties( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.return_ != null) { + yield r'return'; + yield serializers.serialize( + object.return_, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ModelReturn object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ModelReturnBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'return': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.return_ = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ModelReturn deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ModelReturnBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart new file mode 100644 index 000000000000..10fa99e6a5f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/name.dart @@ -0,0 +1,160 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'name.g.dart'; + +/// Model for testing model name same as property name +/// +/// Properties: +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] +@BuiltValue() +abstract class Name implements Built { + @BuiltValueField(wireName: r'name') + int get name; + + @BuiltValueField(wireName: r'snake_case') + int? get snakeCase; + + @BuiltValueField(wireName: r'property') + String? get property; + + @BuiltValueField(wireName: r'123Number') + int? get n123number; + + Name._(); + + factory Name([void updates(NameBuilder b)]) = _$Name; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NameSerializer(); +} + +class _$NameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Name, _$Name]; + + @override + final String wireName = r'Name'; + + Iterable _serializeProperties( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(int), + ); + if (object.snakeCase != null) { + yield r'snake_case'; + yield serializers.serialize( + object.snakeCase, + specifiedType: const FullType(int), + ); + } + if (object.property != null) { + yield r'property'; + yield serializers.serialize( + object.property, + specifiedType: const FullType(String), + ); + } + if (object.n123number != null) { + yield r'123Number'; + yield serializers.serialize( + object.n123number, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Name object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.name = valueDes; + break; + case r'snake_case': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.snakeCase = valueDes; + break; + case r'property': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.property = valueDes; + break; + case r'123Number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.n123number = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Name deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..c993a41303f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/nullable_class.dart @@ -0,0 +1,319 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/date.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'nullable_class.g.dart'; + +/// NullableClass +/// +/// Properties: +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] +@BuiltValue() +abstract class NullableClass implements Built { + @BuiltValueField(wireName: r'integer_prop') + int? get integerProp; + + @BuiltValueField(wireName: r'number_prop') + num? get numberProp; + + @BuiltValueField(wireName: r'boolean_prop') + bool? get booleanProp; + + @BuiltValueField(wireName: r'string_prop') + String? get stringProp; + + @BuiltValueField(wireName: r'date_prop') + Date? get dateProp; + + @BuiltValueField(wireName: r'datetime_prop') + DateTime? get datetimeProp; + + @BuiltValueField(wireName: r'array_nullable_prop') + BuiltList? get arrayNullableProp; + + @BuiltValueField(wireName: r'array_and_items_nullable_prop') + BuiltList? get arrayAndItemsNullableProp; + + @BuiltValueField(wireName: r'array_items_nullable') + BuiltList? get arrayItemsNullable; + + @BuiltValueField(wireName: r'object_nullable_prop') + BuiltMap? get objectNullableProp; + + @BuiltValueField(wireName: r'object_and_items_nullable_prop') + BuiltMap? get objectAndItemsNullableProp; + + @BuiltValueField(wireName: r'object_items_nullable') + BuiltMap? get objectItemsNullable; + + NullableClass._(); + + factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NullableClassBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NullableClassSerializer(); +} + +class _$NullableClassSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NullableClass, _$NullableClass]; + + @override + final String wireName = r'NullableClass'; + + Iterable _serializeProperties( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.integerProp != null) { + yield r'integer_prop'; + yield serializers.serialize( + object.integerProp, + specifiedType: const FullType.nullable(int), + ); + } + if (object.numberProp != null) { + yield r'number_prop'; + yield serializers.serialize( + object.numberProp, + specifiedType: const FullType.nullable(num), + ); + } + if (object.booleanProp != null) { + yield r'boolean_prop'; + yield serializers.serialize( + object.booleanProp, + specifiedType: const FullType.nullable(bool), + ); + } + if (object.stringProp != null) { + yield r'string_prop'; + yield serializers.serialize( + object.stringProp, + specifiedType: const FullType.nullable(String), + ); + } + if (object.dateProp != null) { + yield r'date_prop'; + yield serializers.serialize( + object.dateProp, + specifiedType: const FullType.nullable(Date), + ); + } + if (object.datetimeProp != null) { + yield r'datetime_prop'; + yield serializers.serialize( + object.datetimeProp, + specifiedType: const FullType.nullable(DateTime), + ); + } + if (object.arrayNullableProp != null) { + yield r'array_nullable_prop'; + yield serializers.serialize( + object.arrayNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ); + } + if (object.arrayAndItemsNullableProp != null) { + yield r'array_and_items_nullable_prop'; + yield serializers.serialize( + object.arrayAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.arrayItemsNullable != null) { + yield r'array_items_nullable'; + yield serializers.serialize( + object.arrayItemsNullable, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ); + } + if (object.objectNullableProp != null) { + yield r'object_nullable_prop'; + yield serializers.serialize( + object.objectNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ); + } + if (object.objectAndItemsNullableProp != null) { + yield r'object_and_items_nullable_prop'; + yield serializers.serialize( + object.objectAndItemsNullableProp, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + if (object.objectItemsNullable != null) { + yield r'object_items_nullable'; + yield serializers.serialize( + object.objectItemsNullable, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NullableClass object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NullableClassBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'integer_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(int), + ) as int?; + if (valueDes == null) continue; + result.integerProp = valueDes; + break; + case r'number_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(num), + ) as num?; + if (valueDes == null) continue; + result.numberProp = valueDes; + break; + case r'boolean_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(bool), + ) as bool?; + if (valueDes == null) continue; + result.booleanProp = valueDes; + break; + case r'string_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.stringProp = valueDes; + break; + case r'date_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(Date), + ) as Date?; + if (valueDes == null) continue; + result.dateProp = valueDes; + break; + case r'datetime_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(DateTime), + ) as DateTime?; + if (valueDes == null) continue; + result.datetimeProp = valueDes; + break; + case r'array_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayNullableProp.replace(valueDes); + break; + case r'array_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList?; + if (valueDes == null) continue; + result.arrayAndItemsNullableProp.replace(valueDes); + break; + case r'array_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), + ) as BuiltList; + result.arrayItemsNullable.replace(valueDes); + break; + case r'object_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectNullableProp.replace(valueDes); + break; + case r'object_and_items_nullable_prop': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap?; + if (valueDes == null) continue; + result.objectAndItemsNullableProp.replace(valueDes); + break; + case r'object_items_nullable': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; + result.objectItemsNullable.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NullableClass deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NullableClassBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart new file mode 100644 index 000000000000..482a95f3e521 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/number_only.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'number_only.g.dart'; + +/// NumberOnly +/// +/// Properties: +/// * [justNumber] +@BuiltValue() +abstract class NumberOnly implements Built { + @BuiltValueField(wireName: r'JustNumber') + num? get justNumber; + + NumberOnly._(); + + factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(NumberOnlyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$NumberOnlySerializer(); +} + +class _$NumberOnlySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [NumberOnly, _$NumberOnly]; + + @override + final String wireName = r'NumberOnly'; + + Iterable _serializeProperties( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.justNumber != null) { + yield r'JustNumber'; + yield serializers.serialize( + object.justNumber, + specifiedType: const FullType(num), + ); + } + } + + @override + Object serialize( + Serializers serializers, + NumberOnly object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required NumberOnlyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'JustNumber': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.justNumber = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + NumberOnly deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = NumberOnlyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..4e0ae04ae50d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,167 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'object_with_deprecated_fields.g.dart'; + +/// ObjectWithDeprecatedFields +/// +/// Properties: +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] +@BuiltValue() +abstract class ObjectWithDeprecatedFields implements Built { + @BuiltValueField(wireName: r'uuid') + String? get uuid; + + @Deprecated('id has been deprecated') + @BuiltValueField(wireName: r'id') + num? get id; + + @Deprecated('deprecatedRef has been deprecated') + @BuiltValueField(wireName: r'deprecatedRef') + DeprecatedObject? get deprecatedRef; + + @Deprecated('bars has been deprecated') + @BuiltValueField(wireName: r'bars') + BuiltList? get bars; + + ObjectWithDeprecatedFields._(); + + factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); +} + +class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; + + @override + final String wireName = r'ObjectWithDeprecatedFields'; + + Iterable _serializeProperties( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.uuid != null) { + yield r'uuid'; + yield serializers.serialize( + object.uuid, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(num), + ); + } + if (object.deprecatedRef != null) { + yield r'deprecatedRef'; + yield serializers.serialize( + object.deprecatedRef, + specifiedType: const FullType(DeprecatedObject), + ); + } + if (object.bars != null) { + yield r'bars'; + yield serializers.serialize( + object.bars, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ObjectWithDeprecatedFields object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ObjectWithDeprecatedFieldsBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'uuid': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.uuid = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.id = valueDes; + break; + case r'deprecatedRef': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DeprecatedObject), + ) as DeprecatedObject; + result.deprecatedRef.replace(valueDes); + break; + case r'bars': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.bars.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ObjectWithDeprecatedFields deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ObjectWithDeprecatedFieldsBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart new file mode 100644 index 000000000000..a44e1b340c1e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/order.dart @@ -0,0 +1,225 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'order.g.dart'; + +/// Order +/// +/// Properties: +/// * [id] +/// * [petId] +/// * [quantity] +/// * [shipDate] +/// * [status] - Order Status +/// * [complete] +@BuiltValue() +abstract class Order implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'petId') + int? get petId; + + @BuiltValueField(wireName: r'quantity') + int? get quantity; + + @BuiltValueField(wireName: r'shipDate') + DateTime? get shipDate; + + /// Order Status + @BuiltValueField(wireName: r'status') + OrderStatusEnum? get status; + // enum statusEnum { placed, approved, delivered, }; + + @BuiltValueField(wireName: r'complete') + bool? get complete; + + Order._(); + + factory Order([void updates(OrderBuilder b)]) = _$Order; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OrderBuilder b) => b + ..complete = false; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OrderSerializer(); +} + +class _$OrderSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Order, _$Order]; + + @override + final String wireName = r'Order'; + + Iterable _serializeProperties( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.petId != null) { + yield r'petId'; + yield serializers.serialize( + object.petId, + specifiedType: const FullType(int), + ); + } + if (object.quantity != null) { + yield r'quantity'; + yield serializers.serialize( + object.quantity, + specifiedType: const FullType(int), + ); + } + if (object.shipDate != null) { + yield r'shipDate'; + yield serializers.serialize( + object.shipDate, + specifiedType: const FullType(DateTime), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(OrderStatusEnum), + ); + } + if (object.complete != null) { + yield r'complete'; + yield serializers.serialize( + object.complete, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Order object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OrderBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'petId': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.petId = valueDes; + break; + case r'quantity': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.quantity = valueDes; + break; + case r'shipDate': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(DateTime), + ) as DateTime; + result.shipDate = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OrderStatusEnum), + ) as OrderStatusEnum; + result.status = valueDes; + break; + case r'complete': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.complete = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Order deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OrderBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class OrderStatusEnum extends EnumClass { + + /// Order Status + @BuiltValueEnumConst(wireName: r'placed') + static const OrderStatusEnum placed = _$orderStatusEnum_placed; + /// Order Status + @BuiltValueEnumConst(wireName: r'approved') + static const OrderStatusEnum approved = _$orderStatusEnum_approved; + /// Order Status + @BuiltValueEnumConst(wireName: r'delivered') + static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; + /// Order Status + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$orderStatusEnumSerializer; + + const OrderStatusEnum._(String name): super(name); + + static BuiltSet get values => _$orderStatusEnumValues; + static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..0d6341cc1299 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_composite.dart @@ -0,0 +1,144 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_composite.g.dart'; + +/// OuterComposite +/// +/// Properties: +/// * [myNumber] +/// * [myString] +/// * [myBoolean] +@BuiltValue() +abstract class OuterComposite implements Built { + @BuiltValueField(wireName: r'my_number') + num? get myNumber; + + @BuiltValueField(wireName: r'my_string') + String? get myString; + + @BuiltValueField(wireName: r'my_boolean') + bool? get myBoolean; + + OuterComposite._(); + + factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterCompositeBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterCompositeSerializer(); +} + +class _$OuterCompositeSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterComposite, _$OuterComposite]; + + @override + final String wireName = r'OuterComposite'; + + Iterable _serializeProperties( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.myNumber != null) { + yield r'my_number'; + yield serializers.serialize( + object.myNumber, + specifiedType: const FullType(num), + ); + } + if (object.myString != null) { + yield r'my_string'; + yield serializers.serialize( + object.myString, + specifiedType: const FullType(String), + ); + } + if (object.myBoolean != null) { + yield r'my_boolean'; + yield serializers.serialize( + object.myBoolean, + specifiedType: const FullType(bool), + ); + } + } + + @override + Object serialize( + Serializers serializers, + OuterComposite object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterCompositeBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'my_number': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(num), + ) as num; + result.myNumber = valueDes; + break; + case r'my_string': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.myString = valueDes; + break; + case r'my_boolean': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.myBoolean = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterComposite deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterCompositeBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..5ad5d8009bdf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum.g.dart'; + +class OuterEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnum placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnum approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnum delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnum unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumSerializer; + + const OuterEnum._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnum valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumMixin = Object with _$OuterEnumMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..62c3cefe8456 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_default_value.g.dart'; + +class OuterEnumDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireName: r'placed') + static const OuterEnumDefaultValue placed = _$placed; + @BuiltValueEnumConst(wireName: r'approved') + static const OuterEnumDefaultValue approved = _$approved; + @BuiltValueEnumConst(wireName: r'delivered') + static const OuterEnumDefaultValue delivered = _$delivered; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumDefaultValueSerializer; + + const OuterEnumDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..988b30785d30 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer.g.dart'; + +class OuterEnumInteger extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumInteger number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumInteger number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumInteger number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerSerializer; + + const OuterEnumInteger._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumInteger valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..3fe792cedbe9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_enum_integer_default_value.g.dart'; + +class OuterEnumIntegerDefaultValue extends EnumClass { + + @BuiltValueEnumConst(wireNumber: 0) + static const OuterEnumIntegerDefaultValue number0 = _$number0; + @BuiltValueEnumConst(wireNumber: 1) + static const OuterEnumIntegerDefaultValue number1 = _$number1; + @BuiltValueEnumConst(wireNumber: 2) + static const OuterEnumIntegerDefaultValue number2 = _$number2; + @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; + + const OuterEnumIntegerDefaultValue._(String name): super(name); + + static BuiltSet get values => _$values; + static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..173329856452 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'outer_object_with_enum_property.g.dart'; + +/// OuterObjectWithEnumProperty +/// +/// Properties: +/// * [value] +@BuiltValue() +abstract class OuterObjectWithEnumProperty implements Built { + @BuiltValueField(wireName: r'value') + OuterEnumInteger get value; + // enum valueEnum { 0, 1, 2, }; + + OuterObjectWithEnumProperty._(); + + factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); +} + +class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { + @override + final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; + + @override + final String wireName = r'OuterObjectWithEnumProperty'; + + Iterable _serializeProperties( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'value'; + yield serializers.serialize( + object.value, + specifiedType: const FullType(OuterEnumInteger), + ); + } + + @override + Object serialize( + Serializers serializers, + OuterObjectWithEnumProperty object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required OuterObjectWithEnumPropertyBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'value': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(OuterEnumInteger), + ) as OuterEnumInteger; + result.value = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + OuterObjectWithEnumProperty deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = OuterObjectWithEnumPropertyBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart new file mode 100644 index 000000000000..4d6358bef27d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/pet.dart @@ -0,0 +1,222 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'pet.g.dart'; + +/// Pet +/// +/// Properties: +/// * [id] +/// * [category] +/// * [name] +/// * [photoUrls] +/// * [tags] +/// * [status] - pet status in the store +@BuiltValue() +abstract class Pet implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'category') + Category? get category; + + @BuiltValueField(wireName: r'name') + String get name; + + @BuiltValueField(wireName: r'photoUrls') + BuiltSet get photoUrls; + + @BuiltValueField(wireName: r'tags') + BuiltList? get tags; + + /// pet status in the store + @BuiltValueField(wireName: r'status') + PetStatusEnum? get status; + // enum statusEnum { available, pending, sold, }; + + Pet._(); + + factory Pet([void updates(PetBuilder b)]) = _$Pet; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PetBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PetSerializer(); +} + +class _$PetSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Pet, _$Pet]; + + @override + final String wireName = r'Pet'; + + Iterable _serializeProperties( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.category != null) { + yield r'category'; + yield serializers.serialize( + object.category, + specifiedType: const FullType(Category), + ); + } + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + yield r'photoUrls'; + yield serializers.serialize( + object.photoUrls, + specifiedType: const FullType(BuiltSet, [FullType(String)]), + ); + if (object.tags != null) { + yield r'tags'; + yield serializers.serialize( + object.tags, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(PetStatusEnum), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Pet object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PetBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'category': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Category), + ) as Category; + result.category.replace(valueDes); + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'photoUrls': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltSet, [FullType(String)]), + ) as BuiltSet; + result.photoUrls.replace(valueDes); + break; + case r'tags': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(Tag)]), + ) as BuiltList; + result.tags.replace(valueDes); + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(PetStatusEnum), + ) as PetStatusEnum; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Pet deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PetBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class PetStatusEnum extends EnumClass { + + /// pet status in the store + @BuiltValueEnumConst(wireName: r'available') + static const PetStatusEnum available = _$petStatusEnum_available; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'pending') + static const PetStatusEnum pending = _$petStatusEnum_pending; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'sold') + static const PetStatusEnum sold = _$petStatusEnum_sold; + /// pet status in the store + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$petStatusEnumSerializer; + + const PetStatusEnum._(String name): super(name); + + static BuiltSet get values => _$petStatusEnumValues; + static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..b619217ab3cb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/read_only_first.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'read_only_first.g.dart'; + +/// ReadOnlyFirst +/// +/// Properties: +/// * [bar] +/// * [baz] +@BuiltValue() +abstract class ReadOnlyFirst implements Built { + @BuiltValueField(wireName: r'bar') + String? get bar; + + @BuiltValueField(wireName: r'baz') + String? get baz; + + ReadOnlyFirst._(); + + factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ReadOnlyFirstBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ReadOnlyFirstSerializer(); +} + +class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ReadOnlyFirst, _$ReadOnlyFirst]; + + @override + final String wireName = r'ReadOnlyFirst'; + + Iterable _serializeProperties( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.bar != null) { + yield r'bar'; + yield serializers.serialize( + object.bar, + specifiedType: const FullType(String), + ); + } + if (object.baz != null) { + yield r'baz'; + yield serializers.serialize( + object.baz, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ReadOnlyFirst object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ReadOnlyFirstBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'bar': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.bar = valueDes; + break; + case r'baz': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.baz = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ReadOnlyFirst deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ReadOnlyFirstBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..b51e77292e8e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/single_ref_type.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'single_ref_type.g.dart'; + +class SingleRefType extends EnumClass { + + @BuiltValueEnumConst(wireName: r'admin') + static const SingleRefType admin = _$admin; + @BuiltValueEnumConst(wireName: r'user') + static const SingleRefType user = _$user; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const SingleRefType unknownDefaultOpenApi = _$unknownDefaultOpenApi; + + static Serializer get serializer => _$singleRefTypeSerializer; + + const SingleRefType._(String name): super(name); + + static BuiltSet get values => _$values; + static SingleRefType valueOf(String name) => _$valueOf(name); +} + +/// Optionally, enum_class can generate a mixin to go with your enum for use +/// with Angular. It exposes your enum constants as getters. So, if you mix it +/// in to your Dart component class, the values become available to the +/// corresponding Angular template. +/// +/// Trigger mixin generation by writing a line like this one next to your enum. +abstract class SingleRefTypeMixin = Object with _$SingleRefTypeMixin; + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..fa860056b45d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_model_name.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'special_model_name.g.dart'; + +/// SpecialModelName +/// +/// Properties: +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +@BuiltValue() +abstract class SpecialModelName implements Built { + @BuiltValueField(wireName: r'$special[property.name]') + int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + SpecialModelName._(); + + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(SpecialModelNameBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$SpecialModelNameSerializer(); +} + +class _$SpecialModelNameSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [SpecialModelName, _$SpecialModelName]; + + @override + final String wireName = r'SpecialModelName'; + + Iterable _serializeProperties( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { + yield r'$special[property.name]'; + yield serializers.serialize( + object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + SpecialModelName object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required SpecialModelNameBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'$special[property.name]': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + SpecialModelName deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = SpecialModelNameBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/tag.dart new file mode 100644 index 000000000000..3be220d8188e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/tag.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'tag.g.dart'; + +/// Tag +/// +/// Properties: +/// * [id] +/// * [name] +@BuiltValue() +abstract class Tag implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'name') + String? get name; + + Tag._(); + + factory Tag([void updates(TagBuilder b)]) = _$Tag; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(TagBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$TagSerializer(); +} + +class _$TagSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Tag, _$Tag]; + + @override + final String wireName = r'Tag'; + + Iterable _serializeProperties( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + Tag object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required TagBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Tag deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = TagBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart new file mode 100644 index 000000000000..f7577d7e1ee9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/user.dart @@ -0,0 +1,235 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'user.g.dart'; + +/// User +/// +/// Properties: +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] +/// * [userStatus] - User Status +@BuiltValue() +abstract class User implements Built { + @BuiltValueField(wireName: r'id') + int? get id; + + @BuiltValueField(wireName: r'username') + String? get username; + + @BuiltValueField(wireName: r'firstName') + String? get firstName; + + @BuiltValueField(wireName: r'lastName') + String? get lastName; + + @BuiltValueField(wireName: r'email') + String? get email; + + @BuiltValueField(wireName: r'password') + String? get password; + + @BuiltValueField(wireName: r'phone') + String? get phone; + + /// User Status + @BuiltValueField(wireName: r'userStatus') + int? get userStatus; + + User._(); + + factory User([void updates(UserBuilder b)]) = _$User; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(UserBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$UserSerializer(); +} + +class _$UserSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [User, _$User]; + + @override + final String wireName = r'User'; + + Iterable _serializeProperties( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(int), + ); + } + if (object.username != null) { + yield r'username'; + yield serializers.serialize( + object.username, + specifiedType: const FullType(String), + ); + } + if (object.firstName != null) { + yield r'firstName'; + yield serializers.serialize( + object.firstName, + specifiedType: const FullType(String), + ); + } + if (object.lastName != null) { + yield r'lastName'; + yield serializers.serialize( + object.lastName, + specifiedType: const FullType(String), + ); + } + if (object.email != null) { + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); + } + if (object.password != null) { + yield r'password'; + yield serializers.serialize( + object.password, + specifiedType: const FullType(String), + ); + } + if (object.phone != null) { + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); + } + if (object.userStatus != null) { + yield r'userStatus'; + yield serializers.serialize( + object.userStatus, + specifiedType: const FullType(int), + ); + } + } + + @override + Object serialize( + Serializers serializers, + User object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required UserBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.id = valueDes; + break; + case r'username': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.username = valueDes; + break; + case r'firstName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.firstName = valueDes; + break; + case r'lastName': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.lastName = valueDes; + break; + case r'email': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.email = valueDes; + break; + case r'password': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.password = valueDes; + break; + case r'phone': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.phone = valueDes; + break; + case r'userStatus': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.userStatus = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + User deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = UserBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart new file mode 100644 index 000000000000..ca163ddac102 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -0,0 +1,157 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_import + +import 'package:one_of_serializer/any_of_serializer.dart'; +import 'package:one_of_serializer/one_of_serializer.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:built_value/iso_8601_date_time_serializer.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:openapi/src/model/date.dart'; + +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/fake_big_decimal_map200_response.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_get_default_response.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/user.dart'; + +part 'serializers.g.dart'; + +@SerializersFor([ + AdditionalPropertiesClass, + AllOfWithSingleRef, + Animal,$Animal, + ApiResponse, + ArrayOfArrayOfNumberOnly, + ArrayOfNumberOnly, + ArrayTest, + Capitalization, + Cat, + Category, + ClassModel, + DeprecatedObject, + Dog, + EnumArrays, + EnumTest, + FakeBigDecimalMap200Response, + FileSchemaTestClass, + Foo, + FooGetDefaultResponse, + FormatTest, + HasOnlyReadOnly, + HealthCheckResult, + MapTest, + MixedPropertiesAndAdditionalPropertiesClass, + Model200Response, + ModelClient, + ModelEnumClass, + ModelFile, + ModelList, + ModelReturn, + Name, + NullableClass, + NumberOnly, + ObjectWithDeprecatedFields, + Order, + OuterComposite, + OuterEnum, + OuterEnumDefaultValue, + OuterEnumInteger, + OuterEnumIntegerDefaultValue, + OuterObjectWithEnumProperty, + Pet, + ReadOnlyFirst, + SingleRefType, + SpecialModelName, + Tag, + User, +]) +Serializers serializers = (_$serializers.toBuilder() + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(String)]), + () => MapBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(User)]), + () => ListBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltSet, [FullType(String)]), + () => SetBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltSet, [FullType(Pet)]), + () => SetBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(Pet)]), + () => ListBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltMap, [FullType(String), FullType(int)]), + () => MapBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(ModelEnumClass)]), + () => ListBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(String)]), + () => ListBuilder(), + ) + ..add(Animal.serializer) + ..add(const OneOfSerializer()) + ..add(const AnyOfSerializer()) + ..add(const DateSerializer()) + ..add(Iso8601DateTimeSerializer())) + .build(); + +Serializers standardSerializers = + (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml new file mode 100644 index 000000000000..3ae0ded6004b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pom.xml @@ -0,0 +1,148 @@ + + 4.0.0 + org.openapitools + DartDioPetstoreClientLibFakeTests + pom + 1.0.0-SNAPSHOT + DartDio Petstore Client Lib Fake + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-run-build-runner + pre-integration-test + + exec + + + pub + + run + build_runner + build + + + + + dart-analyze + integration-test + + exec + + + dart + + analyze + --fatal-infos + + + + + dart-test + integration-test + + exec + + + dart + + test + + + + + tests-pub-get + pre-integration-test + + exec + + + ../petstore_client_lib_fake_tests + pub + + get + + + + + tests-dart-format + pre-integration-test + + exec + + + ../petstore_client_lib_fake_tests + dart + + format + --set-exit-if-changed + --output=none + . + + + + + tests-dart-analyze + integration-test + + exec + + + ../petstore_client_lib_fake_tests + dart + + analyze + --fatal-infos + + + + + tests-dart-test + integration-test + + exec + + + ../petstore_client_lib_fake_tests + dart + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml new file mode 100644 index 000000000000..de93663746d0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml @@ -0,0 +1,19 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + one_of: '>=1.5.0 <2.0.0' + one_of_serializer: '>=1.5.0 <2.0.0' + built_value: '>=8.4.0 <9.0.0' + built_collection: '>=5.1.1 <6.0.0' + +dev_dependencies: + built_value_generator: '>=8.4.0 <9.0.0' + build_runner: any + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..c231e6dc2807 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final instance = AdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(AdditionalPropertiesClass, () { + // BuiltMap mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // BuiltMap> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..64e241a4dce3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/all_of_with_single_ref_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AllOfWithSingleRef +void main() { + final instance = AllOfWithSingleRefBuilder(); + // TODO add properties to the builder and call build() + + group(AllOfWithSingleRef, () { + // String username + test('to test the property `username`', () async { + // TODO + }); + + // SingleRefType singleRefType + test('to test the property `singleRefType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart new file mode 100644 index 000000000000..39b8b59cdf51 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + //final instance = AnimalBuilder(); + // TODO add properties to the builder and call build() + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/another_fake_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for AnotherFakeApi +void main() { + final instance = Openapi().getAnotherFakeApi(); + + group(AnotherFakeApi, () { + // To test special tags + // + // To test special tags and operation ID starting with number + // + //Future call123testSpecialTags(ModelClient modelClient) async + test('test call123testSpecialTags', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart new file mode 100644 index 000000000000..cf1a744cd629 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final instance = ApiResponseBuilder(); + // TODO add properties to the builder and call build() + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..a679a6c4223d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final instance = ArrayOfArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfArrayOfNumberOnly, () { + // BuiltList> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..cc648bc115c5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final instance = ArrayOfNumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayOfNumberOnly, () { + // BuiltList arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart new file mode 100644 index 000000000000..210216f224b5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final instance = ArrayTestBuilder(); + // TODO add properties to the builder and call build() + + group(ArrayTest, () { + // BuiltList arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // BuiltList> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart new file mode 100644 index 000000000000..23e04b0001bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final instance = CapitalizationBuilder(); + // TODO add properties to the builder and call build() + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart new file mode 100644 index 000000000000..b8fc252acc60 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final instance = CatBuilder(); + // TODO add properties to the builder and call build() + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart new file mode 100644 index 000000000000..70f5fb5e02ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final instance = CategoryBuilder(); + // TODO add properties to the builder and call build() + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: 'default-name') + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart new file mode 100644 index 000000000000..89f1d35e556b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final instance = ClassModelBuilder(); + // TODO add properties to the builder and call build() + + group(ClassModel, () { + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart new file mode 100644 index 000000000000..f079565f9785 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/default_api_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooGet() async + test('test fooGet', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart new file mode 100644 index 000000000000..98ab991b2b14 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final instance = DeprecatedObjectBuilder(); + // TODO add properties to the builder and call build() + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart new file mode 100644 index 000000000000..f57fcdc413df --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final instance = DogBuilder(); + // TODO add properties to the builder and call build() + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart new file mode 100644 index 000000000000..438c36db0745 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final instance = EnumArraysBuilder(); + // TODO add properties to the builder and call build() + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // BuiltList arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart new file mode 100644 index 000000000000..b5f3aeb7fbdd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final instance = EnumTestBuilder(); + // TODO add properties to the builder and call build() + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart new file mode 100644 index 000000000000..c552474e280b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart @@ -0,0 +1,140 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // Health check endpoint + // + //Future fakeHealthGet() async + test('test fakeHealthGet', () async { + // TODO + }); + + // test http signature authentication + // + //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async + test('test fakeHttpSignatureTest', () async { + // TODO + }); + + // Test serialization of outer boolean types + // + //Future fakeOuterBooleanSerialize({ bool body }) async + test('test fakeOuterBooleanSerialize', () async { + // TODO + }); + + // Test serialization of object with outer number type + // + //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async + test('test fakeOuterCompositeSerialize', () async { + // TODO + }); + + // Test serialization of outer number types + // + //Future fakeOuterNumberSerialize({ num body }) async + test('test fakeOuterNumberSerialize', () async { + // TODO + }); + + // Test serialization of outer string types + // + //Future fakeOuterStringSerialize({ String body }) async + test('test fakeOuterStringSerialize', () async { + // TODO + }); + + // Test serialization of enum (int) properties with examples + // + //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async + test('test fakePropertyEnumIntegerSerialize', () async { + // TODO + }); + + // For this test, the body has to be a binary file. + // + //Future testBodyWithBinary(MultipartFile body) async + test('test testBodyWithBinary', () async { + // TODO + }); + + // For this test, the body for this request must reference a schema named `File`. + // + //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async + test('test testBodyWithFileSchema', () async { + // TODO + }); + + //Future testBodyWithQueryParams(String query, User user) async + test('test testBodyWithQueryParams', () async { + // TODO + }); + + // To test \"client\" model + // + // To test \"client\" model + // + //Future testClientModel(ModelClient modelClient) async + test('test testClientModel', () async { + // TODO + }); + + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async + test('test testEndpointParameters', () async { + // TODO + }); + + // To test enum parameters + // + // To test enum parameters + // + //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumQueryModelArray, BuiltList enumFormStringArray, String enumFormString }) async + test('test testEnumParameters', () async { + // TODO + }); + + // Fake endpoint to test group parameters (optional) + // + // Fake endpoint to test group parameters (optional) + // + //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async + test('test testGroupParameters', () async { + // TODO + }); + + // test inline additionalProperties + // + // + // + //Future testInlineAdditionalProperties(BuiltMap requestBody) async + test('test testInlineAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // To test the collection format in query parameters + // + //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async + test('test testQueryParameterCollectionFormat', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart new file mode 100644 index 000000000000..f316fc6038bf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_big_decimal_map200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FakeBigDecimalMap200Response +void main() { + final instance = FakeBigDecimalMap200ResponseBuilder(); + // TODO add properties to the builder and call build() + + group(FakeBigDecimalMap200Response, () { + // num someId + test('to test the property `someId`', () async { + // TODO + }); + + // BuiltMap someMap + test('to test the property `someMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeClassnameTags123Api +void main() { + final instance = Openapi().getFakeClassnameTags123Api(); + + group(FakeClassnameTags123Api, () { + // To test class name in snake case + // + // To test class name in snake case + // + //Future testClassname(ModelClient modelClient) async + test('test testClassname', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..ca8695bd4a47 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final instance = FileSchemaTestClassBuilder(); + // TODO add properties to the builder and call build() + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // BuiltList files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart new file mode 100644 index 000000000000..c64cbb8034c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_get_default_response_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooGetDefaultResponse +void main() { + final instance = FooGetDefaultResponseBuilder(); + // TODO add properties to the builder and call build() + + group(FooGetDefaultResponse, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart new file mode 100644 index 000000000000..205237788aeb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/foo_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final instance = FooBuilder(); + // TODO add properties to the builder and call build() + + group(Foo, () { + // String bar (default value: 'bar') + test('to test the property `bar`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart new file mode 100644 index 000000000000..558c3aa4b659 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final instance = FormatTestBuilder(); + // TODO add properties to the builder and call build() + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // Uint8List binary + test('to test the property `binary`', () async { + // TODO + }); + + // Date date + test('to test the property `date`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // A string that is a 10 digit number. Can have leading zeros. + // String patternWithDigits + test('to test the property `patternWithDigits`', () async { + // TODO + }); + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + // String patternWithDigitsAndDelimiter + test('to test the property `patternWithDigitsAndDelimiter`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..c34522214751 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final instance = HasOnlyReadOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart new file mode 100644 index 000000000000..fda0c9218217 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final instance = HealthCheckResultBuilder(); + // TODO add properties to the builder and call build() + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart new file mode 100644 index 000000000000..56a27610ee5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final instance = MapTestBuilder(); + // TODO add properties to the builder and call build() + + group(MapTest, () { + // BuiltMap> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // BuiltMap mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // BuiltMap directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // BuiltMap indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..85b113387a08 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); + // TODO add properties to the builder and call build() + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // BuiltMap map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart new file mode 100644 index 000000000000..11bac07fafb8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final instance = Model200ResponseBuilder(); + // TODO add properties to the builder and call build() + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String classField + test('to test the property `classField`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart new file mode 100644 index 000000000000..f494dfd08499 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final instance = ModelClientBuilder(); + // TODO add properties to the builder and call build() + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_enum_class_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + + group(ModelEnumClass, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart new file mode 100644 index 000000000000..4f1397726226 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final instance = ModelFileBuilder(); + // TODO add properties to the builder and call build() + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart new file mode 100644 index 000000000000..d35e02fe0c9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final instance = ModelListBuilder(); + // TODO add properties to the builder and call build() + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart new file mode 100644 index 000000000000..eedfe7eb281a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final instance = ModelReturnBuilder(); + // TODO add properties to the builder and call build() + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart new file mode 100644 index 000000000000..6b2329bb0819 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final instance = NameBuilder(); + // TODO add properties to the builder and call build() + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart new file mode 100644 index 000000000000..1a6767dbb2ab --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final instance = NullableClassBuilder(); + // TODO add properties to the builder and call build() + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // Date dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // BuiltList arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // BuiltList arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltList arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // BuiltMap objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // BuiltMap objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // BuiltMap objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart new file mode 100644 index 000000000000..7167d78a4962 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final instance = NumberOnlyBuilder(); + // TODO add properties to the builder and call build() + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..cd04ed4d48e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final instance = ObjectWithDeprecatedFieldsBuilder(); + // TODO add properties to the builder and call build() + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // BuiltList bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart new file mode 100644 index 000000000000..7ff992230bf6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final instance = OrderBuilder(); + // TODO add properties to the builder and call build() + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart new file mode 100644 index 000000000000..dac257d9a0d6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final instance = OuterCompositeBuilder(); + // TODO add properties to the builder and call build() + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + + group(OuterEnumDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + + group(OuterEnumIntegerDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_integer_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + + group(OuterEnumInteger, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_enum_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + + group(OuterEnum, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..d6d763c5d93a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final instance = OuterObjectWithEnumPropertyBuilder(); + // TODO add properties to the builder and call build() + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart new file mode 100644 index 000000000000..bd23e2e9e73d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_api_test.dart @@ -0,0 +1,92 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PetApi +void main() { + final instance = Openapi().getPetApi(); + + group(PetApi, () { + // Add a new pet to the store + // + // + // + //Future addPet(Pet pet) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + // + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(BuiltList status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(BuiltSet tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + // + // + //Future updatePet(Pet pet) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + // + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + // + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + // uploads an image (required) + // + // + // + //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async + test('test uploadFileWithRequiredFile', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart new file mode 100644 index 000000000000..b2bac5351d2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final instance = PetBuilder(); + // TODO add properties to the builder and call build() + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // BuiltSet photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // BuiltList tags + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart new file mode 100644 index 000000000000..550d3d793ec6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final instance = ReadOnlyFirstBuilder(); + // TODO add properties to the builder and call build() + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/single_ref_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + + group(SingleRefType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart new file mode 100644 index 000000000000..08a4592a1ed7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final instance = SpecialModelNameBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart new file mode 100644 index 000000000000..77b3d9f00224 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/store_api_test.dart @@ -0,0 +1,47 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for StoreApi +void main() { + final instance = Openapi().getStoreApi(); + + group(StoreApi, () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + // + // + //Future placeOrder(Order order) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart new file mode 100644 index 000000000000..6f7c63b8f0c2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final instance = TagBuilder(); + // TODO add properties to the builder and call build() + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart new file mode 100644 index 000000000000..29f63ba073ba --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_api_test.dart @@ -0,0 +1,83 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for UserApi +void main() { + final instance = Openapi().getUserApi(); + + group(UserApi, () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User user) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithArrayInput(BuiltList user) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithListInput(BuiltList user) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + // + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + // + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + // + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User user) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart new file mode 100644 index 000000000000..1e6a1bc23faa --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final instance = UserBuilder(); + // TODO add properties to the builder and call build() + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore new file mode 100644 index 000000000000..378eac25d311 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/.gitignore @@ -0,0 +1 @@ +build diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md new file mode 100644 index 000000000000..7f36256df602 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/README.md @@ -0,0 +1,6 @@ +# Manual tests for Dart-DIO (DO NOT DELETE) + +These tests depend on the `build_runner` having already been run in the +parent package. + +The test are part of the integration tests for the parent package \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml new file mode 100644 index 000000000000..a611887d3acf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/analysis_options.yaml @@ -0,0 +1,9 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml new file mode 100644 index 000000000000..8475e362b888 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml @@ -0,0 +1,18 @@ +name: petstore_client_lib_fake_tests +version: 1.0.0 +description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake + +publish_to: none + +environment: + sdk: '>=2.15.0 <3.0.0' + +dev_dependencies: + built_collection: 5.1.1 + built_value: 8.4.3 + dio: 5.2.1 + http_mock_adapter: 0.4.2 + mockito: 5.2.0 + openapi: + path: ../petstore_client_lib_fake + test: 1.21.0 diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml new file mode 100644 index 000000000000..64080c7e80a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/puby.yaml @@ -0,0 +1,3 @@ +exclude: + - test + - pub run build_runner \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart new file mode 100644 index 000000000000..5ecf0a91cee7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/authentication_test.dart @@ -0,0 +1,92 @@ +import 'package:dio/dio.dart'; +import 'package:http_mock_adapter/http_mock_adapter.dart'; +import 'package:openapi/openapi.dart'; +import 'package:test/test.dart'; + +void main() { + late Openapi client; + late DioAdapter tester; + + setUp(() { + client = Openapi(dio: Dio()); + tester = DioAdapter(dio: client.dio); + }); + + tearDown(() { + tester.close(); + }); + + group('Authentication', () { + test('http_basic', () async { + client.setBasicAuth('http_basic_test', 'foo', 'bar'); + + tester.onPost( + '/fake', + (server) => server.reply(200, null), + data: { + 'number': '1', + 'double': '1.1', + 'pattern_without_delimiter': 'pattern', + 'byte': '1', + }, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + 'content-length': Matchers.integer, + 'authorization': Matchers.string, + }, + ); + + final response = await client.getFakeApi().testEndpointParameters( + number: 1, + double_: 1.1, + patternWithoutDelimiter: 'pattern', + byte: '1', + ); + + expect(response.statusCode, 200); + }); + + test('bearer', () async { + client.setBearerAuth('bearer_test', 'foobar'); + + tester.onDelete( + '/fake', + (server) => server.reply(200, null), + headers: { + 'required_boolean_group': 'false', + 'authorization': Matchers.pattern('Bearer foobar'), + }, + queryParameters: { + 'required_string_group': 1, + 'required_int64_group': 2, + }, + ); + + final response = await client.getFakeApi().testGroupParameters( + requiredStringGroup: 1, + requiredBooleanGroup: false, + requiredInt64Group: 2, + ); + + expect(response.statusCode, 200); + }); + + test('api_key', () async { + client.setApiKey('api_key', 'SECRET_API_KEY'); + + tester.onGet( + '/store/inventory', + (server) => server.reply(200, { + 'foo': 999, + }), + headers: { + 'api_key': 'SECRET_API_KEY', + }, + ); + + final response = await client.getStoreApi().getInventory(); + + expect(response.statusCode, 200); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart new file mode 100644 index 000000000000..ece30683b581 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/fake_api_test.dart @@ -0,0 +1,193 @@ +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:dio/dio.dart'; +import 'package:http_mock_adapter/http_mock_adapter.dart'; +import 'package:openapi/openapi.dart'; +import 'package:test/test.dart'; + +void main() { + late Openapi client; + late DioAdapter tester; + + setUp(() { + client = Openapi(dio: Dio()); + tester = DioAdapter(dio: client.dio); + }); + + tearDown(() { + tester.close(); + }); + + group(FakeApi, () { + group('testEndpointParameters', () { + test('complete', () async { + tester.onPost( + '/fake', + (server) => server.reply(200, null), + data: { + 'number': '3', + 'double': '-13.57', + 'pattern_without_delimiter': 'patternWithoutDelimiter', + 'byte': '0', + 'float': '1.23', + 'integer': '45', + 'int32': '2147483647', + 'int64': '9223372036854775807', + 'date': '2020-08-11', + 'dateTime': '2020-08-11T12:30:55.123Z', + 'binary': '[0, 1, 2, 3, 4, 5]', + }, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + 'content-length': Matchers.integer, + }, + ); + + final response = await client.getFakeApi().testEndpointParameters( + number: 3, + double_: -13.57, + patternWithoutDelimiter: 'patternWithoutDelimiter', + byte: '0', + float: 1.23, + integer: 45, + int32: 2147483647, + int64: 9223372036854775807, + date: Date(2020, 8, 11), + dateTime: DateTime.utc(2020, 8, 11, 12, 30, 55, 123), + binary: Uint8List.fromList([0, 1, 2, 3, 4, 5]), + ); + + expect(response.statusCode, 200); + }); + + test('minimal', () async { + tester.onPost( + '/fake', + (server) => server.reply(200, null), + data: { + 'byte': '0', + 'double': '-13.57', + 'number': '3', + 'pattern_without_delimiter': 'patternWithoutDelimiter', + }, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + 'content-length': Matchers.integer, + }, + ); + + final response = await client.getFakeApi().testEndpointParameters( + number: 3, + double_: -13.57, + patternWithoutDelimiter: 'patternWithoutDelimiter', + byte: '0', + ); + + expect(response.statusCode, 200); + }); + }); + + group('testEnumParameters', () { + test('in body data', () async { + // Not sure if this is correct, we are not sending + // form data in the body but some weird map + tester.onGet( + '/fake', + (server) => server.reply(200, null), + data: { + 'enum_form_string': 'formString', + 'enum_form_string_array': Matchers.listParam( + ListParam( + ['foo', 'bar'], + ListFormat.csv, + ), + ), + }, + queryParameters: { + 'enum_query_string': '-efg', + }, + headers: { + 'enum_header_string': '-efg', + 'content-type': 'application/x-www-form-urlencoded', + 'content-length': Matchers.integer, + }, + ); + + final response = await client.getFakeApi().testEnumParameters( + enumFormString: 'formString', + enumFormStringArray: ListBuilder( + ['foo', 'bar'], + ).build(), + ); + + expect(response.statusCode, 200); + }); + + test('in query parameters', () async { + tester.onGet( + '/fake', + (server) => server.reply(200, null), + queryParameters: { + 'enum_query_string_array': Matchers.listParam( + ListParam( + ['a', 'b', 'c'], + ListFormat.multi, + ), + ), + 'enum_query_model_array': Matchers.listParam( + ListParam( + ['_abc', '-efg'], + ListFormat.multi, + ), + ), + 'enum_query_string': 'foo', + 'enum_query_double': 1.23, + 'enum_query_integer': 42, + }, + headers: { + 'enum_header_string': '-efg', + 'content-type': 'application/x-www-form-urlencoded', + }, + data: {}, + ); + + final response = await client.getFakeApi().testEnumParameters( + enumQueryStringArray: ListBuilder( + ['a', 'b', 'c'], + ).build(), + enumQueryModelArray: ListBuilder( + [ModelEnumClass.abc, ModelEnumClass.efg], + ).build(), + enumQueryString: 'foo', + enumQueryDouble: 1.23, + enumQueryInteger: 42, + ); + + expect(response.statusCode, 200); + }); + + test('in header parameters', () async { + tester.onGet( + '/fake', + (server) => server.reply(200, null), + headers: { + 'enum_header_string': 'foo', + 'enum_header_string_array': '[a, b, c]', + 'content-type': 'application/x-www-form-urlencoded', + }, + data: {}, + ); + + final response = await client.getFakeApi().testEnumParameters( + enumHeaderStringArray: ListBuilder( + ['a', 'b', 'c'], + ).build(), + enumHeaderString: 'foo', + ); + + expect(response.statusCode, 200); + }); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart new file mode 100644 index 000000000000..af0363a2edac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/pet_api_test.dart @@ -0,0 +1,298 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:dio/dio.dart'; +import 'package:http_mock_adapter/http_mock_adapter.dart'; +import 'package:http_parser/http_parser.dart'; +import 'package:openapi/openapi.dart'; +import 'package:test/test.dart'; + +void main() { + const photo1 = 'https://localhost/photo1.jpg'; + const photo2 = 'https://localhost/photo2.jpg'; + + late Openapi client; + late DioAdapter tester; + + setUp(() { + client = Openapi(dio: Dio()); + tester = DioAdapter(dio: client.dio); + }); + + tearDown(() { + tester.close(); + }); + + group(PetApi, () { + group('getPetById', () { + test('complete', () async { + tester.onGet( + '/pet/5', + (server) => server.reply(200, { + 'id': 5, + 'name': 'Paula', + 'status': 'sold', + 'category': { + 'id': 1, + 'name': 'dog', + }, + 'photoUrls': [ + '$photo1', + '$photo2', + ], + 'tags': [ + { + 'id': 3, + 'name': 'smart', + }, + { + 'id': 4, + 'name': 'cute', + }, + ] + }), + ); + + final response = await client.getPetApi().getPetById(petId: 5); + + expect(response.statusCode, 200); + expect(response.data, isNotNull); + expect(response.data!.id, 5); + expect(response.data!.name, 'Paula'); + expect(response.data!.status, PetStatusEnum.sold); + expect(response.data!.category?.id, 1); + expect(response.data!.category?.name, 'dog'); + expect(response.data!.photoUrls, hasLength(2)); + expect(response.data!.tags, hasLength(2)); + }); + + test('minimal', () async { + tester.onGet( + '/pet/5', + (server) => server.reply(200, { + 'id': 5, + 'name': 'Paula', + 'photoUrls': [], + }), + ); + + final response = await client.getPetApi().getPetById(petId: 5); + + expect(response.statusCode, 200); + expect(response.data, isNotNull); + expect(response.data!.id, 5); + expect(response.data!.name, 'Paula'); + expect(response.data!.status, isNull); + expect(response.data!.category, isNull); + expect(response.data!.photoUrls, isNotNull); + expect(response.data!.photoUrls, isEmpty); + }); + }); + + group('addPet', () { + test('complete', () async { + tester.onPost( + '/pet', + (server) => server.reply(200, ''), + data: { + 'id': 5, + 'name': 'Paula', + 'status': 'sold', + 'category': { + 'id': 1, + 'name': 'dog', + }, + 'photoUrls': [ + '$photo1', + '$photo2', + ], + 'tags': [ + { + 'id': 3, + 'name': 'smart', + }, + { + 'id': 4, + 'name': 'cute', + }, + ] + }, + headers: { + Headers.contentTypeHeader: Matchers.pattern('application/json'), + Headers.contentLengthHeader: Matchers.integer, + }, + ); + + final response = await client.getPetApi().addPet( + pet: Pet((p) => p + ..id = 5 + ..name = 'Paula' + ..status = PetStatusEnum.sold + ..category = (CategoryBuilder() + ..id = 1 + ..name = 'dog') + ..photoUrls = SetBuilder([photo1, photo2]) + ..tags = ListBuilder([ + Tag((t) => t + ..id = 3 + ..name = 'smart'), + Tag((t) => t + ..id = 4 + ..name = 'cute'), + ]))); + + expect(response.statusCode, 200); + }); + + test('minimal', () async { + tester.onPost( + '/pet', + (server) => server.reply(200, ''), + data: { + 'id': 5, + 'name': 'Paula', + 'photoUrls': [], + }, + headers: { + Headers.contentTypeHeader: Matchers.pattern('application/json'), + Headers.contentLengthHeader: Matchers.integer, + }, + ); + + final response = await client.getPetApi().addPet( + pet: Pet((p) => p + ..id = 5 + ..name = 'Paula')); + + expect(response.statusCode, 200); + }); + }); + + group('getMultiplePets', () { + test('findByStatus', () async { + tester.onRoute( + '/pet/findByStatus', + (server) => server.reply(200, [ + { + 'id': 5, + 'name': 'Paula', + 'status': 'sold', + 'photoUrls': [], + }, + { + 'id': 1, + 'name': 'Mickey', + 'status': 'available', + 'photoUrls': [], + }, + ]), + request: Request( + method: RequestMethods.get, + queryParameters: { + 'status': Matchers.listParam( + ListParam( + ['available', 'sold'], + ListFormat.csv, + ), + ), + }, + ), + ); + + final response = await client.getPetApi().findPetsByStatus( + // ignore: deprecated_member_use + status: ListBuilder([ + PetStatusEnum.available.name, + PetStatusEnum.sold.name, + ]).build(), + ); + + expect(response.statusCode, 200); + expect(response.data, isNotNull); + expect(response.data, hasLength(2)); + expect(response.data![0].id, 5); + expect(response.data![0].name, 'Paula'); + expect(response.data![0].status, PetStatusEnum.sold); + expect(response.data![1].id, 1); + expect(response.data![1].name, 'Mickey'); + expect(response.data![1].status, PetStatusEnum.available); + }); + }); + + group('uploadFile', () { + test('uploadFileWithRequiredFile', () async { + final file = MultipartFile.fromBytes( + [1, 2, 3, 4], + filename: 'test.png', + contentType: MediaType.parse('image/png'), + ); + + tester.onRoute( + '/fake/5/uploadImageWithRequiredFile', + (server) => server.reply(200, { + 'code': 200, + 'type': 'success', + 'message': 'File uploaded', + }), + request: Request( + method: RequestMethods.post, + headers: { + Headers.contentTypeHeader: + Matchers.pattern('multipart/form-data'), + Headers.contentLengthHeader: Matchers.integer, + }, + data: Matchers.formData( + FormData.fromMap({ + r'requiredFile': file, + }), + ), + ), + ); + final response = await client.getPetApi().uploadFileWithRequiredFile( + petId: 5, + requiredFile: file, + ); + + expect(response.statusCode, 200); + expect(response.data?.message, 'File uploaded'); + }); + + test('uploadFileWithRequiredFile & additionalMetadata', () async { + final file = MultipartFile.fromBytes( + [1, 2, 3, 4], + filename: 'test.png', + contentType: MediaType.parse('image/png'), + ); + + tester.onRoute( + '/fake/3/uploadImageWithRequiredFile', + (server) => server.reply(200, { + 'code': 200, + 'type': 'success', + 'message': 'File uploaded', + }), + request: Request( + method: RequestMethods.post, + headers: { + Headers.contentTypeHeader: + Matchers.pattern('multipart/form-data'), + Headers.contentLengthHeader: Matchers.integer, + }, + data: Matchers.formData( + FormData.fromMap({ + 'additionalMetadata': 'foo', + r'requiredFile': file, + }), + ), + ), + ); + final response = await client.getPetApi().uploadFileWithRequiredFile( + petId: 3, + requiredFile: file, + additionalMetadata: 'foo', + ); + + expect(response.statusCode, 200); + expect(response.data?.message, 'File uploaded'); + }); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart new file mode 100644 index 000000000000..5b233485f9a3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api/store_api_test.dart @@ -0,0 +1,37 @@ +import 'package:dio/dio.dart'; +import 'package:http_mock_adapter/http_mock_adapter.dart'; +import 'package:openapi/openapi.dart'; +import 'package:test/test.dart'; + +void main() { + late Openapi client; + late DioAdapter tester; + + setUp(() { + client = Openapi(dio: Dio()); + tester = DioAdapter(dio: client.dio); + }); + + tearDown(() { + tester.close(); + }); + + group(StoreApi, () { + test('getInventory', () async { + tester.onGet( + '/store/inventory', + (server) => server.reply(200, { + 'foo': 5, + 'bar': 999, + 'baz': 0, + }), + ); + + final response = await client.getStoreApi().getInventory(); + + expect(response.statusCode, 200); + expect(response.data, isNotNull); + expect(response.data, hasLength(3)); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart new file mode 100644 index 000000000000..1a8ff5203c1c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/api_util_test.dart @@ -0,0 +1,348 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; +import 'package:openapi/openapi.dart'; +import 'package:openapi/src/api_util.dart'; +import 'package:test/test.dart'; + +void main() { + group('api_utils', () { + group('encodeQueryParameter should encode', () { + group('String enum', () { + test('empty String for null', () { + expect( + encodeQueryParameter( + standardSerializers, + null, + const FullType(ModelEnumClass), + ), + '', + ); + }); + + test('correct String for value', () { + expect( + encodeQueryParameter( + standardSerializers, + ModelEnumClass.leftParenthesisXyzRightParenthesis, + const FullType(ModelEnumClass), + ), + '(xyz)', + ); + }); + }); + + group('int enum', () { + test('empty String for null', () { + expect( + encodeQueryParameter( + standardSerializers, + null, + const FullType(EnumTestEnumIntegerEnum), + ), + '', + ); + }); + + test('correct int for value', () { + expect( + encodeQueryParameter( + standardSerializers, + EnumTestEnumIntegerEnum.numberNegative1, + const FullType(EnumTestEnumIntegerEnum), + ), + -1, + ); + }); + }); + }); + + group('encodeCollectionQueryParameter should encode', () { + final serializers = (standardSerializers.toBuilder() + ..addBuilderFactory( + const FullType(BuiltList, [FullType(ModelEnumClass)]), + () => ListBuilder(), + ) + ..addBuilderFactory( + const FullType(BuiltList, [FullType(EnumTestEnumIntegerEnum)]), + () => ListBuilder(), + )) + .build(); + + group('String enum', () { + test('empty ListParam for empty list', () { + final param = encodeCollectionQueryParameter( + serializers, + [].build(), + const FullType(BuiltList, [FullType(ModelEnumClass)]), + ); + + expect(param.value, isEmpty); + expect(param.format, ListFormat.multi); + }); + + test('correct ListParam for value', () { + final param = encodeCollectionQueryParameter( + serializers, + [ + ModelEnumClass.leftParenthesisXyzRightParenthesis, + ModelEnumClass.efg, + ].build(), + const FullType(BuiltList, [FullType(ModelEnumClass)]), + ); + + expect(param.value, hasLength(2)); + expect(param.value, containsAll(['-efg', '(xyz)'])); + expect(param.format, ListFormat.multi); + }); + }); + + group('int enum', () { + test('empty ListParam for empty list', () { + final param = encodeCollectionQueryParameter( + serializers, + [].build(), + const FullType(BuiltList, [FullType(EnumTestEnumIntegerEnum)]), + ); + + expect(param.value, isEmpty); + expect(param.format, ListFormat.multi); + }); + + test('correct ListParam for value', () { + final param = encodeCollectionQueryParameter( + serializers, + [ + EnumTestEnumIntegerEnum.number1, + EnumTestEnumIntegerEnum.numberNegative1, + ].build(), + const FullType(BuiltList, [FullType(EnumTestEnumIntegerEnum)]), + ); + + expect(param.value, hasLength(2)); + expect(param.value, containsAll([1, -1])); + expect(param.format, ListFormat.multi); + }); + }); + }); + + group('encodeFormParameter should return', () { + test('empty String for null', () { + expect( + encodeFormParameter( + standardSerializers, + null, + const FullType(Cat), + ), + '', + ); + }); + + test('String for String', () { + expect( + encodeFormParameter( + standardSerializers, + 'foo', + const FullType(String), + ), + 'foo', + ); + }); + + test('List for BuiltList', () { + expect( + encodeFormParameter( + standardSerializers, + ListBuilder(['foo', 'bar', 'baz']).build(), + const FullType(BuiltList, [FullType(String)]), + ), + ['foo', 'bar', 'baz'], + ); + }); + + test('Map for BuiltList', () { + expect( + encodeFormParameter( + standardSerializers, + MapBuilder({ + 'foo': 'foo-value', + 'bar': 'bar-value', + 'baz': 'baz-value', + }).build(), + const FullType(BuiltMap, [FullType(String), FullType(String)]), + ), + { + 'foo': 'foo-value', + 'bar': 'bar-value', + 'baz': 'baz-value', + }, + ); + }); + + test('num for num', () { + expect( + encodeFormParameter(standardSerializers, 0, const FullType(int)), + 0, + ); + expect( + encodeFormParameter(standardSerializers, 1, const FullType(int)), + 1, + ); + expect( + encodeFormParameter(standardSerializers, 1.0, const FullType(num)), + 1.0, + ); + expect( + encodeFormParameter( + standardSerializers, 1.234, const FullType(double)), + 1.234, + ); + }); + + test('List for BuiltList', () { + expect( + encodeFormParameter( + standardSerializers, + ListBuilder([0, 1, 2, 3, 4.5, -123.456]).build(), + const FullType(BuiltList, [FullType(num)]), + ), + [0, 1, 2, 3, 4.5, -123.456], + ); + }); + + test('bool for bool', () { + expect( + encodeFormParameter( + standardSerializers, + true, + const FullType(bool), + ), + true, + ); + expect( + encodeFormParameter( + standardSerializers, + false, + const FullType(bool), + ), + false, + ); + }); + + test('String for Date', () { + expect( + encodeFormParameter( + standardSerializers, + DateTime.utc(2020, 8, 11), + const FullType(DateTime), + ), + '2020-08-11T00:00:00.000Z', + ); + }); + + test('String for DateTime', () { + expect( + encodeFormParameter( + standardSerializers, + DateTime.utc(2020, 8, 11, 12, 30, 55, 123), + const FullType(DateTime), + ), + '2020-08-11T12:30:55.123Z', + ); + }); + + test('JSON String for Cat', () { + // Not sure that is even a valid case, + // sending complex objects via FormData may not work as expected + expect( + encodeFormParameter( + standardSerializers, + (CatBuilder() + ..color = 'black' + ..className = 'cat' + ..declawed = false) + .build(), + const FullType(Cat), + ), + '{"color":"black","declawed":false,"className":"cat"}', + ); + }); + }); + + test('encodes FormData correctly', () { + final data = FormData.fromMap({ + 'null': encodeFormParameter( + standardSerializers, + null, + const FullType(num), + ), + 'empty': encodeFormParameter( + standardSerializers, + '', + const FullType(String), + ), + 'string_list': encodeFormParameter( + standardSerializers, + ListBuilder(['foo', 'bar', 'baz']).build(), + const FullType(BuiltList, [FullType(String)]), + ), + 'num_list': encodeFormParameter( + standardSerializers, + ListBuilder([0, 1, 2, 3, 4.5, -123.456]).build(), + const FullType(BuiltList, [FullType(num)]), + ), + 'string_map': encodeFormParameter( + standardSerializers, + MapBuilder({ + 'foo': 'foo-value', + 'bar': 'bar-value', + 'baz': 'baz-value', + }).build(), + const FullType(BuiltMap, [FullType(String), FullType(String)]), + ), + 'bool': encodeFormParameter( + standardSerializers, + true, + const FullType(bool), + ), + 'double': encodeFormParameter( + standardSerializers, + -123.456, + const FullType(double), + ), + 'date_time': encodeFormParameter( + standardSerializers, + DateTime.utc(2020, 8, 11, 12, 30, 55, 123), + const FullType(DateTime), + ), + }); + + expect( + data.fields, + pairwiseCompare, MapEntry>( + >[ + MapEntry('null', ''), + MapEntry('empty', ''), + MapEntry('string_list', 'foo'), + MapEntry('string_list', 'bar'), + MapEntry('string_list', 'baz'), + MapEntry('num_list', '0'), + MapEntry('num_list', '1'), + MapEntry('num_list', '2'), + MapEntry('num_list', '3'), + MapEntry('num_list', '4.5'), + MapEntry('num_list', '-123.456'), + MapEntry('string_map[foo]', 'foo-value'), + MapEntry('string_map[bar]', 'bar-value'), + MapEntry('string_map[baz]', 'baz-value'), + MapEntry('bool', 'true'), + MapEntry('double', '-123.456'), + MapEntry('date_time', '2020-08-11T12:30:55.123Z'), + ], + (e, a) => e.key == a.key && e.value == a.value, + 'Compares map entries by key and value', + ), + ); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart new file mode 100644 index 000000000000..9422fe8e47dd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_serializer_test.dart @@ -0,0 +1,31 @@ +import 'package:openapi/openapi.dart'; +import 'package:openapi/src/date_serializer.dart'; +import 'package:test/test.dart'; + +void main() { + final date1 = Date(1999, 3, 25); + const serializer = DateSerializer(); + + group(DateSerializer, () { + test('serialize', () { + expect( + serializer.serialize(serializers, date1), + '1999-03-25', + ); + }); + + test('deserialize date', () { + expect( + serializer.deserialize(serializers, '1999-03-25'), + date1, + ); + }); + + test('deserialize ISO', () { + expect( + serializer.deserialize(serializers, '1999-03-25T12:30:55.123Z'), + date1, + ); + }); + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart new file mode 100644 index 000000000000..34675bd672e1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/test/model/date_test.dart @@ -0,0 +1,25 @@ +import 'package:openapi/openapi.dart'; +import 'package:test/test.dart'; + +void main() { + final date1 = Date(1999, 3, 25); + final date2 = Date(1999, 1, 1); + + group(Date, () { + test('toString', () { + expect(date1.toString(), '1999-03-25'); + }); + + test('compare >', () { + expect(date1.compareTo(date2), 1); + }); + + test('compare <', () { + expect(date2.compareTo(date1), -1); + }); + + test('compare =', () { + expect(date1.compareTo(date1), 0); + }); + }); +} From 64997eafc238aca1bf9103a75f18e134e12904b9 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:25:47 +0200 Subject: [PATCH 20/31] update pom for CI --- .../openapi3/client/petstore/dart-next/dio/built_value/pom.xml | 2 +- .../client/petstore/dart-next/dio/json_serializable/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml b/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml index c17c86ab7ff2..128da6843047 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml @@ -1,7 +1,7 @@ 4.0.0 org.openapitools - DartDioBuiltValueTests + DartNextDioBuiltValueTests pom 1.0.0-SNAPSHOT DartDio Petstore Client Lib Fake diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml index f7d20e4d37a7..8ec5f024ed74 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml +++ b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml @@ -1,7 +1,7 @@ 4.0.0 org.openapitools - DartDioPetstoreClientLibFakeJsonSerializableTests + DartNextDioJsonSerializableTests pom 1.0.0-SNAPSHOT DartDio Petstore Client Lib Fake Json Serializable From 2676a8b3c1cbc4d6d54518aed8ce6943f12af5bd Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:53:39 +0200 Subject: [PATCH 21/31] fix tests abd paths --- .../languages/DartNextAbstractCodegen.java | 11 +-- .../languages/DartNextClientCodegen.java | 25 +------ .../resources/dart-next/dart-keywords.txt | 69 ------------------- .../codegen/dart/next/DartNextModelTest.java | 59 ++++++++-------- 4 files changed, 39 insertions(+), 125 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java index b2c1239ca470..e19066d0ca4d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java @@ -120,10 +120,11 @@ public DartNextAbstractCodegen() { ) ); - outputFolder = "generated-code/dart"; + ///src/main/resources/dart-next + // outputFolder = "generated-code/dart"; modelTemplateFiles.put("model.mustache", ".dart"); apiTemplateFiles.put("api.mustache", ".dart"); - embeddedTemplateDir = templateDir = "dart2"; + // embeddedTemplateDir = templateDir = "dart2"; apiPackage = "api"; modelPackage = "model"; modelDocTemplateFiles.put("object_doc.mustache", ".md"); @@ -332,9 +333,9 @@ public void processOpts() { additionalProperties.put("modelDocPath", modelDocPath); // check to not overwrite a custom templateDir - if (templateDir == null) { - embeddedTemplateDir = templateDir = "dart2"; - } + // if (templateDir == null) { + // embeddedTemplateDir = templateDir = "dart2"; + // } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java index 9b0b00c5ad6b..5d54a6a35655 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -55,29 +55,6 @@ import io.swagger.v3.oas.models.media.Schema; -import com.google.common.collect.Sets; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.servers.Server; - -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; -import java.util.stream.Stream; - -import static org.openapitools.codegen.utils.StringUtils.*; - - /* * Copyright 2021 OpenAPI-Generator Contributors (https://openapi-generator.tech) @@ -147,7 +124,7 @@ public DartNextClientCodegen() { .build(); outputFolder = "generated-code/dart-next"; - embeddedTemplateDir = "dart"; + embeddedTemplateDir = "dart-next"; this.setTemplateDir(embeddedTemplateDir); supportedLibraries.put(NETWORKING_LIBRARY_DIO, "[DEFAULT] dio"); diff --git a/modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt b/modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt deleted file mode 100644 index 5e51f8cceff6..000000000000 --- a/modules/openapi-generator/src/main/resources/dart-next/dart-keywords.txt +++ /dev/null @@ -1,69 +0,0 @@ -abstract -as -assert -async -await -break -case -catch -class -const -continue -covariant -default -deferred -do -dynamic -else -enum -export -extends -extension -external -factory -false -final -finally -for -Function -get -hide -if -implements -import -in -inout -interface -is -late -library -mixin -native -new -null -of -on -operator -out -part -patch -required -rethrow -return -set -show -source -static -super -switch -sync -this -throw -true -try -typedef -var -void -while -with -yield \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java index 8a9066ab208a..57de59bbd3a7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/next/DartNextModelTest.java @@ -29,11 +29,11 @@ public class DartNextModelTest { @Test(description = "convert a simple model") public void simpleModelTest() { - final Schema model = new Schema() + final Schema model = new Schema() .description("a sample model") - .addProperties("id", new IntegerSchema()) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) + .addProperty("id", new IntegerSchema()) + .addProperty("name", new StringSchema()) + .addProperty("createdAt", new DateTimeSchema()) .addRequiredItem("id") .addRequiredItem("name"); final DefaultCodegen codegen = new DartNextClientCodegen(); @@ -83,10 +83,10 @@ public void simpleModelTest() { public void simpleModelWithTimeMachineTest() { final Schema model = new Schema() .description("a sample model") - .addProperties("id", new IntegerSchema()) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addProperties("birthDate", new DateSchema()) + .addProperty("id", new IntegerSchema()) + .addProperty("name", new StringSchema()) + .addProperty("createdAt", new DateTimeSchema()) + .addProperty("birthDate", new DateSchema()) .addRequiredItem("id") .addRequiredItem("name"); @@ -150,8 +150,8 @@ public void simpleModelWithTimeMachineTest() { public void listPropertyTest() { final Schema model = new Schema() .description("a sample model") - .addProperties("id", new IntegerSchema()) - .addProperties("urls", new ArraySchema() + .addProperty("id", new IntegerSchema()) + .addProperty("urls", new ArraySchema() .items(new StringSchema())) .addRequiredItem("id"); @@ -183,7 +183,8 @@ public void listPropertyTest() { Assert.assertEquals(property2.dataType, "BuiltList"); Assert.assertEquals(property2.name, "urls"); Assert.assertEquals(property2.baseType, "BuiltList"); - Assert.assertEquals(property2.containerType, "array"); + //TODO: change this back to array after containerTypeMapped lands + Assert.assertEquals(property2.containerType, "BuiltList"); Assert.assertFalse(property2.required); Assert.assertTrue(property2.isPrimitiveType); Assert.assertTrue(property2.isContainer); @@ -193,8 +194,8 @@ public void listPropertyTest() { public void setPropertyTest() { final Schema model = new Schema() .description("a sample model") - .addProperties("id", new IntegerSchema()) - .addProperties("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true)) + .addProperty("id", new IntegerSchema()) + .addProperty("urls", new ArraySchema().items(new StringSchema()).uniqueItems(true)) .addRequiredItem("id"); final DefaultCodegen codegen = new DartNextClientCodegen(); @@ -225,7 +226,8 @@ public void setPropertyTest() { Assert.assertEquals(property2.dataType, "BuiltSet"); Assert.assertEquals(property2.name, "urls"); Assert.assertEquals(property2.baseType, "BuiltSet"); - Assert.assertEquals(property2.containerType, "set"); + //TODO: change this back to set after containerTypeMapped lands + Assert.assertEquals(property2.containerType, "BuiltSet"); Assert.assertFalse(property2.required); Assert.assertTrue(property2.isPrimitiveType); Assert.assertTrue(property2.isContainer); @@ -235,7 +237,7 @@ public void setPropertyTest() { public void mapPropertyTest() { final Schema model = new Schema() .description("a sample model") - .addProperties("translations", new MapSchema() + .addProperty("translations", new MapSchema() .additionalProperties(new StringSchema())) .addRequiredItem("id"); @@ -257,7 +259,8 @@ public void mapPropertyTest() { Assert.assertEquals(property1.dataType, "BuiltMap"); Assert.assertEquals(property1.name, "translations"); Assert.assertEquals(property1.baseType, "BuiltMap"); - Assert.assertEquals(property1.containerType, "map"); + //TODO: change this back to map after containerTypeMapped lands + Assert.assertEquals(property1.containerType, "BuiltMap"); Assert.assertFalse(property1.required); Assert.assertTrue(property1.isContainer); Assert.assertTrue(property1.isPrimitiveType); @@ -267,7 +270,7 @@ public void mapPropertyTest() { public void complexPropertyTest() { final Schema model = new Schema() .description("a sample model") - .addProperties("children", new Schema().$ref("#/definitions/Children")); + .addProperty("children", new Schema().$ref("#/definitions/Children")); final DefaultCodegen codegen = new DartNextClientCodegen(); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); @@ -295,7 +298,7 @@ public void complexPropertyTest() { public void complexListProperty() { final Schema model = new Schema() .description("a sample model") - .addProperties("children", new ArraySchema() + .addProperty("children", new ArraySchema() .items(new Schema().$ref("#/definitions/Children"))); final DefaultCodegen codegen = new DartNextClientCodegen(); @@ -316,7 +319,8 @@ public void complexListProperty() { Assert.assertEquals(property1.dataType, "BuiltList"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "BuiltList"); - Assert.assertEquals(property1.containerType, "array"); + //TODO: change this back to array after containerTypeMapped lands + Assert.assertEquals(property1.containerType, "BuiltList"); Assert.assertFalse(property1.required); Assert.assertTrue(property1.isContainer); } @@ -325,7 +329,7 @@ public void complexListProperty() { public void complexMapSchema() { final Schema model = new Schema() .description("a sample model") - .addProperties("children", new MapSchema() + .addProperty("children", new MapSchema() .additionalProperties(new Schema().$ref("#/definitions/Children"))); final DefaultCodegen codegen = new DartNextClientCodegen(); @@ -347,7 +351,8 @@ public void complexMapSchema() { Assert.assertEquals(property1.dataType, "BuiltMap"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "BuiltMap"); - Assert.assertEquals(property1.containerType, "map"); + //TODO: change this back to array after containerTypeMapped lands + Assert.assertEquals(property1.containerType, "BuiltMap"); Assert.assertFalse(property1.required); Assert.assertTrue(property1.isContainer); } @@ -446,9 +451,9 @@ public void collectionDefaultValues() { array.setDefault("[]"); final Schema model = new Schema() .description("a sample model") - .addProperties("arrayNoDefault", new ArraySchema()) - .addProperties("arrayEmptyDefault", array) - .addProperties("mapNoDefault", new MapSchema()); + .addProperty("arrayNoDefault", new ArraySchema()) + .addProperty("arrayEmptyDefault", array) + .addProperty("mapNoDefault", new MapSchema()); final DefaultCodegen codegen = new DartNextClientCodegen(); codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, DartNextClientCodegen.SERIALIZATION_LIBRARY_BUILT_VALUE); codegen.setOpenAPI(TestUtils.createOpenAPIWithOneSchema("sample", model)); @@ -476,9 +481,9 @@ public void dateDefaultValues() { dateTime.setDefault("2021-01-01T14:00:00Z"); final Schema model = new Schema() .description("a sample model") - .addProperties("date", date) - .addProperties("dateTime", dateTime) - .addProperties("mapNoDefault", new MapSchema()); + .addProperty("date", date) + .addProperty("dateTime", dateTime) + .addProperty("mapNoDefault", new MapSchema()); final DefaultCodegen codegen = new DartNextClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); From 565e2428154fd5aca5b48853d3f1c1e7b5cec8cd Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 04:54:57 +0200 Subject: [PATCH 22/31] gen samples --- .../dart-dio/dio/json_serializable/.gitignore | 41 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 341 ++++ .../.openapi-generator/VERSION | 1 + .../dart-dio/dio/json_serializable/README.md | 264 ++++ .../json_serializable/analysis_options.yaml | 12 + .../dart-dio/dio/json_serializable/build.yaml | 18 + .../doc/AdditionalPropertiesClass.md | 16 + .../dio/json_serializable/doc/Addressable.md | 16 + .../doc/AllOfWithSingleRef.md | 16 + .../dio/json_serializable/doc/Animal.md | 16 + .../json_serializable/doc/AnotherFakeApi.md | 57 + .../dio/json_serializable/doc/ApiResponse.md | 17 + .../dio/json_serializable/doc/Apple.md | 15 + .../json_serializable/doc/AppleAllOfDisc.md | 16 + .../doc/AppleGrandparentDisc.md | 16 + .../json_serializable/doc/AppleOneOfDisc.md | 16 + .../dio/json_serializable/doc/AppleReqDisc.md | 16 + .../json_serializable/doc/AppleVariant1.md | 15 + .../doc/ArrayOfArrayOfNumberOnly.md | 15 + .../doc/ArrayOfNumberOnly.md | 15 + .../dio/json_serializable/doc/ArrayTest.md | 17 + .../dio/json_serializable/doc/Banana.md | 15 + .../json_serializable/doc/BananaAllOfDisc.md | 16 + .../doc/BananaGrandparentDisc.md | 16 + .../json_serializable/doc/BananaOneOfDisc.md | 16 + .../json_serializable/doc/BananaReqDisc.md | 16 + .../dart-dio/dio/json_serializable/doc/Bar.md | 22 + .../dio/json_serializable/doc/BarApi.md | 55 + .../dio/json_serializable/doc/BarCreate.md | 22 + .../dio/json_serializable/doc/BarRef.md | 19 + .../json_serializable/doc/BarRefOrValue.md | 19 + .../json_serializable/doc/Capitalization.md | 20 + .../dart-dio/dio/json_serializable/doc/Cat.md | 17 + .../dio/json_serializable/doc/Category.md | 16 + .../dio/json_serializable/doc/ClassModel.md | 15 + .../doc/ComposedDiscMissingFromProperties.md | 15 + .../doc/ComposedDiscOptionalTypeCorrect.md | 15 + .../ComposedDiscOptionalTypeInconsistent.md | 15 + .../doc/ComposedDiscOptionalTypeIncorrect.md | 15 + .../doc/ComposedDiscRequiredInconsistent.md | 15 + .../doc/ComposedDiscTypeInconsistent.md | 15 + .../doc/ComposedDiscTypeIncorrect.md | 15 + .../dio/json_serializable/doc/DefaultApi.md | 244 +++ .../json_serializable/doc/DeprecatedObject.md | 15 + .../doc/DiscMissingFromProperties.md | 15 + .../doc/DiscOptionalTypeCorrect.md | 15 + .../doc/DiscOptionalTypeIncorrect.md | 15 + .../doc/DiscTypeIncorrect.md | 15 + .../dart-dio/dio/json_serializable/doc/Dog.md | 17 + .../dio/json_serializable/doc/Entity.md | 19 + .../dio/json_serializable/doc/EntityRef.md | 21 + .../dio/json_serializable/doc/EnumArrays.md | 16 + .../dio/json_serializable/doc/EnumTest.md | 22 + .../dio/json_serializable/doc/Extensible.md | 17 + .../dio/json_serializable/doc/FakeApi.md | 816 ++++++++++ .../doc/FakeClassnameTags123Api.md | 61 + .../doc/FileSchemaTestClass.md | 16 + .../dart-dio/dio/json_serializable/doc/Foo.md | 21 + .../dio/json_serializable/doc/FooApi.md | 93 ++ .../doc/FooBasicGetDefaultResponse.md | 15 + .../dio/json_serializable/doc/FooRef.md | 20 + .../json_serializable/doc/FooRefOrValue.md | 19 + .../dio/json_serializable/doc/FormatTest.md | 30 + .../dio/json_serializable/doc/Fruit.md | 17 + .../json_serializable/doc/FruitAllOfDisc.md | 15 + .../json_serializable/doc/FruitAnyOfDisc.md | 15 + .../doc/FruitGrandparentDisc.md | 15 + .../json_serializable/doc/FruitInlineDisc.md | 17 + .../doc/FruitInlineDiscOneOf.md | 16 + .../doc/FruitInlineDiscOneOf1.md | 16 + .../doc/FruitInlineInlineDisc.md | 15 + .../doc/FruitInlineInlineDiscOneOf.md | 16 + .../doc/FruitInlineInlineDiscOneOf1.md | 16 + .../doc/FruitInlineInlineDiscOneOfOneOf.md | 15 + .../json_serializable/doc/FruitOneOfDisc.md | 15 + .../dio/json_serializable/doc/FruitReqDisc.md | 17 + .../dio/json_serializable/doc/FruitType.md | 15 + .../json_serializable/doc/FruitVariant1.md | 16 + .../dio/json_serializable/doc/GigaOneOf.md | 15 + .../json_serializable/doc/GrapeVariant1.md | 15 + .../json_serializable/doc/HasOnlyReadOnly.md | 16 + .../doc/HealthCheckResult.md | 15 + .../dio/json_serializable/doc/MapTest.md | 18 + ...dPropertiesAndAdditionalPropertiesClass.md | 17 + .../json_serializable/doc/Model200Response.md | 16 + .../dio/json_serializable/doc/ModelClient.md | 15 + .../json_serializable/doc/ModelEnumClass.md | 14 + .../dio/json_serializable/doc/ModelFile.md | 15 + .../dio/json_serializable/doc/ModelList.md | 15 + .../dio/json_serializable/doc/ModelReturn.md | 15 + .../dio/json_serializable/doc/Name.md | 18 + .../json_serializable/doc/NullableClass.md | 26 + .../dio/json_serializable/doc/NumberOnly.md | 15 + .../doc/ObjectWithDeprecatedFields.md | 18 + .../doc/OneOfPrimitiveChild.md | 15 + .../dio/json_serializable/doc/Order.md | 20 + .../json_serializable/doc/OuterComposite.md | 17 + .../dio/json_serializable/doc/OuterEnum.md | 14 + .../doc/OuterEnumDefaultValue.md | 14 + .../json_serializable/doc/OuterEnumInteger.md | 14 + .../doc/OuterEnumIntegerDefaultValue.md | 14 + .../doc/OuterObjectWithEnumProperty.md | 15 + .../dio/json_serializable/doc/Parent.md | 15 + .../dio/json_serializable/doc/Pasta.md | 20 + .../dart-dio/dio/json_serializable/doc/Pet.md | 20 + .../dio/json_serializable/doc/PetApi.md | 439 ++++++ .../dio/json_serializable/doc/Pizza.md | 20 + .../json_serializable/doc/PizzaSpeziale.md | 20 + .../json_serializable/doc/ReadOnlyFirst.md | 16 + .../json_serializable/doc/SingleRefType.md | 14 + .../json_serializable/doc/SpecialModelName.md | 15 + .../dio/json_serializable/doc/StoreApi.md | 188 +++ .../dart-dio/dio/json_serializable/doc/Tag.md | 16 + .../dio/json_serializable/doc/User.md | 22 + .../dio/json_serializable/doc/UserApi.md | 359 +++++ .../dio/json_serializable/lib/openapi.dart | 120 ++ .../dio/json_serializable/lib/src/api.dart | 124 ++ .../lib/src/api/another_fake_api.dart | 109 ++ .../lib/src/api/bar_api.dart | 110 ++ .../lib/src/api/default_api.dart | 434 ++++++ .../lib/src/api/fake_api.dart | 1380 +++++++++++++++++ .../src/api/fake_classname_tags123_api.dart | 116 ++ .../lib/src/api/foo_api.dart | 179 +++ .../lib/src/api/pet_api.dart | 727 +++++++++ .../lib/src/api/store_api.dart | 303 ++++ .../lib/src/api/user_api.dart | 524 +++++++ .../lib/src/auth/api_key_auth.dart | 30 + .../json_serializable/lib/src/auth/auth.dart | 18 + .../lib/src/auth/basic_auth.dart | 37 + .../lib/src/auth/bearer_auth.dart | 26 + .../json_serializable/lib/src/auth/oauth.dart | 26 + .../lib/src/deserialize.dart | 345 +++++ .../model/additional_properties_class.dart | 70 + .../lib/src/model/addressable.dart | 72 + .../lib/src/model/all_of_with_single_ref.dart | 71 + .../lib/src/model/animal.dart | 70 + .../lib/src/model/api_response.dart | 86 + .../lib/src/model/apple.dart | 54 + .../lib/src/model/apple_all_of_disc.dart | 70 + .../lib/src/model/apple_grandparent_disc.dart | 70 + .../lib/src/model/apple_one_of_disc.dart | 71 + .../lib/src/model/apple_req_disc.dart | 70 + .../lib/src/model/apple_variant1.dart | 54 + .../model/array_of_array_of_number_only.dart | 54 + .../lib/src/model/array_of_number_only.dart | 54 + .../lib/src/model/array_test.dart | 87 ++ .../lib/src/model/banana.dart | 54 + .../lib/src/model/banana_all_of_disc.dart | 70 + .../src/model/banana_grandparent_disc.dart | 70 + .../lib/src/model/banana_one_of_disc.dart | 71 + .../lib/src/model/banana_req_disc.dart | 70 + .../json_serializable/lib/src/model/bar.dart | 174 +++ .../lib/src/model/bar_create.dart | 175 +++ .../lib/src/model/bar_ref.dart | 126 ++ .../lib/src/model/bar_ref_or_value.dart | 125 ++ .../lib/src/model/capitalization.dart | 135 ++ .../json_serializable/lib/src/model/cat.dart | 89 ++ .../lib/src/model/category.dart | 70 + .../lib/src/model/class_model.dart | 54 + ...composed_disc_missing_from_properties.dart | 55 + .../composed_disc_optional_type_correct.dart | 55 + ...posed_disc_optional_type_inconsistent.dart | 56 + ...composed_disc_optional_type_incorrect.dart | 55 + .../composed_disc_required_inconsistent.dart | 56 + .../composed_disc_type_inconsistent.dart | 56 + .../model/composed_disc_type_incorrect.dart | 55 + .../lib/src/model/deprecated_object.dart | 55 + .../model/disc_missing_from_properties.dart | 54 + .../src/model/disc_optional_type_correct.dart | 54 + .../model/disc_optional_type_incorrect.dart | 54 + .../lib/src/model/disc_type_incorrect.dart | 54 + .../json_serializable/lib/src/model/dog.dart | 89 ++ .../lib/src/model/entity.dart | 123 ++ .../lib/src/model/entity_ref.dart | 157 ++ .../lib/src/model/enum_arrays.dart | 92 ++ .../lib/src/model/enum_test.dart | 218 +++ .../lib/src/model/extensible.dart | 89 ++ .../lib/src/model/file_schema_test_class.dart | 71 + .../json_serializable/lib/src/model/foo.dart | 158 ++ .../model/foo_basic_get_default_response.dart | 55 + .../lib/src/model/foo_ref.dart | 142 ++ .../lib/src/model/foo_ref_or_value.dart | 125 ++ .../lib/src/model/format_test.dart | 302 ++++ .../lib/src/model/fruit.dart | 88 ++ .../lib/src/model/fruit_all_of_disc.dart | 56 + .../lib/src/model/fruit_any_of_disc.dart | 55 + .../lib/src/model/fruit_grandparent_disc.dart | 56 + .../lib/src/model/fruit_inline_disc.dart | 88 ++ .../src/model/fruit_inline_disc_one_of.dart | 70 + .../src/model/fruit_inline_disc_one_of1.dart | 70 + .../src/model/fruit_inline_inline_disc.dart | 56 + .../fruit_inline_inline_disc_one_of.dart | 71 + .../fruit_inline_inline_disc_one_of1.dart | 71 + ...ruit_inline_inline_disc_one_of_one_of.dart | 54 + .../lib/src/model/fruit_one_of_disc.dart | 56 + .../lib/src/model/fruit_req_disc.dart | 88 ++ .../lib/src/model/fruit_type.dart | 54 + .../lib/src/model/fruit_variant1.dart | 72 + .../lib/src/model/giga_one_of.dart | 55 + .../lib/src/model/grape_variant1.dart | 54 + .../lib/src/model/has_only_read_only.dart | 70 + .../lib/src/model/health_check_result.dart | 54 + .../lib/src/model/map_test.dart | 113 ++ ...rties_and_additional_properties_class.dart | 87 ++ .../lib/src/model/model200_response.dart | 70 + .../lib/src/model/model_client.dart | 54 + .../lib/src/model/model_enum_class.dart | 18 + .../lib/src/model/model_file.dart | 55 + .../lib/src/model/model_list.dart | 54 + .../lib/src/model/model_return.dart | 54 + .../json_serializable/lib/src/model/name.dart | 102 ++ .../lib/src/model/nullable_class.dart | 230 +++ .../lib/src/model/number_only.dart | 54 + .../model/object_with_deprecated_fields.dart | 107 ++ .../lib/src/model/one_of_primitive_child.dart | 54 + .../lib/src/model/order.dart | 148 ++ .../lib/src/model/outer_composite.dart | 86 + .../lib/src/model/outer_enum.dart | 18 + .../src/model/outer_enum_default_value.dart | 18 + .../lib/src/model/outer_enum_integer.dart | 18 + .../outer_enum_integer_default_value.dart | 18 + .../outer_object_with_enum_property.dart | 55 + .../lib/src/model/parent.dart | 54 + .../lib/src/model/pasta.dart | 142 ++ .../json_serializable/lib/src/model/pet.dart | 150 ++ .../lib/src/model/pizza.dart | 142 ++ .../lib/src/model/pizza_speziale.dart | 142 ++ .../lib/src/model/read_only_first.dart | 70 + .../lib/src/model/single_ref_type.dart | 16 + .../lib/src/model/special_model_name.dart | 54 + .../json_serializable/lib/src/model/tag.dart | 70 + .../json_serializable/lib/src/model/user.dart | 167 ++ .../dio/json_serializable/pubspec.yaml | 16 + .../additional_properties_class_test.dart | 21 + .../test/addressable_test.dart | 23 + .../test/all_of_with_single_ref_test.dart | 21 + .../json_serializable/test/animal_test.dart | 21 + .../test/another_fake_api_test.dart | 20 + .../test/api_response_test.dart | 26 + .../test/apple_all_of_disc_test.dart | 21 + .../test/apple_grandparent_disc_test.dart | 21 + .../test/apple_one_of_disc_test.dart | 21 + .../test/apple_req_disc_test.dart | 21 + .../json_serializable/test/apple_test.dart | 16 + .../test/apple_variant1_test.dart | 16 + .../array_of_array_of_number_only_test.dart | 16 + .../test/array_of_number_only_test.dart | 16 + .../test/array_test_test.dart | 26 + .../test/banana_all_of_disc_test.dart | 21 + .../test/banana_grandparent_disc_test.dart | 21 + .../test/banana_one_of_disc_test.dart | 21 + .../test/banana_req_disc_test.dart | 21 + .../json_serializable/test/banana_test.dart | 16 + .../json_serializable/test/bar_api_test.dart | 18 + .../test/bar_create_test.dart | 56 + .../test/bar_ref_or_value_test.dart | 41 + .../json_serializable/test/bar_ref_test.dart | 41 + .../dio/json_serializable/test/bar_test.dart | 55 + .../test/capitalization_test.dart | 42 + .../dio/json_serializable/test/cat_test.dart | 26 + .../json_serializable/test/category_test.dart | 21 + .../test/class_model_test.dart | 16 + ...sed_disc_missing_from_properties_test.dart | 16 + ...posed_disc_optional_type_correct_test.dart | 16 + ..._disc_optional_type_inconsistent_test.dart | 16 + ...sed_disc_optional_type_incorrect_test.dart | 16 + ...posed_disc_required_inconsistent_test.dart | 16 + .../composed_disc_type_inconsistent_test.dart | 16 + .../composed_disc_type_incorrect_test.dart | 16 + .../test/default_api_test.dart | 41 + .../test/deprecated_object_test.dart | 16 + .../disc_missing_from_properties_test.dart | 16 + .../test/disc_optional_type_correct_test.dart | 16 + .../disc_optional_type_incorrect_test.dart | 16 + .../test/disc_type_incorrect_test.dart | 16 + .../dio/json_serializable/test/dog_test.dart | 26 + .../test/entity_ref_test.dart | 53 + .../json_serializable/test/entity_test.dart | 41 + .../test/enum_arrays_test.dart | 21 + .../test/enum_test_test.dart | 51 + .../test/extensible_test.dart | 29 + .../json_serializable/test/fake_api_test.dart | 140 ++ .../test/fake_classname_tags123_api_test.dart | 20 + .../test/file_schema_test_class_test.dart | 21 + .../json_serializable/test/foo_api_test.dart | 25 + .../foo_basic_get_default_response_test.dart | 16 + .../test/foo_ref_or_value_test.dart | 41 + .../json_serializable/test/foo_ref_test.dart | 46 + .../dio/json_serializable/test/foo_test.dart | 51 + .../test/format_test_test.dart | 93 ++ .../test/fruit_all_of_disc_test.dart | 16 + .../test/fruit_any_of_disc_test.dart | 16 + .../test/fruit_grandparent_disc_test.dart | 16 + .../test/fruit_inline_disc_one_of1_test.dart | 21 + .../test/fruit_inline_disc_one_of_test.dart | 21 + .../test/fruit_inline_disc_test.dart | 26 + ...fruit_inline_inline_disc_one_of1_test.dart | 21 + ...inline_inline_disc_one_of_one_of_test.dart | 16 + .../fruit_inline_inline_disc_one_of_test.dart | 21 + .../test/fruit_inline_inline_disc_test.dart | 16 + .../test/fruit_one_of_disc_test.dart | 16 + .../test/fruit_req_disc_test.dart | 26 + .../json_serializable/test/fruit_test.dart | 26 + .../test/fruit_type_test.dart | 16 + .../test/fruit_variant1_test.dart | 21 + .../test/giga_one_of_test.dart | 16 + .../test/grape_variant1_test.dart | 16 + .../test/has_only_read_only_test.dart | 21 + .../test/health_check_result_test.dart | 16 + .../json_serializable/test/map_test_test.dart | 31 + ..._and_additional_properties_class_test.dart | 26 + .../test/model200_response_test.dart | 21 + .../test/model_client_test.dart | 16 + .../test/model_enum_class_test.dart | 9 + .../test/model_file_test.dart | 17 + .../test/model_list_test.dart | 16 + .../test/model_return_test.dart | 16 + .../dio/json_serializable/test/name_test.dart | 31 + .../test/nullable_class_test.dart | 71 + .../test/number_only_test.dart | 16 + .../object_with_deprecated_fields_test.dart | 31 + .../test/one_of_primitive_child_test.dart | 16 + .../json_serializable/test/order_test.dart | 42 + .../test/outer_composite_test.dart | 26 + .../test/outer_enum_default_value_test.dart | 9 + ...outer_enum_integer_default_value_test.dart | 9 + .../test/outer_enum_integer_test.dart | 9 + .../test/outer_enum_test.dart | 9 + .../outer_object_with_enum_property_test.dart | 16 + .../json_serializable/test/parent_test.dart | 16 + .../json_serializable/test/pasta_test.dart | 46 + .../json_serializable/test/pet_api_test.dart | 92 ++ .../dio/json_serializable/test/pet_test.dart | 42 + .../test/pizza_speziale_test.dart | 46 + .../json_serializable/test/pizza_test.dart | 46 + .../test/read_only_first_test.dart | 21 + .../test/single_ref_type_test.dart | 9 + .../test/special_model_name_test.dart | 16 + .../test/store_api_test.dart | 47 + .../dio/json_serializable/test/tag_test.dart | 21 + .../json_serializable/test/user_api_test.dart | 83 + .../dio/json_serializable/test/user_test.dart | 52 + .../dio/built_value/.openapi-generator/FILES | 109 -- .../dart-next/dio/built_value/README.md | 2 +- .../dio/built_value/lib/openapi.dart | 1 + .../lib/src/api/another_fake_api.dart | 37 +- .../dio/built_value/lib/src/api/bar_api.dart | 44 +- .../built_value/lib/src/api/default_api.dart | 164 +- .../dio/built_value/lib/src/api/fake_api.dart | 1168 ++++++++------ .../src/api/fake_classname_tags123_api.dart | 37 +- .../dio/built_value/lib/src/api/foo_api.dart | 76 +- .../dio/built_value/lib/src/api/pet_api.dart | 400 +++-- .../built_value/lib/src/api/store_api.dart | 129 +- .../dio/built_value/lib/src/api/user_api.dart | 250 ++- .../dio/built_value/lib/src/api_client.dart | 27 +- .../dio/built_value/lib/src/api_util.dart | 83 +- .../built_value/lib/src/auth/_exports.dart | 2 +- .../lib/src/auth/api_key_auth.dart | 4 +- .../dio/built_value/lib/src/auth/auth.dart | 3 +- .../built_value/lib/src/auth/basic_auth.dart | 9 +- .../built_value/lib/src/auth/bearer_auth.dart | 3 +- .../dio/built_value/lib/src/auth/oauth.dart | 3 +- .../built_value/lib/src/date_serializer.dart | 1 + .../model/additional_properties_class.dart | 46 +- .../lib/src/model/addressable.dart | 18 +- .../lib/src/model/all_of_with_single_ref.dart | 23 +- .../dio/built_value/lib/src/model/animal.dart | 58 +- .../lib/src/model/api_response.dart | 14 +- .../dio/built_value/lib/src/model/apple.dart | 8 +- .../lib/src/model/apple_all_of_disc.dart | 23 +- .../lib/src/model/apple_grandparent_disc.dart | 30 +- .../lib/src/model/apple_one_of_disc.dart | 33 +- .../lib/src/model/apple_req_disc.dart | 14 +- .../lib/src/model/apple_variant1.dart | 17 +- .../model/array_of_array_of_number_only.dart | 35 +- .../lib/src/model/array_of_number_only.dart | 20 +- .../built_value/lib/src/model/array_test.dart | 30 +- .../dio/built_value/lib/src/model/banana.dart | 8 +- .../lib/src/model/banana_all_of_disc.dart | 23 +- .../src/model/banana_grandparent_disc.dart | 30 +- .../lib/src/model/banana_one_of_disc.dart | 33 +- .../lib/src/model/banana_req_disc.dart | 20 +- .../dio/built_value/lib/src/model/bar.dart | 23 +- .../built_value/lib/src/model/bar_create.dart | 21 +- .../built_value/lib/src/model/bar_ref.dart | 12 +- .../lib/src/model/bar_ref_or_value.dart | 73 +- .../lib/src/model/capitalization.dart | 37 +- .../dio/built_value/lib/src/model/cat.dart | 19 +- .../built_value/lib/src/model/category.dart | 14 +- .../lib/src/model/class_model.dart | 8 +- ...composed_disc_missing_from_properties.dart | 76 +- .../composed_disc_optional_type_correct.dart | 76 +- ...posed_disc_optional_type_inconsistent.dart | 89 +- ...composed_disc_optional_type_incorrect.dart | 76 +- .../composed_disc_required_inconsistent.dart | 89 +- .../composed_disc_type_inconsistent.dart | 89 +- .../model/composed_disc_type_incorrect.dart | 75 +- .../lib/src/model/deprecated_object.dart | 20 +- .../model/disc_missing_from_properties.dart | 27 +- .../src/model/disc_optional_type_correct.dart | 26 +- .../model/disc_optional_type_incorrect.dart | 27 +- .../lib/src/model/disc_type_incorrect.dart | 20 +- .../dio/built_value/lib/src/model/dog.dart | 19 +- .../dio/built_value/lib/src/model/entity.dart | 118 +- .../built_value/lib/src/model/entity_ref.dart | 66 +- .../lib/src/model/enum_arrays.dart | 56 +- .../built_value/lib/src/model/enum_test.dart | 114 +- .../built_value/lib/src/model/extensible.dart | 19 +- .../lib/src/model/file_schema_test_class.dart | 28 +- .../dio/built_value/lib/src/model/foo.dart | 18 +- .../model/foo_basic_get_default_response.dart | 27 +- .../built_value/lib/src/model/foo_ref.dart | 15 +- .../lib/src/model/foo_ref_or_value.dart | 73 +- .../lib/src/model/format_test.dart | 49 +- .../dio/built_value/lib/src/model/fruit.dart | 25 +- .../lib/src/model/fruit_all_of_disc.dart | 74 +- .../lib/src/model/fruit_any_of_disc.dart | 26 +- .../lib/src/model/fruit_grandparent_disc.dart | 82 +- .../lib/src/model/fruit_inline_disc.dart | 80 +- .../src/model/fruit_inline_disc_one_of.dart | 28 +- .../src/model/fruit_inline_disc_one_of1.dart | 28 +- .../src/model/fruit_inline_inline_disc.dart | 83 +- .../fruit_inline_inline_disc_one_of.dart | 40 +- .../fruit_inline_inline_disc_one_of1.dart | 40 +- ...ruit_inline_inline_disc_one_of_one_of.dart | 28 +- .../lib/src/model/fruit_one_of_disc.dart | 74 +- .../lib/src/model/fruit_req_disc.dart | 71 +- .../built_value/lib/src/model/fruit_type.dart | 19 +- .../lib/src/model/fruit_variant1.dart | 31 +- .../lib/src/model/giga_one_of.dart | 22 +- .../lib/src/model/grape_variant1.dart | 17 +- .../lib/src/model/has_only_read_only.dart | 23 +- .../lib/src/model/health_check_result.dart | 20 +- .../built_value/lib/src/model/map_test.dart | 68 +- ...rties_and_additional_properties_class.dart | 46 +- .../lib/src/model/model200_response.dart | 23 +- .../lib/src/model/model_client.dart | 8 +- .../lib/src/model/model_enum_class.dart | 10 +- .../built_value/lib/src/model/model_file.dart | 6 +- .../built_value/lib/src/model/model_list.dart | 8 +- .../lib/src/model/model_return.dart | 8 +- .../dio/built_value/lib/src/model/name.dart | 17 +- .../lib/src/model/nullable_class.dart | 86 +- .../lib/src/model/number_only.dart | 8 +- .../model/object_with_deprecated_fields.dart | 36 +- .../lib/src/model/one_of_primitive_child.dart | 25 +- .../dio/built_value/lib/src/model/order.dart | 37 +- .../lib/src/model/outer_composite.dart | 26 +- .../built_value/lib/src/model/outer_enum.dart | 4 +- .../src/model/outer_enum_default_value.dart | 10 +- .../lib/src/model/outer_enum_integer.dart | 7 +- .../outer_enum_integer_default_value.dart | 10 +- .../outer_object_with_enum_property.dart | 27 +- .../dio/built_value/lib/src/model/parent.dart | 11 +- .../dio/built_value/lib/src/model/pasta.dart | 15 +- .../dio/built_value/lib/src/model/pet.dart | 31 +- .../dio/built_value/lib/src/model/pizza.dart | 46 +- .../lib/src/model/pizza_speziale.dart | 25 +- .../lib/src/model/read_only_first.dart | 20 +- .../lib/src/model/single_ref_type.dart | 4 +- .../lib/src/model/special_model_name.dart | 30 +- .../dio/built_value/lib/src/model/tag.dart | 11 +- .../dio/built_value/lib/src/model/user.dart | 27 +- .../built_value/lib/src/repository_base.dart | 90 +- .../built_value/lib/src/repository_impl.dart | 53 +- .../dio/built_value/lib/src/serializers.dart | 24 +- 467 files changed, 23559 insertions(+), 3084 deletions(-) create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore new file mode 100644 index 000000000000..4298cdcbd1a2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore @@ -0,0 +1,41 @@ +# See https://dart.dev/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock + +# Don’t commit files and directories created by other development environments. +# For example, if your development environment creates any of the following files, +# consider putting them in a global ignore file: + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Mac +.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES new file mode 100644 index 000000000000..6ca871272518 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES @@ -0,0 +1,341 @@ +.gitignore +.openapi-generator-ignore +README.md +analysis_options.yaml +build.yaml +doc/AdditionalPropertiesClass.md +doc/Addressable.md +doc/AllOfWithSingleRef.md +doc/Animal.md +doc/AnotherFakeApi.md +doc/ApiResponse.md +doc/Apple.md +doc/AppleAllOfDisc.md +doc/AppleGrandparentDisc.md +doc/AppleOneOfDisc.md +doc/AppleReqDisc.md +doc/AppleVariant1.md +doc/ArrayOfArrayOfNumberOnly.md +doc/ArrayOfNumberOnly.md +doc/ArrayTest.md +doc/Banana.md +doc/BananaAllOfDisc.md +doc/BananaGrandparentDisc.md +doc/BananaOneOfDisc.md +doc/BananaReqDisc.md +doc/Bar.md +doc/BarApi.md +doc/BarCreate.md +doc/BarRef.md +doc/BarRefOrValue.md +doc/Capitalization.md +doc/Cat.md +doc/Category.md +doc/ClassModel.md +doc/ComposedDiscMissingFromProperties.md +doc/ComposedDiscOptionalTypeCorrect.md +doc/ComposedDiscOptionalTypeInconsistent.md +doc/ComposedDiscOptionalTypeIncorrect.md +doc/ComposedDiscRequiredInconsistent.md +doc/ComposedDiscTypeInconsistent.md +doc/ComposedDiscTypeIncorrect.md +doc/DefaultApi.md +doc/DeprecatedObject.md +doc/DiscMissingFromProperties.md +doc/DiscOptionalTypeCorrect.md +doc/DiscOptionalTypeIncorrect.md +doc/DiscTypeIncorrect.md +doc/Dog.md +doc/Entity.md +doc/EntityRef.md +doc/EnumArrays.md +doc/EnumTest.md +doc/Extensible.md +doc/FakeApi.md +doc/FakeClassnameTags123Api.md +doc/FileSchemaTestClass.md +doc/Foo.md +doc/FooApi.md +doc/FooBasicGetDefaultResponse.md +doc/FooRef.md +doc/FooRefOrValue.md +doc/FormatTest.md +doc/Fruit.md +doc/FruitAllOfDisc.md +doc/FruitAnyOfDisc.md +doc/FruitGrandparentDisc.md +doc/FruitInlineDisc.md +doc/FruitInlineDiscOneOf.md +doc/FruitInlineDiscOneOf1.md +doc/FruitInlineInlineDisc.md +doc/FruitInlineInlineDiscOneOf.md +doc/FruitInlineInlineDiscOneOf1.md +doc/FruitInlineInlineDiscOneOfOneOf.md +doc/FruitOneOfDisc.md +doc/FruitReqDisc.md +doc/FruitType.md +doc/FruitVariant1.md +doc/GigaOneOf.md +doc/GrapeVariant1.md +doc/HasOnlyReadOnly.md +doc/HealthCheckResult.md +doc/MapTest.md +doc/MixedPropertiesAndAdditionalPropertiesClass.md +doc/Model200Response.md +doc/ModelClient.md +doc/ModelEnumClass.md +doc/ModelFile.md +doc/ModelList.md +doc/ModelReturn.md +doc/Name.md +doc/NullableClass.md +doc/NumberOnly.md +doc/ObjectWithDeprecatedFields.md +doc/OneOfPrimitiveChild.md +doc/Order.md +doc/OuterComposite.md +doc/OuterEnum.md +doc/OuterEnumDefaultValue.md +doc/OuterEnumInteger.md +doc/OuterEnumIntegerDefaultValue.md +doc/OuterObjectWithEnumProperty.md +doc/Parent.md +doc/Pasta.md +doc/Pet.md +doc/PetApi.md +doc/Pizza.md +doc/PizzaSpeziale.md +doc/ReadOnlyFirst.md +doc/SingleRefType.md +doc/SpecialModelName.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +lib/openapi.dart +lib/src/api.dart +lib/src/api/another_fake_api.dart +lib/src/api/bar_api.dart +lib/src/api/default_api.dart +lib/src/api/fake_api.dart +lib/src/api/fake_classname_tags123_api.dart +lib/src/api/foo_api.dart +lib/src/api/pet_api.dart +lib/src/api/store_api.dart +lib/src/api/user_api.dart +lib/src/auth/api_key_auth.dart +lib/src/auth/auth.dart +lib/src/auth/basic_auth.dart +lib/src/auth/bearer_auth.dart +lib/src/auth/oauth.dart +lib/src/deserialize.dart +lib/src/model/additional_properties_class.dart +lib/src/model/addressable.dart +lib/src/model/all_of_with_single_ref.dart +lib/src/model/animal.dart +lib/src/model/api_response.dart +lib/src/model/apple.dart +lib/src/model/apple_all_of_disc.dart +lib/src/model/apple_grandparent_disc.dart +lib/src/model/apple_one_of_disc.dart +lib/src/model/apple_req_disc.dart +lib/src/model/apple_variant1.dart +lib/src/model/array_of_array_of_number_only.dart +lib/src/model/array_of_number_only.dart +lib/src/model/array_test.dart +lib/src/model/banana.dart +lib/src/model/banana_all_of_disc.dart +lib/src/model/banana_grandparent_disc.dart +lib/src/model/banana_one_of_disc.dart +lib/src/model/banana_req_disc.dart +lib/src/model/bar.dart +lib/src/model/bar_create.dart +lib/src/model/bar_ref.dart +lib/src/model/bar_ref_or_value.dart +lib/src/model/capitalization.dart +lib/src/model/cat.dart +lib/src/model/category.dart +lib/src/model/class_model.dart +lib/src/model/composed_disc_missing_from_properties.dart +lib/src/model/composed_disc_optional_type_correct.dart +lib/src/model/composed_disc_optional_type_inconsistent.dart +lib/src/model/composed_disc_optional_type_incorrect.dart +lib/src/model/composed_disc_required_inconsistent.dart +lib/src/model/composed_disc_type_inconsistent.dart +lib/src/model/composed_disc_type_incorrect.dart +lib/src/model/deprecated_object.dart +lib/src/model/disc_missing_from_properties.dart +lib/src/model/disc_optional_type_correct.dart +lib/src/model/disc_optional_type_incorrect.dart +lib/src/model/disc_type_incorrect.dart +lib/src/model/dog.dart +lib/src/model/entity.dart +lib/src/model/entity_ref.dart +lib/src/model/enum_arrays.dart +lib/src/model/enum_test.dart +lib/src/model/extensible.dart +lib/src/model/file_schema_test_class.dart +lib/src/model/foo.dart +lib/src/model/foo_basic_get_default_response.dart +lib/src/model/foo_ref.dart +lib/src/model/foo_ref_or_value.dart +lib/src/model/format_test.dart +lib/src/model/fruit.dart +lib/src/model/fruit_all_of_disc.dart +lib/src/model/fruit_any_of_disc.dart +lib/src/model/fruit_grandparent_disc.dart +lib/src/model/fruit_inline_disc.dart +lib/src/model/fruit_inline_disc_one_of.dart +lib/src/model/fruit_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc.dart +lib/src/model/fruit_inline_inline_disc_one_of.dart +lib/src/model/fruit_inline_inline_disc_one_of1.dart +lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart +lib/src/model/fruit_one_of_disc.dart +lib/src/model/fruit_req_disc.dart +lib/src/model/fruit_type.dart +lib/src/model/fruit_variant1.dart +lib/src/model/giga_one_of.dart +lib/src/model/grape_variant1.dart +lib/src/model/has_only_read_only.dart +lib/src/model/health_check_result.dart +lib/src/model/map_test.dart +lib/src/model/mixed_properties_and_additional_properties_class.dart +lib/src/model/model200_response.dart +lib/src/model/model_client.dart +lib/src/model/model_enum_class.dart +lib/src/model/model_file.dart +lib/src/model/model_list.dart +lib/src/model/model_return.dart +lib/src/model/name.dart +lib/src/model/nullable_class.dart +lib/src/model/number_only.dart +lib/src/model/object_with_deprecated_fields.dart +lib/src/model/one_of_primitive_child.dart +lib/src/model/order.dart +lib/src/model/outer_composite.dart +lib/src/model/outer_enum.dart +lib/src/model/outer_enum_default_value.dart +lib/src/model/outer_enum_integer.dart +lib/src/model/outer_enum_integer_default_value.dart +lib/src/model/outer_object_with_enum_property.dart +lib/src/model/parent.dart +lib/src/model/pasta.dart +lib/src/model/pet.dart +lib/src/model/pizza.dart +lib/src/model/pizza_speziale.dart +lib/src/model/read_only_first.dart +lib/src/model/single_ref_type.dart +lib/src/model/special_model_name.dart +lib/src/model/tag.dart +lib/src/model/user.dart +pubspec.yaml +test/additional_properties_class_test.dart +test/addressable_test.dart +test/all_of_with_single_ref_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/apple_all_of_disc_test.dart +test/apple_grandparent_disc_test.dart +test/apple_one_of_disc_test.dart +test/apple_req_disc_test.dart +test/apple_test.dart +test/apple_variant1_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/banana_all_of_disc_test.dart +test/banana_grandparent_disc_test.dart +test/banana_one_of_disc_test.dart +test/banana_req_disc_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/capitalization_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/composed_disc_missing_from_properties_test.dart +test/composed_disc_optional_type_correct_test.dart +test/composed_disc_optional_type_inconsistent_test.dart +test/composed_disc_optional_type_incorrect_test.dart +test/composed_disc_required_inconsistent_test.dart +test/composed_disc_type_inconsistent_test.dart +test/composed_disc_type_incorrect_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/disc_missing_from_properties_test.dart +test/disc_optional_type_correct_test.dart +test/disc_optional_type_incorrect_test.dart +test/disc_type_incorrect_test.dart +test/dog_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/extensible_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_api_test.dart +test/foo_basic_get_default_response_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/format_test_test.dart +test/fruit_all_of_disc_test.dart +test/fruit_any_of_disc_test.dart +test/fruit_grandparent_disc_test.dart +test/fruit_inline_disc_one_of1_test.dart +test/fruit_inline_disc_one_of_test.dart +test/fruit_inline_disc_test.dart +test/fruit_inline_inline_disc_one_of1_test.dart +test/fruit_inline_inline_disc_one_of_one_of_test.dart +test/fruit_inline_inline_disc_one_of_test.dart +test/fruit_inline_inline_disc_test.dart +test/fruit_one_of_disc_test.dart +test/fruit_req_disc_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/fruit_variant1_test.dart +test/giga_one_of_test.dart +test/grape_variant1_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/one_of_primitive_child_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/parent_test.dart +test/pasta_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION new file mode 100644 index 000000000000..757e67400401 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md new file mode 100644 index 000000000000..31acd6e9f132 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md @@ -0,0 +1,264 @@ +# openapi (EXPERIMENTAL) +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.DartDioClientCodegen + +## Requirements + +* Dart 2.15.0+ or Flutter 2.8.0+ +* Dio 5.0.0+ (https://pub.dev/packages/dio) +* JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable) + +## Installation & Usage + +### pub.dev +To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml +```yaml +dependencies: + openapi: 1.0.0 +``` + +### Github +If this Dart package is published to Github, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + git: + url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git + #ref: main +``` + +### Local development +To use the package from your local drive, please include the following in pubspec.yaml +```yaml +dependencies: + openapi: + path: /path/to/openapi +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/openapi.dart'; + + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = await api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar +[*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic | +[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive | +[*DefaultApi*](doc/DefaultApi.md) | [**oneofGet**](doc/DefaultApi.md#oneofget) | **GET** /oneof | +[*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 | +[*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 | +[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | +[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo +[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos +[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user +[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) + - [Addressable](doc/Addressable.md) + - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) + - [Animal](doc/Animal.md) + - [ApiResponse](doc/ApiResponse.md) + - [Apple](doc/Apple.md) + - [AppleAllOfDisc](doc/AppleAllOfDisc.md) + - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) + - [AppleOneOfDisc](doc/AppleOneOfDisc.md) + - [AppleReqDisc](doc/AppleReqDisc.md) + - [AppleVariant1](doc/AppleVariant1.md) + - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) + - [ArrayTest](doc/ArrayTest.md) + - [Banana](doc/Banana.md) + - [BananaAllOfDisc](doc/BananaAllOfDisc.md) + - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) + - [BananaOneOfDisc](doc/BananaOneOfDisc.md) + - [BananaReqDisc](doc/BananaReqDisc.md) + - [Bar](doc/Bar.md) + - [BarCreate](doc/BarCreate.md) + - [BarRef](doc/BarRef.md) + - [BarRefOrValue](doc/BarRefOrValue.md) + - [Capitalization](doc/Capitalization.md) + - [Cat](doc/Cat.md) + - [Category](doc/Category.md) + - [ClassModel](doc/ClassModel.md) + - [ComposedDiscMissingFromProperties](doc/ComposedDiscMissingFromProperties.md) + - [ComposedDiscOptionalTypeCorrect](doc/ComposedDiscOptionalTypeCorrect.md) + - [ComposedDiscOptionalTypeInconsistent](doc/ComposedDiscOptionalTypeInconsistent.md) + - [ComposedDiscOptionalTypeIncorrect](doc/ComposedDiscOptionalTypeIncorrect.md) + - [ComposedDiscRequiredInconsistent](doc/ComposedDiscRequiredInconsistent.md) + - [ComposedDiscTypeInconsistent](doc/ComposedDiscTypeInconsistent.md) + - [ComposedDiscTypeIncorrect](doc/ComposedDiscTypeIncorrect.md) + - [DeprecatedObject](doc/DeprecatedObject.md) + - [DiscMissingFromProperties](doc/DiscMissingFromProperties.md) + - [DiscOptionalTypeCorrect](doc/DiscOptionalTypeCorrect.md) + - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) + - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) + - [Dog](doc/Dog.md) + - [Entity](doc/Entity.md) + - [EntityRef](doc/EntityRef.md) + - [EnumArrays](doc/EnumArrays.md) + - [EnumTest](doc/EnumTest.md) + - [Extensible](doc/Extensible.md) + - [FileSchemaTestClass](doc/FileSchemaTestClass.md) + - [Foo](doc/Foo.md) + - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md) + - [FooRef](doc/FooRef.md) + - [FooRefOrValue](doc/FooRefOrValue.md) + - [FormatTest](doc/FormatTest.md) + - [Fruit](doc/Fruit.md) + - [FruitAllOfDisc](doc/FruitAllOfDisc.md) + - [FruitAnyOfDisc](doc/FruitAnyOfDisc.md) + - [FruitGrandparentDisc](doc/FruitGrandparentDisc.md) + - [FruitInlineDisc](doc/FruitInlineDisc.md) + - [FruitInlineDiscOneOf](doc/FruitInlineDiscOneOf.md) + - [FruitInlineDiscOneOf1](doc/FruitInlineDiscOneOf1.md) + - [FruitInlineInlineDisc](doc/FruitInlineInlineDisc.md) + - [FruitInlineInlineDiscOneOf](doc/FruitInlineInlineDiscOneOf.md) + - [FruitInlineInlineDiscOneOf1](doc/FruitInlineInlineDiscOneOf1.md) + - [FruitInlineInlineDiscOneOfOneOf](doc/FruitInlineInlineDiscOneOfOneOf.md) + - [FruitOneOfDisc](doc/FruitOneOfDisc.md) + - [FruitReqDisc](doc/FruitReqDisc.md) + - [FruitType](doc/FruitType.md) + - [FruitVariant1](doc/FruitVariant1.md) + - [GigaOneOf](doc/GigaOneOf.md) + - [GrapeVariant1](doc/GrapeVariant1.md) + - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) + - [HealthCheckResult](doc/HealthCheckResult.md) + - [MapTest](doc/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](doc/Model200Response.md) + - [ModelClient](doc/ModelClient.md) + - [ModelEnumClass](doc/ModelEnumClass.md) + - [ModelFile](doc/ModelFile.md) + - [ModelList](doc/ModelList.md) + - [ModelReturn](doc/ModelReturn.md) + - [Name](doc/Name.md) + - [NullableClass](doc/NullableClass.md) + - [NumberOnly](doc/NumberOnly.md) + - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) + - [OneOfPrimitiveChild](doc/OneOfPrimitiveChild.md) + - [Order](doc/Order.md) + - [OuterComposite](doc/OuterComposite.md) + - [OuterEnum](doc/OuterEnum.md) + - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) + - [OuterEnumInteger](doc/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) + - [Parent](doc/Parent.md) + - [Pasta](doc/Pasta.md) + - [Pet](doc/Pet.md) + - [Pizza](doc/Pizza.md) + - [PizzaSpeziale](doc/PizzaSpeziale.md) + - [ReadOnlyFirst](doc/ReadOnlyFirst.md) + - [SingleRefType](doc/SingleRefType.md) + - [SpecialModelName](doc/SpecialModelName.md) + - [Tag](doc/Tag.md) + - [User](doc/User.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### bearer_test + +- **Type**: HTTP Bearer Token authentication (JWT) + +### http_signature_test + +- **Type**: HTTP signature authentication + + +## Author + + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml new file mode 100644 index 000000000000..ac01482530cc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml @@ -0,0 +1,12 @@ +analyzer: + language: + strict-inference: true + strict-raw-types: true + strong-mode: + implicit-dynamic: false + implicit-casts: false + exclude: + - test/*.dart + - lib/src/model/*.g.dart + errors: + deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml new file mode 100644 index 000000000000..89a4dd6e1c2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml @@ -0,0 +1,18 @@ +targets: + $default: + builders: + json_serializable: + options: + # Options configure how source code is generated for every + # `@JsonSerializable`-annotated class in the package. + # + # The default value for each is listed. + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: true + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..863b8503db83 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md @@ -0,0 +1,16 @@ +# openapi.model.AdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md new file mode 100644 index 000000000000..0fcd81b80382 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md @@ -0,0 +1,16 @@ +# openapi.model.Addressable + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4c6f3ab2fe11 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md @@ -0,0 +1,16 @@ +# openapi.model.AllOfWithSingleRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md new file mode 100644 index 000000000000..415b56e9bc2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md @@ -0,0 +1,16 @@ +# openapi.model.Animal + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md new file mode 100644 index 000000000000..36a94e6bb703 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# openapi.api.AnotherFakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call123testSpecialTags** +> ModelClient call123testSpecialTags(modelClient) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getAnotherFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.call123testSpecialTags(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md new file mode 100644 index 000000000000..7ad5da0f89e4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md @@ -0,0 +1,17 @@ +# openapi.model.ApiResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md new file mode 100644 index 000000000000..c7f711b87cef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md @@ -0,0 +1,15 @@ +# openapi.model.Apple + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md new file mode 100644 index 000000000000..d98670235ee7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleAllOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md new file mode 100644 index 000000000000..312f1f7018d7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md new file mode 100644 index 000000000000..ff87dcf1d64f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleOneOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md new file mode 100644 index 000000000000..82a1f7c23bb0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.AppleReqDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md new file mode 100644 index 000000000000..d2ec2e148c15 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md @@ -0,0 +1,15 @@ +# openapi.model.AppleVariant1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..e5b9d669a436 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fe8e071eb45c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.ArrayOfNumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<num>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md new file mode 100644 index 000000000000..8ae11de10022 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md @@ -0,0 +1,17 @@ +# openapi.model.ArrayTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md new file mode 100644 index 000000000000..bef8a58a4276 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md @@ -0,0 +1,15 @@ +# openapi.model.Banana + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md new file mode 100644 index 000000000000..900115023298 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaAllOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md new file mode 100644 index 000000000000..5dad7cfe1342 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md new file mode 100644 index 000000000000..8a66091712a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaOneOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md new file mode 100644 index 000000000000..8ae3cdb5bdd0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md @@ -0,0 +1,16 @@ +# openapi.model.BananaReqDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md new file mode 100644 index 000000000000..4cccc863a489 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md @@ -0,0 +1,22 @@ +# openapi.model.Bar + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md new file mode 100644 index 000000000000..270f62e266b1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md @@ -0,0 +1,55 @@ +# openapi.api.BarApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar + + +# **createBar** +> Bar createBar(barCreate) + +Create a Bar + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getBarApi(); +final BarCreate barCreate = ; // BarCreate | + +try { + final response = api.createBar(barCreate); + print(response); +} catch on DioException (e) { + print('Exception when calling BarApi->createBar: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **barCreate** | [**BarCreate**](BarCreate.md)| | + +### Return type + +[**Bar**](Bar.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md new file mode 100644 index 000000000000..c0b4ba6edc9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md @@ -0,0 +1,22 @@ +# openapi.model.BarCreate + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md new file mode 100644 index 000000000000..949695f4d36f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md @@ -0,0 +1,19 @@ +# openapi.model.BarRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md new file mode 100644 index 000000000000..9dafa2d6b220 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.BarRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md new file mode 100644 index 000000000000..4a07b4eb820d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md @@ -0,0 +1,20 @@ +# openapi.model.Capitalization + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md new file mode 100644 index 000000000000..6552eea4b435 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md @@ -0,0 +1,17 @@ +# openapi.model.Cat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md new file mode 100644 index 000000000000..ae6bc52e89d8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md @@ -0,0 +1,16 @@ +# openapi.model.Category + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [default to 'default-name'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md new file mode 100644 index 000000000000..13ae5d3a4708 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md @@ -0,0 +1,15 @@ +# openapi.model.ClassModel + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md new file mode 100644 index 000000000000..2afd29ec62a8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..ff9eb48e6345 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md new file mode 100644 index 000000000000..488fd83228a0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..63d535bf9af2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md new file mode 100644 index 000000000000..51d9e9cb31ee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscRequiredInconsistent + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md new file mode 100644 index 000000000000..09a938fc20ee --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscTypeInconsistent + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md new file mode 100644 index 000000000000..a3150835897a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.ComposedDiscTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md new file mode 100644 index 000000000000..11f2e79e26f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md @@ -0,0 +1,244 @@ +# openapi.api.DefaultApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooBasicGet**](DefaultApi.md#foobasicget) | **GET** /foo-basic | +[**list**](DefaultApi.md#list) | **GET** /oneof-primitive | +[**oneofGet**](DefaultApi.md#oneofget) | **GET** /oneof | +[**test**](DefaultApi.md#test) | **PUT** /variant1 | +[**variant1Get**](DefaultApi.md#variant1get) | **GET** /variant1 | +[**variant2Get**](DefaultApi.md#variant2get) | **GET** /variant2 | + + +# **fooBasicGet** +> FooBasicGetDefaultResponse fooBasicGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.fooBasicGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->fooBasicGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FooBasicGetDefaultResponse**](FooBasicGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list** +> GigaOneOf list() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.list(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->list: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GigaOneOf**](GigaOneOf.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **oneofGet** +> Fruit oneofGet() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.oneofGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->oneofGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Fruit**](Fruit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test** +> test(body) + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); +final Object body = ; // Object | + +try { + api.test(body); +} catch on DioException (e) { + print('Exception when calling DefaultApi->test: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant1Get** +> FruitVariant1 variant1Get() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant1Get(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->variant1Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitVariant1**](FruitVariant1.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **variant2Get** +> FruitAllOfDisc variant2Get() + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getDefaultApi(); + +try { + final response = api.variant2Get(); + print(response); +} catch on DioException (e) { + print('Exception when calling DefaultApi->variant2Get: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FruitAllOfDisc**](FruitAllOfDisc.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md new file mode 100644 index 000000000000..bf2ef67a26fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md @@ -0,0 +1,15 @@ +# openapi.model.DeprecatedObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md new file mode 100644 index 000000000000..dc4b2ba0df92 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md @@ -0,0 +1,15 @@ +# openapi.model.DiscMissingFromProperties + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md new file mode 100644 index 000000000000..c52fb7051b0e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeCorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md new file mode 100644 index 000000000000..73d0af550f33 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscOptionalTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md new file mode 100644 index 000000000000..17d35da09631 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md @@ -0,0 +1,15 @@ +# openapi.model.DiscTypeIncorrect + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md new file mode 100644 index 000000000000..d36439b767bb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md @@ -0,0 +1,17 @@ +# openapi.model.Dog + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md new file mode 100644 index 000000000000..5ba2144b44fe --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md @@ -0,0 +1,19 @@ +# openapi.model.Entity + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md new file mode 100644 index 000000000000..80eae55f4145 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md @@ -0,0 +1,21 @@ +# openapi.model.EntityRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md new file mode 100644 index 000000000000..1d4fd1363b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md @@ -0,0 +1,16 @@ +# openapi.model.EnumArrays + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md new file mode 100644 index 000000000000..7c24fe2347b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md @@ -0,0 +1,22 @@ +# openapi.model.EnumTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **int** | | [optional] +**enumNumber** | **double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md new file mode 100644 index 000000000000..7a781e578ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md @@ -0,0 +1,17 @@ +# openapi.model.Extensible + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md new file mode 100644 index 000000000000..adfc932207ca --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md @@ -0,0 +1,816 @@ +# openapi.api.FakeApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | +[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | +[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); + +try { + final response = api.fakeHealthGet(); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHealthGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store +final String query1 = query1_example; // String | query parameter +final String header1 = header1_example; // String | header parameter + +try { + api.fakeHttpSignatureTest(pet, query1, header1); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterBooleanSerialize** +> bool fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final bool body = true; // bool | Input boolean as post body + +try { + final response = api.fakeOuterBooleanSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body + +try { + final response = api.fakeOuterCompositeSerialize(outerComposite); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterNumberSerialize** +> num fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final num body = 8.14; // num | Input number as post body + +try { + final response = api.fakeOuterNumberSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **num**| Input number as post body | [optional] + +### Return type + +**num** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String body = body_example; // String | Input string as post body + +try { + final response = api.fakeOuterStringSerialize(body); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fakePropertyEnumIntegerSerialize** +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body + +try { + final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithBinary** +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload + +try { + api.testBodyWithBinary(body); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **MultipartFile**| image to upload | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: image/png + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | + +try { + api.testBodyWithFileSchema(fileSchemaTestClass); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String query = query_example; // String | +final User user = ; // User | + +try { + api.testBodyWithQueryParams(query, user); +} catch on DioException (e) { + print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testClientModel** +> ModelClient testClientModel(modelClient) + +To test \"client\" model + +To test \"client\" model + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClientModel(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeApi->testClientModel: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEndpointParameters** +> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure HTTP basic authorization: http_basic_test +//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' +//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; + +final api = Openapi().getFakeApi(); +final num number = 8.14; // num | None +final double double_ = 1.2; // double | None +final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None +final String byte = BYTE_ARRAY_DATA_HERE; // String | None +final int integer = 56; // int | None +final int int32 = 56; // int | None +final int int64 = 789; // int | None +final double float = 3.4; // double | None +final String string = string_example; // String | None +final MultipartFile binary = BINARY_DATA_HERE; // MultipartFile | None +final DateTime date = 2013-10-20; // DateTime | None +final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None +final String password = password_example; // String | None +final String callback = callback_example; // String | None + +try { + api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEndpointParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **num**| None | + **double_** | **double**| None | + **patternWithoutDelimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **double**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **MultipartFile**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List enumHeaderStringArray = ; // List | Header parameter enum test (string array) +final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) +final List enumQueryStringArray = ; // List | Query parameter enum test (string array) +final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) +final int enumQueryInteger = 56; // int | Query parameter enum test (double) +final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) +final List enumQueryModelArray = ; // List | +final List enumFormStringArray = ; // List | Form parameter enum test (string array) +final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) + +try { + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); +} catch on DioException (e) { + print('Exception when calling FakeApi->testEnumParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] + **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final int requiredStringGroup = 56; // int | Required String in group parameters +final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters +final int requiredInt64Group = 789; // int | Required Integer in group parameters +final int stringGroup = 56; // int | String in group parameters +final bool booleanGroup = true; // bool | Boolean in group parameters +final int int64Group = 789; // int | Integer in group parameters + +try { + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); +} catch on DioException (e) { + print('Exception when calling FakeApi->testGroupParameters: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **int**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final Map requestBody = ; // Map | request body + +try { + api.testInlineAdditionalProperties(requestBody); +} catch on DioException (e) { + print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final String param = param_example; // String | field1 +final String param2 = param2_example; // String | field2 + +try { + api.testJsonFormData(param, param2); +} catch on DioException (e) { + print('Exception when calling FakeApi->testJsonFormData: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFakeApi(); +final List pipe = ; // List | +final List ioutil = ; // List | +final List http = ; // List | +final List url = ; // List | +final List context = ; // List | +final String allowEmpty = allowEmpty_example; // String | +final Map language = ; // Map | + +try { + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); +} catch on DioException (e) { + print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + **allowEmpty** | **String**| | + **language** | [**Map<String, String>**](String.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..645aebf399f0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# openapi.api.FakeClassnameTags123Api + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> ModelClient testClassname(modelClient) + +To test class name in snake case + +To test class name in snake case + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key_query +//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getFakeClassnameTags123Api(); +final ModelClient modelClient = ; // ModelClient | client model + +try { + final response = api.testClassname(modelClient); + print(response); +} catch on DioException (e) { + print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelClient** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md new file mode 100644 index 000000000000..d14ac319d294 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md @@ -0,0 +1,16 @@ +# openapi.model.FileSchemaTestClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**ModelFile**](ModelFile.md) | | [optional] +**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md new file mode 100644 index 000000000000..2627691fefe5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md @@ -0,0 +1,21 @@ +# openapi.model.Foo + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md new file mode 100644 index 000000000000..7bf731fc4bc7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md @@ -0,0 +1,93 @@ +# openapi.api.FooApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo +[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos + + +# **createFoo** +> FooRefOrValue createFoo(foo) + +Create a Foo + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); +final Foo foo = ; // Foo | The Foo to be created + +try { + final response = api.createFoo(foo); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->createFoo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] + +### Return type + +[**FooRefOrValue**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json;charset=utf-8 + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getAllFoos** +> List getAllFoos() + +GET all Foos + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getFooApi(); + +try { + final response = api.getAllFoos(); + print(response); +} catch on DioException (e) { + print('Exception when calling FooApi->getAllFoos: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<FooRefOrValue>**](FooRefOrValue.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md new file mode 100644 index 000000000000..491b64c42f00 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md @@ -0,0 +1,15 @@ +# openapi.model.FooBasicGetDefaultResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md new file mode 100644 index 000000000000..68104b227292 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md @@ -0,0 +1,20 @@ +# openapi.model.FooRef + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**foorefPropA** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md new file mode 100644 index 000000000000..35e9fd114e1d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md @@ -0,0 +1,19 @@ +# openapi.model.FooRefOrValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md new file mode 100644 index 000000000000..83b60545eb61 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md @@ -0,0 +1,30 @@ +# openapi.model.FormatTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **num** | | +**float** | **double** | | [optional] +**double_** | **double** | | [optional] +**decimal** | **double** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] +**date** | [**DateTime**](DateTime.md) | | +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md new file mode 100644 index 000000000000..5d48cc6e6d38 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md @@ -0,0 +1,17 @@ +# openapi.model.Fruit + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] +**count** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md new file mode 100644 index 000000000000..733363dbb42e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAllOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md new file mode 100644 index 000000000000..537c0e0ab862 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitAnyOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md new file mode 100644 index 000000000000..bfd888c625ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitGrandparentDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md new file mode 100644 index 000000000000..40f58d8fa57e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitInlineDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md new file mode 100644 index 000000000000..68bdac19308a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md new file mode 100644 index 000000000000..249b1c05ea20 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md new file mode 100644 index 000000000000..e56f0b56b949 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md new file mode 100644 index 000000000000..0b69ee93ffb0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md new file mode 100644 index 000000000000..3d00114f2a21 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitInlineInlineDiscOneOf1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **int** | | +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md new file mode 100644 index 000000000000..4729a639a999 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md @@ -0,0 +1,15 @@ +# openapi.model.FruitInlineInlineDiscOneOfOneOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md new file mode 100644 index 000000000000..d081ec443559 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md @@ -0,0 +1,15 @@ +# openapi.model.FruitOneOfDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md new file mode 100644 index 000000000000..4fb7b6024403 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md @@ -0,0 +1,17 @@ +# openapi.model.FruitReqDisc + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seeds** | **int** | | +**fruitType** | **String** | | +**length** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md new file mode 100644 index 000000000000..b4a8adc49a0f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md @@ -0,0 +1,15 @@ +# openapi.model.FruitType + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md new file mode 100644 index 000000000000..1a0f58f86cad --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md @@ -0,0 +1,16 @@ +# openapi.model.FruitVariant1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md new file mode 100644 index 000000000000..269723b2a215 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md @@ -0,0 +1,15 @@ +# openapi.model.GigaOneOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md new file mode 100644 index 000000000000..4be2630f6f28 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md @@ -0,0 +1,15 @@ +# openapi.model.GrapeVariant1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md new file mode 100644 index 000000000000..32cae937155d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md @@ -0,0 +1,16 @@ +# openapi.model.HasOnlyReadOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md new file mode 100644 index 000000000000..4d6aeb75d965 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md @@ -0,0 +1,15 @@ +# openapi.model.HealthCheckResult + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md new file mode 100644 index 000000000000..197fe780a25a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md @@ -0,0 +1,18 @@ +# openapi.model.MapTest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | **Map<String, String>** | | [optional] +**directMap** | **Map<String, bool>** | | [optional] +**indirectMap** | **Map<String, bool>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..66d0d39c42be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# openapi.model.MixedPropertiesAndAdditionalPropertiesClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**dateTime** | [**DateTime**](DateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md new file mode 100644 index 000000000000..5aa3fb97c32e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md @@ -0,0 +1,16 @@ +# openapi.model.Model200Response + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**class_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md new file mode 100644 index 000000000000..f7b922f4a398 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md @@ -0,0 +1,15 @@ +# openapi.model.ModelClient + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md new file mode 100644 index 000000000000..ebaafb44c7f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md @@ -0,0 +1,14 @@ +# openapi.model.ModelEnumClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md new file mode 100644 index 000000000000..4be260e93f6e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md @@ -0,0 +1,15 @@ +# openapi.model.ModelFile + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md new file mode 100644 index 000000000000..283aa1f6b711 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md @@ -0,0 +1,15 @@ +# openapi.model.ModelList + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**n123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md new file mode 100644 index 000000000000..bc02df7a3692 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md @@ -0,0 +1,15 @@ +# openapi.model.ModelReturn + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return_** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md new file mode 100644 index 000000000000..25f49ea946b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md @@ -0,0 +1,18 @@ +# openapi.model.Name + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snakeCase** | **int** | | [optional] +**property** | **String** | | [optional] +**n123number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md new file mode 100644 index 000000000000..70ac1091d417 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md @@ -0,0 +1,26 @@ +# openapi.model.NullableClass + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **int** | | [optional] +**numberProp** | **num** | | [optional] +**booleanProp** | **bool** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**DateTime**](DateTime.md) | | [optional] +**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md new file mode 100644 index 000000000000..d8096a3db37a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md @@ -0,0 +1,15 @@ +# openapi.model.NumberOnly + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **num** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..e0fa7b908d10 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md @@ -0,0 +1,18 @@ +# openapi.model.ObjectWithDeprecatedFields + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **num** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | [**List<Bar>**](Bar.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md new file mode 100644 index 000000000000..9f9f05c6cfe2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md @@ -0,0 +1,15 @@ +# openapi.model.OneOfPrimitiveChild + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md new file mode 100644 index 000000000000..bde5ffe51a2c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md @@ -0,0 +1,20 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md new file mode 100644 index 000000000000..04bab7eff5d1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md @@ -0,0 +1,17 @@ +# openapi.model.OuterComposite + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **num** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md new file mode 100644 index 000000000000..af62ad87ab2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnum + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..c1bf8b0dec44 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md new file mode 100644 index 000000000000..8c80a9e5c85f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumInteger + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..eb8b55d70249 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ +# openapi.model.OuterEnumIntegerDefaultValue + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..eab2ae8f66b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md @@ -0,0 +1,15 @@ +# openapi.model.OuterObjectWithEnumProperty + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md new file mode 100644 index 000000000000..a2ee8510cf68 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md @@ -0,0 +1,15 @@ +# openapi.model.Parent + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fruitType** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md new file mode 100644 index 000000000000..034ff420d323 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md @@ -0,0 +1,20 @@ +# openapi.model.Pasta + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md new file mode 100644 index 000000000000..3cd230bfb213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md @@ -0,0 +1,20 @@ +# openapi.model.Pet + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **Set<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md new file mode 100644 index 000000000000..5fc7fbd2657f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md @@ -0,0 +1,439 @@ +# openapi.api.PetApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.addPet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->addPet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | Pet id to delete +final String apiKey = apiKey_example; // String | + +try { + api.deletePet(petId, apiKey); +} catch on DioException (e) { + print('Exception when calling PetApi->deletePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +> List findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final List status = ; // List | Status values that need to be considered for filter + +try { + final response = api.findPetsByStatus(status); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByStatus: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +> Set findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Set tags = ; // Set | Tags to filter by + +try { + final response = api.findPetsByTags(tags); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->findPetsByTags: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Set<String>**](String.md)| Tags to filter by | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to return + +try { + final response = api.getPetById(petId); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->getPetById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +> updatePet(pet) + +Update an existing pet + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final Pet pet = ; // Pet | Pet object that needs to be added to the store + +try { + api.updatePet(pet); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet that needs to be updated +final String name = name_example; // String | Updated name of the pet +final String status = status_example; // String | Updated status of the pet + +try { + api.updatePetWithForm(petId, name, status); +} catch on DioException (e) { + print('Exception when calling PetApi->updatePetWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload + +try { + final response = api.uploadFile(petId, additionalMetadata, file); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: petstore_auth +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api = Openapi().getPetApi(); +final int petId = 789; // int | ID of pet to update +final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload +final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server + +try { + final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + print(response); +} catch on DioException (e) { + print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **int**| ID of pet to update | + **requiredFile** | **MultipartFile**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md new file mode 100644 index 000000000000..e4b040a6a79c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md @@ -0,0 +1,20 @@ +# openapi.model.Pizza + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pizzaSize** | **num** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md new file mode 100644 index 000000000000..e1d8434c077d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md @@ -0,0 +1,20 @@ +# openapi.model.PizzaSpeziale + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**toppings** | **String** | | [optional] +**href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | [optional] +**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] +**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] +**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md new file mode 100644 index 000000000000..8f612e8ba19f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md @@ -0,0 +1,16 @@ +# openapi.model.ReadOnlyFirst + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md new file mode 100644 index 000000000000..0dc93840cd7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md @@ -0,0 +1,14 @@ +# openapi.model.SingleRefType + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md new file mode 100644 index 000000000000..5fcfa98e0b36 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialModelName + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md new file mode 100644 index 000000000000..42028947229f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md @@ -0,0 +1,188 @@ +# openapi.api.StoreApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final String orderId = orderId_example; // String | ID of the order that needs to be deleted + +try { + api.deleteOrder(orderId); +} catch on DioException (e) { + print('Exception when calling StoreApi->deleteOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +> Map getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: api_key +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; + +final api = Openapi().getStoreApi(); + +try { + final response = api.getInventory(); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getInventory: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, int>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final int orderId = 789; // int | ID of pet that needs to be fetched + +try { + final response = api.getOrderById(orderId); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->getOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getStoreApi(); +final Order order = ; // Order | order placed for purchasing the pet + +try { + final response = api.placeOrder(order); + print(response); +} catch on DioException (e) { + print('Exception when calling StoreApi->placeOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md new file mode 100644 index 000000000000..c219f987c19c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md @@ -0,0 +1,16 @@ +# openapi.model.Tag + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md new file mode 100644 index 000000000000..fa87e64d8595 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md @@ -0,0 +1,22 @@ +# openapi.model.User + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md new file mode 100644 index 000000000000..49b79d76b8a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md @@ -0,0 +1,359 @@ +# openapi.api.UserApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final User user = ; // User | Created user object + +try { + api.createUser(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithArrayInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final List user = ; // List | List of user object + +try { + api.createUsersWithListInput(user); +} catch on DioException (e) { + print('Exception when calling UserApi->createUsersWithListInput: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be deleted + +try { + api.deleteUser(username); +} catch on DioException (e) { + print('Exception when calling UserApi->deleteUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + +try { + final response = api.getUserByName(username); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->getUserByName: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | The user name for login +final String password = password_example; // String | The password for login in clear text + +try { + final response = api.loginUser(username, password); + print(response); +} catch on DioException (e) { + print('Exception when calling UserApi->loginUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); + +try { + api.logoutUser(); +} catch on DioException (e) { + print('Exception when calling UserApi->logoutUser: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```dart +import 'package:openapi/api.dart'; + +final api = Openapi().getUserApi(); +final String username = username_example; // String | name that need to be deleted +final User user = ; // User | Updated user object + +try { + api.updateUser(username, user); +} catch on DioException (e) { + print('Exception when calling UserApi->updateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart new file mode 100644 index 000000000000..7eddfc0d38fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart @@ -0,0 +1,120 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +export 'package:openapi/src/api.dart'; +export 'package:openapi/src/auth/api_key_auth.dart'; +export 'package:openapi/src/auth/basic_auth.dart'; +export 'package:openapi/src/auth/oauth.dart'; + + +export 'package:openapi/src/api/another_fake_api.dart'; +export 'package:openapi/src/api/bar_api.dart'; +export 'package:openapi/src/api/default_api.dart'; +export 'package:openapi/src/api/fake_api.dart'; +export 'package:openapi/src/api/fake_classname_tags123_api.dart'; +export 'package:openapi/src/api/foo_api.dart'; +export 'package:openapi/src/api/pet_api.dart'; +export 'package:openapi/src/api/store_api.dart'; +export 'package:openapi/src/api/user_api.dart'; + +export 'package:openapi/src/model/additional_properties_class.dart'; +export 'package:openapi/src/model/addressable.dart'; +export 'package:openapi/src/model/all_of_with_single_ref.dart'; +export 'package:openapi/src/model/animal.dart'; +export 'package:openapi/src/model/api_response.dart'; +export 'package:openapi/src/model/apple.dart'; +export 'package:openapi/src/model/apple_all_of_disc.dart'; +export 'package:openapi/src/model/apple_grandparent_disc.dart'; +export 'package:openapi/src/model/apple_one_of_disc.dart'; +export 'package:openapi/src/model/apple_req_disc.dart'; +export 'package:openapi/src/model/apple_variant1.dart'; +export 'package:openapi/src/model/array_of_array_of_number_only.dart'; +export 'package:openapi/src/model/array_of_number_only.dart'; +export 'package:openapi/src/model/array_test.dart'; +export 'package:openapi/src/model/banana.dart'; +export 'package:openapi/src/model/banana_all_of_disc.dart'; +export 'package:openapi/src/model/banana_grandparent_disc.dart'; +export 'package:openapi/src/model/banana_one_of_disc.dart'; +export 'package:openapi/src/model/banana_req_disc.dart'; +export 'package:openapi/src/model/bar.dart'; +export 'package:openapi/src/model/bar_create.dart'; +export 'package:openapi/src/model/bar_ref.dart'; +export 'package:openapi/src/model/bar_ref_or_value.dart'; +export 'package:openapi/src/model/capitalization.dart'; +export 'package:openapi/src/model/cat.dart'; +export 'package:openapi/src/model/category.dart'; +export 'package:openapi/src/model/class_model.dart'; +export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_correct.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/composed_disc_required_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_inconsistent.dart'; +export 'package:openapi/src/model/composed_disc_type_incorrect.dart'; +export 'package:openapi/src/model/deprecated_object.dart'; +export 'package:openapi/src/model/disc_missing_from_properties.dart'; +export 'package:openapi/src/model/disc_optional_type_correct.dart'; +export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +export 'package:openapi/src/model/disc_type_incorrect.dart'; +export 'package:openapi/src/model/dog.dart'; +export 'package:openapi/src/model/entity.dart'; +export 'package:openapi/src/model/entity_ref.dart'; +export 'package:openapi/src/model/enum_arrays.dart'; +export 'package:openapi/src/model/enum_test.dart'; +export 'package:openapi/src/model/extensible.dart'; +export 'package:openapi/src/model/file_schema_test_class.dart'; +export 'package:openapi/src/model/foo.dart'; +export 'package:openapi/src/model/foo_basic_get_default_response.dart'; +export 'package:openapi/src/model/foo_ref.dart'; +export 'package:openapi/src/model/foo_ref_or_value.dart'; +export 'package:openapi/src/model/format_test.dart'; +export 'package:openapi/src/model/fruit.dart'; +export 'package:openapi/src/model/fruit_all_of_disc.dart'; +export 'package:openapi/src/model/fruit_any_of_disc.dart'; +export 'package:openapi/src/model/fruit_grandparent_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +export 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +export 'package:openapi/src/model/fruit_one_of_disc.dart'; +export 'package:openapi/src/model/fruit_req_disc.dart'; +export 'package:openapi/src/model/fruit_type.dart'; +export 'package:openapi/src/model/fruit_variant1.dart'; +export 'package:openapi/src/model/giga_one_of.dart'; +export 'package:openapi/src/model/grape_variant1.dart'; +export 'package:openapi/src/model/has_only_read_only.dart'; +export 'package:openapi/src/model/health_check_result.dart'; +export 'package:openapi/src/model/map_test.dart'; +export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +export 'package:openapi/src/model/model200_response.dart'; +export 'package:openapi/src/model/model_client.dart'; +export 'package:openapi/src/model/model_enum_class.dart'; +export 'package:openapi/src/model/model_file.dart'; +export 'package:openapi/src/model/model_list.dart'; +export 'package:openapi/src/model/model_return.dart'; +export 'package:openapi/src/model/name.dart'; +export 'package:openapi/src/model/nullable_class.dart'; +export 'package:openapi/src/model/number_only.dart'; +export 'package:openapi/src/model/object_with_deprecated_fields.dart'; +export 'package:openapi/src/model/one_of_primitive_child.dart'; +export 'package:openapi/src/model/order.dart'; +export 'package:openapi/src/model/outer_composite.dart'; +export 'package:openapi/src/model/outer_enum.dart'; +export 'package:openapi/src/model/outer_enum_default_value.dart'; +export 'package:openapi/src/model/outer_enum_integer.dart'; +export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +export 'package:openapi/src/model/outer_object_with_enum_property.dart'; +export 'package:openapi/src/model/parent.dart'; +export 'package:openapi/src/model/pasta.dart'; +export 'package:openapi/src/model/pet.dart'; +export 'package:openapi/src/model/pizza.dart'; +export 'package:openapi/src/model/pizza_speziale.dart'; +export 'package:openapi/src/model/read_only_first.dart'; +export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_model_name.dart'; +export 'package:openapi/src/model/tag.dart'; +export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart new file mode 100644 index 000000000000..fc036ae659de --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart @@ -0,0 +1,124 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/api_key_auth.dart'; +import 'package:openapi/src/auth/basic_auth.dart'; +import 'package:openapi/src/auth/bearer_auth.dart'; +import 'package:openapi/src/auth/oauth.dart'; +import 'package:openapi/src/api/another_fake_api.dart'; +import 'package:openapi/src/api/bar_api.dart'; +import 'package:openapi/src/api/default_api.dart'; +import 'package:openapi/src/api/fake_api.dart'; +import 'package:openapi/src/api/fake_classname_tags123_api.dart'; +import 'package:openapi/src/api/foo_api.dart'; +import 'package:openapi/src/api/pet_api.dart'; +import 'package:openapi/src/api/store_api.dart'; +import 'package:openapi/src/api/user_api.dart'; + +class Openapi { + static const String basePath = r'http://petstore.swagger.io:80/v2'; + + final Dio dio; + Openapi({ + Dio? dio, + String? basePathOverride, + List? interceptors, + }) : + this.dio = dio ?? + Dio(BaseOptions( + baseUrl: basePathOverride ?? basePath, + connectTimeout: const Duration(milliseconds: 5000), + receiveTimeout: const Duration(milliseconds: 3000), + )) { + if (interceptors == null) { + this.dio.interceptors.addAll([ + OAuthInterceptor(), + BasicAuthInterceptor(), + BearerAuthInterceptor(), + ApiKeyAuthInterceptor(), + ]); + } else { + this.dio.interceptors.addAll(interceptors); + } + } + + void setOAuthToken(String name, String token) { + if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; + } + } + + void setBearerAuth(String name, String token) { + if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; + } + } + + void setBasicAuth(String name, String username, String password) { + if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); + } + } + + void setApiKey(String name, String apiKey) { + if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; + } + } + + /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + AnotherFakeApi getAnotherFakeApi() { + return AnotherFakeApi(dio); + } + + /// Get BarApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BarApi getBarApi() { + return BarApi(dio); + } + + /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + DefaultApi getDefaultApi() { + return DefaultApi(dio); + } + + /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeApi getFakeApi() { + return FakeApi(dio); + } + + /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FakeClassnameTags123Api getFakeClassnameTags123Api() { + return FakeClassnameTags123Api(dio); + } + + /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + FooApi getFooApi() { + return FooApi(dio); + } + + /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PetApi getPetApi() { + return PetApi(dio); + } + + /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + StoreApi getStoreApi() { + return StoreApi(dio); + } + + /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + UserApi getUserApi() { + return UserApi(dio); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart new file mode 100644 index 000000000000..d98f3c23f4f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class AnotherFakeApi { + + final Dio _dio; + + const AnotherFakeApi(this._dio); + + /// To test special tags + /// To test special tags and operation ID starting with number + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> call123testSpecialTags({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/another-fake/dummy'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart new file mode 100644 index 000000000000..9928242bb02a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; + +class BarApi { + + final Dio _dio; + + const BarApi(this._dio); + + /// Create a Bar + /// + /// + /// Parameters: + /// * [barCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Bar] as data + /// Throws [DioException] if API call or serialization fails + Future> createBar({ + required BarCreate barCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/bar'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(barCreate); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Bar? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Bar', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart new file mode 100644 index 000000000000..9f304f45dff1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart @@ -0,0 +1,434 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/foo_basic_get_default_response.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/fruit_all_of_disc.dart'; +import 'package:openapi/src/model/fruit_variant1.dart'; +import 'package:openapi/src/model/giga_one_of.dart'; + +class DefaultApi { + + final Dio _dio; + + const DefaultApi(this._dio); + + /// fooBasicGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> fooBasicGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo-basic'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooBasicGetDefaultResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FooBasicGetDefaultResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// list + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data + /// Throws [DioException] if API call or serialization fails + Future> list({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof-primitive'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + GigaOneOf? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'GigaOneOf', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// oneofGet + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Fruit] as data + /// Throws [DioException] if API call or serialization fails + Future> oneofGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/oneof'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Fruit? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Fruit', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test + /// + /// + /// Parameters: + /// * [body] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> test({ + Object? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// variant1Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data + /// Throws [DioException] if API call or serialization fails + Future> variant1Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant1'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitVariant1? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FruitVariant1', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// variant2Get + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data + /// Throws [DioException] if API call or serialization fails + Future> variant2Get({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/variant2'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FruitAllOfDisc? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FruitAllOfDisc', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart new file mode 100644 index 000000000000..08b8fffb04d3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart @@ -0,0 +1,1380 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_enum_class.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/user.dart'; + +class FakeApi { + + final Dio _dio; + + const FakeApi(this._dio); + + /// Health check endpoint + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeHealthGet({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/health'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + HealthCheckResult? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'HealthCheckResult', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// test http signature authentication + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [query1] - query parameter + /// * [header1] - header parameter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> fakeHttpSignatureTest({ + required Pet pet, + String? query1, + String? header1, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/http-signature-test'; + final _options = Options( + method: r'GET', + headers: { + if (header1 != null) r'header_1': header1, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'signature', + 'name': 'http_signature_test', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (query1 != null) r'query_1': query1, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// fakeOuterBooleanSerialize + /// Test serialization of outer boolean types + /// + /// Parameters: + /// * [body] - Input boolean as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [bool] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterBooleanSerialize({ + bool? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/boolean'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + bool? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'bool', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterCompositeSerialize + /// Test serialization of object with outer number type + /// + /// Parameters: + /// * [outerComposite] - Input composite as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterComposite] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterCompositeSerialize({ + OuterComposite? outerComposite, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/composite'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerComposite); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterComposite? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'OuterComposite', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterNumberSerialize + /// Test serialization of outer number types + /// + /// Parameters: + /// * [body] - Input number as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [num] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterNumberSerialize({ + num? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/number'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + num? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'num', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakeOuterStringSerialize + /// Test serialization of outer string types + /// + /// Parameters: + /// * [body] - Input string as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> fakeOuterStringSerialize({ + String? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/outer/string'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// fakePropertyEnumIntegerSerialize + /// Test serialization of enum (int) properties with examples + /// + /// Parameters: + /// * [outerObjectWithEnumProperty] - Input enum (int) as post body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data + /// Throws [DioException] if API call or serialization fails + Future> fakePropertyEnumIntegerSerialize({ + required OuterObjectWithEnumProperty outerObjectWithEnumProperty, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/property/enum-int'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(outerObjectWithEnumProperty); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + OuterObjectWithEnumProperty? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'OuterObjectWithEnumProperty', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// testBodyWithBinary + /// For this test, the body has to be a binary file. + /// + /// Parameters: + /// * [body] - image to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithBinary({ + MultipartFile? body, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-binary'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'image/png', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(body); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithFileSchema + /// For this test, the body for this request must reference a schema named `File`. + /// + /// Parameters: + /// * [fileSchemaTestClass] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithFileSchema({ + required FileSchemaTestClass fileSchemaTestClass, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-file-schema'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(fileSchemaTestClass); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testBodyWithQueryParams + /// + /// + /// Parameters: + /// * [query] + /// * [user] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testBodyWithQueryParams({ + required String query, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/body-with-query-params'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'query': query, + }; + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test \"client\" model + /// To test \"client\" model + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClientModel({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// + /// Parameters: + /// * [number] - None + /// * [double_] - None + /// * [patternWithoutDelimiter] - None + /// * [byte] - None + /// * [integer] - None + /// * [int32] - None + /// * [int64] - None + /// * [float] - None + /// * [string] - None + /// * [binary] - None + /// * [date] - None + /// * [dateTime] - None + /// * [password] - None + /// * [callback] - None + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEndpointParameters({ + required num number, + required double double_, + required String patternWithoutDelimiter, + required String byte, + int? integer, + int? int32, + int? int64, + double? float, + String? string, + MultipartFile? binary, + DateTime? date, + DateTime? dateTime, + String? password, + String? callback, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'basic', + 'name': 'http_basic_test', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// To test enum parameters + /// To test enum parameters + /// + /// Parameters: + /// * [enumHeaderStringArray] - Header parameter enum test (string array) + /// * [enumHeaderString] - Header parameter enum test (string) + /// * [enumQueryStringArray] - Query parameter enum test (string array) + /// * [enumQueryString] - Query parameter enum test (string) + /// * [enumQueryInteger] - Query parameter enum test (double) + /// * [enumQueryDouble] - Query parameter enum test (double) + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) + /// * [enumFormString] - Form parameter enum test (string) + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testEnumParameters({ + List? enumHeaderStringArray, + String? enumHeaderString = '-efg', + List? enumQueryStringArray, + String? enumQueryString = '-efg', + int? enumQueryInteger, + double? enumQueryDouble, + List? enumQueryModelArray, + List? enumFormStringArray, + String? enumFormString, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'GET', + headers: { + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderString != null) r'enum_header_string': enumHeaderString, + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, + if (enumQueryString != null) r'enum_query_string': enumQueryString, + if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, + if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, + }; + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + queryParameters: _queryParameters, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Fake endpoint to test group parameters (optional) + /// Fake endpoint to test group parameters (optional) + /// + /// Parameters: + /// * [requiredStringGroup] - Required String in group parameters + /// * [requiredBooleanGroup] - Required Boolean in group parameters + /// * [requiredInt64Group] - Required Integer in group parameters + /// * [stringGroup] - String in group parameters + /// * [booleanGroup] - Boolean in group parameters + /// * [int64Group] - Integer in group parameters + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testGroupParameters({ + required int requiredStringGroup, + required bool requiredBooleanGroup, + required int requiredInt64Group, + int? stringGroup, + bool? booleanGroup, + int? int64Group, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake'; + final _options = Options( + method: r'DELETE', + headers: { + r'required_boolean_group': requiredBooleanGroup, + if (booleanGroup != null) r'boolean_group': booleanGroup, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearer_test', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'required_string_group': requiredStringGroup, + r'required_int64_group': requiredInt64Group, + if (stringGroup != null) r'string_group': stringGroup, + if (int64Group != null) r'int64_group': int64Group, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test inline additionalProperties + /// + /// + /// Parameters: + /// * [requestBody] - request body + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testInlineAdditionalProperties({ + required Map requestBody, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/inline-additionalProperties'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(requestBody); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// test json serialization of form data + /// + /// + /// Parameters: + /// * [param] - field1 + /// * [param2] - field2 + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testJsonFormData({ + required String param, + required String param2, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/jsonFormData'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// testQueryParameterCollectionFormat + /// To test the collection format in query parameters + /// + /// Parameters: + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> testQueryParameterCollectionFormat({ + required List pipe, + required List ioutil, + required List http, + required List url, + required List context, + required String allowEmpty, + Map? language, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/test-query-parameters'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'pipe': pipe, + r'ioutil': ioutil, + r'http': http, + r'url': url, + r'context': context, + if (language != null) r'language': language, + r'allowEmpty': allowEmpty, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart new file mode 100644 index 000000000000..56ec33f1cace --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/model_client.dart'; + +class FakeClassnameTags123Api { + + final Dio _dio; + + const FakeClassnameTags123Api(this._dio); + + /// To test class name in snake case + /// To test class name in snake case + /// + /// Parameters: + /// * [modelClient] - client model + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ModelClient] as data + /// Throws [DioException] if API call or serialization fails + Future> testClassname({ + required ModelClient modelClient, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake_classname_test'; + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key_query', + 'keyName': 'api_key_query', + 'where': 'query', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(modelClient); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ModelClient? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart new file mode 100644 index 000000000000..836429ae3f39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart @@ -0,0 +1,179 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; + +class FooApi { + + final Dio _dio; + + const FooApi(this._dio); + + /// Create a Foo + /// + /// + /// Parameters: + /// * [foo] - The Foo to be created + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data + /// Throws [DioException] if API call or serialization fails + Future> createFoo({ + Foo? foo, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json;charset=utf-8', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(foo); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + FooRefOrValue? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'FooRefOrValue', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// GET all Foos + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> getAllFoos({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/foo'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, FooRefOrValue>(rawData, 'List', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart new file mode 100644 index 000000000000..ec20128ee1e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart @@ -0,0 +1,727 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/pet.dart'; + +class PetApi { + + final Dio _dio; + + const PetApi(this._dio); + + /// Add a new pet to the store + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> addPet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Deletes a pet + /// + /// + /// Parameters: + /// * [petId] - Pet id to delete + /// * [apiKey] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deletePet({ + required int petId, + String? apiKey, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + if (apiKey != null) r'api_key': apiKey, + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// + /// Parameters: + /// * [status] - Status values that need to be considered for filter + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> findPetsByStatus({ + @Deprecated('status is deprecated') required List status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByStatus'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'status': status, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'List', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Parameters: + /// * [tags] - Tags to filter by + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Set] as data + /// Throws [DioException] if API call or serialization fails + @Deprecated('This operation has been deprecated') + Future>> findPetsByTags({ + required Set tags, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/findByTags'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'tags': tags, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Set? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Set', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find pet by ID + /// Returns a single pet + /// + /// Parameters: + /// * [petId] - ID of pet to return + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Pet] as data + /// Throws [DioException] if API call or serialization fails + Future> getPetById({ + required int petId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Pet? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Pet', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Update an existing pet + /// + /// + /// Parameters: + /// * [pet] - Pet object that needs to be added to the store + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePet({ + required Pet pet, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet'; + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(pet); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updates a pet in the store with form data + /// + /// + /// Parameters: + /// * [petId] - ID of pet that needs to be updated + /// * [name] - Updated name of the pet + /// * [status] - Updated status of the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updatePetWithForm({ + required int petId, + String? name, + String? status, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'application/x-www-form-urlencoded', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// uploads an image + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [additionalMetadata] - Additional data to pass to server + /// * [file] - file to upload + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFile({ + required int petId, + String? additionalMetadata, + MultipartFile? file, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// uploads an image (required) + /// + /// + /// Parameters: + /// * [petId] - ID of pet to update + /// * [requiredFile] - file to upload + /// * [additionalMetadata] - Additional data to pass to server + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ApiResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> uploadFileWithRequiredFile({ + required int petId, + required MultipartFile requiredFile, + String? additionalMetadata, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'oauth2', + 'name': 'petstore_auth', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ApiResponse? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart new file mode 100644 index 000000000000..23e8deceaea8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart @@ -0,0 +1,303 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/order.dart'; + +class StoreApi { + + final Dio _dio; + + const StoreApi(this._dio); + + /// Delete purchase order by ID + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// Parameters: + /// * [orderId] - ID of the order that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteOrder({ + required String orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Map] as data + /// Throws [DioException] if API call or serialization fails + Future>> getInventory({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/inventory'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'apiKey', + 'name': 'api_key', + 'keyName': 'api_key', + 'where': 'header', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Map? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, int>(rawData, 'Map', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Find purchase order by ID + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// Parameters: + /// * [orderId] - ID of pet that needs to be fetched + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> getOrderById({ + required int orderId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Place an order for a pet + /// + /// + /// Parameters: + /// * [order] - order placed for purchasing the pet + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [Order] as data + /// Throws [DioException] if API call or serialization fails + Future> placeOrder({ + required Order order, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/store/order'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(order); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + Order? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart new file mode 100644 index 000000000000..24bbeb48f746 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart @@ -0,0 +1,524 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:openapi/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:openapi/src/model/user.dart'; + +class UserApi { + + final Dio _dio; + + const UserApi(this._dio); + + /// Create user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [user] - Created user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUser({ + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithArrayInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithArray'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Creates list of users with given input array + /// + /// + /// Parameters: + /// * [user] - List of user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> createUsersWithListInput({ + required List user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/createWithList'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Delete user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - The name that needs to be deleted + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> deleteUser({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get user by user name + /// + /// + /// Parameters: + /// * [username] - The name that needs to be fetched. Use user1 for testing. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [User] as data + /// Throws [DioException] if API call or serialization fails + Future> getUserByName({ + required String username, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + User? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'User', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs user into the system + /// + /// + /// Parameters: + /// * [username] - The user name for login + /// * [password] - The password for login in clear text + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [String] as data + /// Throws [DioException] if API call or serialization fails + Future> loginUser({ + required String username, + required String password, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/login'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + r'username': username, + r'password': password, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + String? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Logs out current logged in user session + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> logoutUser({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/logout'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Updated user + /// This can only be done by the logged in user. + /// + /// Parameters: + /// * [username] - name that need to be deleted + /// * [user] - Updated user object + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> updateUser({ + required String username, + required User user, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { +_bodyData=jsonEncode(user); + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart new file mode 100644 index 000000000000..ee16e3f0f92f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class ApiKeyAuthInterceptor extends AuthInterceptor { + final Map apiKeys = {}; + + @override + void onRequest(RequestOptions options, RequestInterceptorHandler handler) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + for (final info in authInfo) { + final authName = info['name'] as String; + final authKeyName = info['keyName'] as String; + final authWhere = info['where'] as String; + final apiKey = apiKeys[authName]; + if (apiKey != null) { + if (authWhere == 'query') { + options.queryParameters[authKeyName] = apiKey; + } else { + options.headers[authKeyName] = apiKey; + } + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart new file mode 100644 index 000000000000..f7ae9bf3f11e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; + +abstract class AuthInterceptor extends Interceptor { + /// Get auth information on given route for the given type. + /// Can return an empty list if type is not present on auth data or + /// if route doesn't need authentication. + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { + if (route.extra.containsKey('secure')) { + final auth = route.extra['secure'] as List>; + return auth.where((secure) => handles(secure)).toList(); + } + return []; + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart new file mode 100644 index 000000000000..b6e6dce04f9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BasicAuthInfo { + final String username; + final String password; + + const BasicAuthInfo(this.username, this.password); +} + +class BasicAuthInterceptor extends AuthInterceptor { + final Map authInfo = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + for (final info in metadataAuthInfo) { + final authName = info['name'] as String; + final basicAuthInfo = authInfo[authName]; + if (basicAuthInfo != null) { + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + options.headers['Authorization'] = basicAuth; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart new file mode 100644 index 000000000000..1d4402b376c0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class BearerAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart new file mode 100644 index 000000000000..337cf762b0ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'package:dio/dio.dart'; +import 'package:openapi/src/auth/auth.dart'; + +class OAuthInterceptor extends AuthInterceptor { + final Map tokens = {}; + + @override + void onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) { + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + for (final info in authInfo) { + final token = tokens[info['name']]; + if (token != null) { + options.headers['Authorization'] = 'Bearer ${token}'; + break; + } + } + super.onRequest(options, handler); + } +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart new file mode 100644 index 000000000000..f5b09fc89fb3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart @@ -0,0 +1,345 @@ +import 'package:openapi/src/model/additional_properties_class.dart'; +import 'package:openapi/src/model/addressable.dart'; +import 'package:openapi/src/model/all_of_with_single_ref.dart'; +import 'package:openapi/src/model/animal.dart'; +import 'package:openapi/src/model/api_response.dart'; +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/apple_all_of_disc.dart'; +import 'package:openapi/src/model/apple_grandparent_disc.dart'; +import 'package:openapi/src/model/apple_one_of_disc.dart'; +import 'package:openapi/src/model/apple_req_disc.dart'; +import 'package:openapi/src/model/apple_variant1.dart'; +import 'package:openapi/src/model/array_of_array_of_number_only.dart'; +import 'package:openapi/src/model/array_of_number_only.dart'; +import 'package:openapi/src/model/array_test.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:openapi/src/model/banana_all_of_disc.dart'; +import 'package:openapi/src/model/banana_grandparent_disc.dart'; +import 'package:openapi/src/model/banana_one_of_disc.dart'; +import 'package:openapi/src/model/banana_req_disc.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:openapi/src/model/bar_create.dart'; +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar_ref_or_value.dart'; +import 'package:openapi/src/model/capitalization.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/class_model.dart'; +import 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; +import 'package:openapi/src/model/composed_disc_optional_type_correct.dart'; +import 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart'; +import 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart'; +import 'package:openapi/src/model/composed_disc_required_inconsistent.dart'; +import 'package:openapi/src/model/composed_disc_type_inconsistent.dart'; +import 'package:openapi/src/model/composed_disc_type_incorrect.dart'; +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/disc_missing_from_properties.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:openapi/src/model/dog.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:openapi/src/model/enum_arrays.dart'; +import 'package:openapi/src/model/enum_test.dart'; +import 'package:openapi/src/model/extensible.dart'; +import 'package:openapi/src/model/file_schema_test_class.dart'; +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_basic_get_default_response.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/format_test.dart'; +import 'package:openapi/src/model/fruit.dart'; +import 'package:openapi/src/model/fruit_all_of_disc.dart'; +import 'package:openapi/src/model/fruit_any_of_disc.dart'; +import 'package:openapi/src/model/fruit_grandparent_disc.dart'; +import 'package:openapi/src/model/fruit_inline_disc.dart'; +import 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:openapi/src/model/fruit_one_of_disc.dart'; +import 'package:openapi/src/model/fruit_req_disc.dart'; +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:openapi/src/model/fruit_variant1.dart'; +import 'package:openapi/src/model/giga_one_of.dart'; +import 'package:openapi/src/model/grape_variant1.dart'; +import 'package:openapi/src/model/has_only_read_only.dart'; +import 'package:openapi/src/model/health_check_result.dart'; +import 'package:openapi/src/model/map_test.dart'; +import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; +import 'package:openapi/src/model/model200_response.dart'; +import 'package:openapi/src/model/model_client.dart'; +import 'package:openapi/src/model/model_file.dart'; +import 'package:openapi/src/model/model_list.dart'; +import 'package:openapi/src/model/model_return.dart'; +import 'package:openapi/src/model/name.dart'; +import 'package:openapi/src/model/nullable_class.dart'; +import 'package:openapi/src/model/number_only.dart'; +import 'package:openapi/src/model/object_with_deprecated_fields.dart'; +import 'package:openapi/src/model/one_of_primitive_child.dart'; +import 'package:openapi/src/model/order.dart'; +import 'package:openapi/src/model/outer_composite.dart'; +import 'package:openapi/src/model/outer_object_with_enum_property.dart'; +import 'package:openapi/src/model/parent.dart'; +import 'package:openapi/src/model/pasta.dart'; +import 'package:openapi/src/model/pet.dart'; +import 'package:openapi/src/model/pizza.dart'; +import 'package:openapi/src/model/pizza_speziale.dart'; +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_model_name.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:openapi/src/model/user.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + + ReturnType deserialize(dynamic value, String targetType, {bool growable= true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdditionalPropertiesClass': + return AdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'Addressable': + return Addressable.fromJson(value as Map) as ReturnType; + case 'AllOfWithSingleRef': + return AllOfWithSingleRef.fromJson(value as Map) as ReturnType; + case 'Animal': + return Animal.fromJson(value as Map) as ReturnType; + case 'ApiResponse': + return ApiResponse.fromJson(value as Map) as ReturnType; + case 'Apple': + return Apple.fromJson(value as Map) as ReturnType; + case 'AppleAllOfDisc': + return AppleAllOfDisc.fromJson(value as Map) as ReturnType; + case 'AppleGrandparentDisc': + return AppleGrandparentDisc.fromJson(value as Map) as ReturnType; + case 'AppleOneOfDisc': + return AppleOneOfDisc.fromJson(value as Map) as ReturnType; + case 'AppleReqDisc': + return AppleReqDisc.fromJson(value as Map) as ReturnType; + case 'AppleVariant1': + return AppleVariant1.fromJson(value as Map) as ReturnType; + case 'ArrayOfArrayOfNumberOnly': + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayOfNumberOnly': + return ArrayOfNumberOnly.fromJson(value as Map) as ReturnType; + case 'ArrayTest': + return ArrayTest.fromJson(value as Map) as ReturnType; + case 'Banana': + return Banana.fromJson(value as Map) as ReturnType; + case 'BananaAllOfDisc': + return BananaAllOfDisc.fromJson(value as Map) as ReturnType; + case 'BananaGrandparentDisc': + return BananaGrandparentDisc.fromJson(value as Map) as ReturnType; + case 'BananaOneOfDisc': + return BananaOneOfDisc.fromJson(value as Map) as ReturnType; + case 'BananaReqDisc': + return BananaReqDisc.fromJson(value as Map) as ReturnType; + case 'Bar': + return Bar.fromJson(value as Map) as ReturnType; + case 'BarCreate': + return BarCreate.fromJson(value as Map) as ReturnType; + case 'BarRef': + return BarRef.fromJson(value as Map) as ReturnType; + case 'BarRefOrValue': + return BarRefOrValue.fromJson(value as Map) as ReturnType; + case 'Capitalization': + return Capitalization.fromJson(value as Map) as ReturnType; + case 'Cat': + return Cat.fromJson(value as Map) as ReturnType; + case 'Category': + return Category.fromJson(value as Map) as ReturnType; + case 'ClassModel': + return ClassModel.fromJson(value as Map) as ReturnType; + case 'ComposedDiscMissingFromProperties': + return ComposedDiscMissingFromProperties.fromJson(value as Map) as ReturnType; + case 'ComposedDiscOptionalTypeCorrect': + return ComposedDiscOptionalTypeCorrect.fromJson(value as Map) as ReturnType; + case 'ComposedDiscOptionalTypeInconsistent': + return ComposedDiscOptionalTypeInconsistent.fromJson(value as Map) as ReturnType; + case 'ComposedDiscOptionalTypeIncorrect': + return ComposedDiscOptionalTypeIncorrect.fromJson(value as Map) as ReturnType; + case 'ComposedDiscRequiredInconsistent': + return ComposedDiscRequiredInconsistent.fromJson(value as Map) as ReturnType; + case 'ComposedDiscTypeInconsistent': + return ComposedDiscTypeInconsistent.fromJson(value as Map) as ReturnType; + case 'ComposedDiscTypeIncorrect': + return ComposedDiscTypeIncorrect.fromJson(value as Map) as ReturnType; + case 'DeprecatedObject': + return DeprecatedObject.fromJson(value as Map) as ReturnType; + case 'DiscMissingFromProperties': + return DiscMissingFromProperties.fromJson(value as Map) as ReturnType; + case 'DiscOptionalTypeCorrect': + return DiscOptionalTypeCorrect.fromJson(value as Map) as ReturnType; + case 'DiscOptionalTypeIncorrect': + return DiscOptionalTypeIncorrect.fromJson(value as Map) as ReturnType; + case 'DiscTypeIncorrect': + return DiscTypeIncorrect.fromJson(value as Map) as ReturnType; + case 'Dog': + return Dog.fromJson(value as Map) as ReturnType; + case 'Entity': + return Entity.fromJson(value as Map) as ReturnType; + case 'EntityRef': + return EntityRef.fromJson(value as Map) as ReturnType; + case 'EnumArrays': + return EnumArrays.fromJson(value as Map) as ReturnType; + case 'EnumTest': + return EnumTest.fromJson(value as Map) as ReturnType; + case 'Extensible': + return Extensible.fromJson(value as Map) as ReturnType; + case 'FileSchemaTestClass': + return FileSchemaTestClass.fromJson(value as Map) as ReturnType; + case 'Foo': + return Foo.fromJson(value as Map) as ReturnType; + case 'FooBasicGetDefaultResponse': + return FooBasicGetDefaultResponse.fromJson(value as Map) as ReturnType; + case 'FooRef': + return FooRef.fromJson(value as Map) as ReturnType; + case 'FooRefOrValue': + return FooRefOrValue.fromJson(value as Map) as ReturnType; + case 'FormatTest': + return FormatTest.fromJson(value as Map) as ReturnType; + case 'Fruit': + return Fruit.fromJson(value as Map) as ReturnType; + case 'FruitAllOfDisc': + return FruitAllOfDisc.fromJson(value as Map) as ReturnType; + case 'FruitAnyOfDisc': + return FruitAnyOfDisc.fromJson(value as Map) as ReturnType; + case 'FruitGrandparentDisc': + return FruitGrandparentDisc.fromJson(value as Map) as ReturnType; + case 'FruitInlineDisc': + return FruitInlineDisc.fromJson(value as Map) as ReturnType; + case 'FruitInlineDiscOneOf': + return FruitInlineDiscOneOf.fromJson(value as Map) as ReturnType; + case 'FruitInlineDiscOneOf1': + return FruitInlineDiscOneOf1.fromJson(value as Map) as ReturnType; + case 'FruitInlineInlineDisc': + return FruitInlineInlineDisc.fromJson(value as Map) as ReturnType; + case 'FruitInlineInlineDiscOneOf': + return FruitInlineInlineDiscOneOf.fromJson(value as Map) as ReturnType; + case 'FruitInlineInlineDiscOneOf1': + return FruitInlineInlineDiscOneOf1.fromJson(value as Map) as ReturnType; + case 'FruitInlineInlineDiscOneOfOneOf': + return FruitInlineInlineDiscOneOfOneOf.fromJson(value as Map) as ReturnType; + case 'FruitOneOfDisc': + return FruitOneOfDisc.fromJson(value as Map) as ReturnType; + case 'FruitReqDisc': + return FruitReqDisc.fromJson(value as Map) as ReturnType; + case 'FruitType': + return FruitType.fromJson(value as Map) as ReturnType; + case 'FruitVariant1': + return FruitVariant1.fromJson(value as Map) as ReturnType; + case 'GigaOneOf': + return GigaOneOf.fromJson(value as Map) as ReturnType; + case 'GrapeVariant1': + return GrapeVariant1.fromJson(value as Map) as ReturnType; + case 'HasOnlyReadOnly': + return HasOnlyReadOnly.fromJson(value as Map) as ReturnType; + case 'HealthCheckResult': + return HealthCheckResult.fromJson(value as Map) as ReturnType; + case 'MapTest': + return MapTest.fromJson(value as Map) as ReturnType; + case 'MixedPropertiesAndAdditionalPropertiesClass': + return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as ReturnType; + case 'Model200Response': + return Model200Response.fromJson(value as Map) as ReturnType; + case 'ModelClient': + return ModelClient.fromJson(value as Map) as ReturnType; + case 'ModelEnumClass': + + + case 'ModelFile': + return ModelFile.fromJson(value as Map) as ReturnType; + case 'ModelList': + return ModelList.fromJson(value as Map) as ReturnType; + case 'ModelReturn': + return ModelReturn.fromJson(value as Map) as ReturnType; + case 'Name': + return Name.fromJson(value as Map) as ReturnType; + case 'NullableClass': + return NullableClass.fromJson(value as Map) as ReturnType; + case 'NumberOnly': + return NumberOnly.fromJson(value as Map) as ReturnType; + case 'ObjectWithDeprecatedFields': + return ObjectWithDeprecatedFields.fromJson(value as Map) as ReturnType; + case 'OneOfPrimitiveChild': + return OneOfPrimitiveChild.fromJson(value as Map) as ReturnType; + case 'Order': + return Order.fromJson(value as Map) as ReturnType; + case 'OuterComposite': + return OuterComposite.fromJson(value as Map) as ReturnType; + case 'OuterEnum': + + + case 'OuterEnumDefaultValue': + + + case 'OuterEnumInteger': + + + case 'OuterEnumIntegerDefaultValue': + + + case 'OuterObjectWithEnumProperty': + return OuterObjectWithEnumProperty.fromJson(value as Map) as ReturnType; + case 'Parent': + return Parent.fromJson(value as Map) as ReturnType; + case 'Pasta': + return Pasta.fromJson(value as Map) as ReturnType; + case 'Pet': + return Pet.fromJson(value as Map) as ReturnType; + case 'Pizza': + return Pizza.fromJson(value as Map) as ReturnType; + case 'PizzaSpeziale': + return PizzaSpeziale.fromJson(value as Map) as ReturnType; + case 'ReadOnlyFirst': + return ReadOnlyFirst.fromJson(value as Map) as ReturnType; + case 'SingleRefType': + + + case 'SpecialModelName': + return SpecialModelName.fromJson(value as Map) as ReturnType; + case 'Tag': + return Tag.fromJson(value as Map) as ReturnType; + case 'User': + return User.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize(v, targetType, growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize(v, targetType, growable: growable)), + ) as ReturnType; + } + break; + } + throw Exception('Cannot deserialize'); + } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart new file mode 100644 index 000000000000..a3d4df084be5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'additional_properties_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AdditionalPropertiesClass { + /// Returns a new [AdditionalPropertiesClass] instance. + AdditionalPropertiesClass({ + + this.mapProperty, + + this.mapOfMapProperty, + }); + + @JsonKey( + + name: r'map_property', + required: false, + includeIfNull: false + ) + + + final Map? mapProperty; + + + + @JsonKey( + + name: r'map_of_map_property', + required: false, + includeIfNull: false + ) + + + final Map>? mapOfMapProperty; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => + mapProperty.hashCode + + mapOfMapProperty.hashCode; + + factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); + + Map toJson() => _$AdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart new file mode 100644 index 000000000000..014a58b24f0a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'addressable.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Addressable { + /// Returns a new [Addressable] instance. + Addressable({ + + this.href, + + this.id, + }); + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Addressable && + other.href == href && + other.id == id; + + @override + int get hashCode => + href.hashCode + + id.hashCode; + + factory Addressable.fromJson(Map json) => _$AddressableFromJson(json); + + Map toJson() => _$AddressableToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart new file mode 100644 index 000000000000..b654a66733e9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'all_of_with_single_ref.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AllOfWithSingleRef { + /// Returns a new [AllOfWithSingleRef] instance. + AllOfWithSingleRef({ + + this.username, + + this.singleRefType, + }); + + @JsonKey( + + name: r'username', + required: false, + includeIfNull: false + ) + + + final String? username; + + + + @JsonKey( + + name: r'SingleRefType', + required: false, + includeIfNull: false + ) + + + final SingleRefType? singleRefType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; + + @override + int get hashCode => + username.hashCode + + singleRefType.hashCode; + + factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); + + Map toJson() => _$AllOfWithSingleRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart new file mode 100644 index 000000000000..22a196ce7d7f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'animal.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Animal { + /// Returns a new [Animal] instance. + Animal({ + + required this.className, + + this.color = 'red', + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Animal && + other.className == className && + other.color == color; + + @override + int get hashCode => + className.hashCode + + color.hashCode; + + factory Animal.fromJson(Map json) => _$AnimalFromJson(json); + + Map toJson() => _$AnimalToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart new file mode 100644 index 000000000000..c6700e2d39ce --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'api_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ApiResponse { + /// Returns a new [ApiResponse] instance. + ApiResponse({ + + this.code, + + this.type, + + this.message, + }); + + @JsonKey( + + name: r'code', + required: false, + includeIfNull: false + ) + + + final int? code; + + + + @JsonKey( + + name: r'type', + required: false, + includeIfNull: false + ) + + + final String? type; + + + + @JsonKey( + + name: r'message', + required: false, + includeIfNull: false + ) + + + final String? message; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => + code.hashCode + + type.hashCode + + message.hashCode; + + factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); + + Map toJson() => _$ApiResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart new file mode 100644 index 000000000000..96aa5d5598c7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Apple { + /// Returns a new [Apple] instance. + Apple({ + + this.kind, + }); + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final String? kind; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Apple && + other.kind == kind; + + @override + int get hashCode => + kind.hashCode; + + factory Apple.fromJson(Map json) => _$AppleFromJson(json); + + Map toJson() => _$AppleToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart new file mode 100644 index 000000000000..a3a77e9adc58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_all_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleAllOfDisc { + /// Returns a new [AppleAllOfDisc] instance. + AppleAllOfDisc({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AppleAllOfDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory AppleAllOfDisc.fromJson(Map json) => _$AppleAllOfDiscFromJson(json); + + Map toJson() => _$AppleAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart new file mode 100644 index 000000000000..ffc417571fd2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_grandparent_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleGrandparentDisc { + /// Returns a new [AppleGrandparentDisc] instance. + AppleGrandparentDisc({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AppleGrandparentDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory AppleGrandparentDisc.fromJson(Map json) => _$AppleGrandparentDiscFromJson(json); + + Map toJson() => _$AppleGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart new file mode 100644 index 000000000000..9f24d3622e9c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_one_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleOneOfDisc { + /// Returns a new [AppleOneOfDisc] instance. + AppleOneOfDisc({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AppleOneOfDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory AppleOneOfDisc.fromJson(Map json) => _$AppleOneOfDiscFromJson(json); + + Map toJson() => _$AppleOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart new file mode 100644 index 000000000000..4ea609af07be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_req_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleReqDisc { + /// Returns a new [AppleReqDisc] instance. + AppleReqDisc({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AppleReqDisc && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory AppleReqDisc.fromJson(Map json) => _$AppleReqDiscFromJson(json); + + Map toJson() => _$AppleReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart new file mode 100644 index 000000000000..409aca725037 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'apple_variant1.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AppleVariant1 { + /// Returns a new [AppleVariant1] instance. + AppleVariant1({ + + this.kind, + }); + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final String? kind; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AppleVariant1 && + other.kind == kind; + + @override + int get hashCode => + kind.hashCode; + + factory AppleVariant1.fromJson(Map json) => _$AppleVariant1FromJson(json); + + Map toJson() => _$AppleVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart new file mode 100644 index 000000000000..7372be1583f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_array_of_number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfArrayOfNumberOnly { + /// Returns a new [ArrayOfArrayOfNumberOnly] instance. + ArrayOfArrayOfNumberOnly({ + + this.arrayArrayNumber, + }); + + @JsonKey( + + name: r'ArrayArrayNumber', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => + arrayArrayNumber.hashCode; + + factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart new file mode 100644 index 000000000000..d538bb312fde --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'array_of_number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayOfNumberOnly { + /// Returns a new [ArrayOfNumberOnly] instance. + ArrayOfNumberOnly({ + + this.arrayNumber, + }); + + @JsonKey( + + name: r'ArrayNumber', + required: false, + includeIfNull: false + ) + + + final List? arrayNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && + other.arrayNumber == arrayNumber; + + @override + int get hashCode => + arrayNumber.hashCode; + + factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); + + Map toJson() => _$ArrayOfNumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart new file mode 100644 index 000000000000..30a6ec8a8b72 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/read_only_first.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'array_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ArrayTest { + /// Returns a new [ArrayTest] instance. + ArrayTest({ + + this.arrayOfString, + + this.arrayArrayOfInteger, + + this.arrayArrayOfModel, + }); + + @JsonKey( + + name: r'array_of_string', + required: false, + includeIfNull: false + ) + + + final List? arrayOfString; + + + + @JsonKey( + + name: r'array_array_of_integer', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfInteger; + + + + @JsonKey( + + name: r'array_array_of_model', + required: false, + includeIfNull: false + ) + + + final List>? arrayArrayOfModel; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; + + factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); + + Map toJson() => _$ArrayTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart new file mode 100644 index 000000000000..62eb2439ddb8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Banana { + /// Returns a new [Banana] instance. + Banana({ + + this.count, + }); + + @JsonKey( + + name: r'count', + required: false, + includeIfNull: false + ) + + + final num? count; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Banana && + other.count == count; + + @override + int get hashCode => + count.hashCode; + + factory Banana.fromJson(Map json) => _$BananaFromJson(json); + + Map toJson() => _$BananaToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart new file mode 100644 index 000000000000..dec0c1d1e22e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_all_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaAllOfDisc { + /// Returns a new [BananaAllOfDisc] instance. + BananaAllOfDisc({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BananaAllOfDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory BananaAllOfDisc.fromJson(Map json) => _$BananaAllOfDiscFromJson(json); + + Map toJson() => _$BananaAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart new file mode 100644 index 000000000000..d4fb1a32b3cf --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_grandparent_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaGrandparentDisc { + /// Returns a new [BananaGrandparentDisc] instance. + BananaGrandparentDisc({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BananaGrandparentDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory BananaGrandparentDisc.fromJson(Map json) => _$BananaGrandparentDiscFromJson(json); + + Map toJson() => _$BananaGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart new file mode 100644 index 000000000000..d9088ace5ef6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_one_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaOneOfDisc { + /// Returns a new [BananaOneOfDisc] instance. + BananaOneOfDisc({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BananaOneOfDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory BananaOneOfDisc.fromJson(Map json) => _$BananaOneOfDiscFromJson(json); + + Map toJson() => _$BananaOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart new file mode 100644 index 000000000000..cc6b5e0400f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'banana_req_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BananaReqDisc { + /// Returns a new [BananaReqDisc] instance. + BananaReqDisc({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BananaReqDisc && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory BananaReqDisc.fromJson(Map json) => _$BananaReqDiscFromJson(json); + + Map toJson() => _$BananaReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart new file mode 100644 index 000000000000..f37c58357d80 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart @@ -0,0 +1,174 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Bar { + /// Returns a new [Bar] instance. + Bar({ + + required this.id, + + this.barPropA, + + this.fooPropB, + + this.foo, + + this.href, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false + ) + + + final String id; + + + + @JsonKey( + + name: r'barPropA', + required: false, + includeIfNull: false + ) + + + final String? barPropA; + + + + @JsonKey( + + name: r'fooPropB', + required: false, + includeIfNull: false + ) + + + final String? fooPropB; + + + + @JsonKey( + + name: r'foo', + required: false, + includeIfNull: false + ) + + + final FooRefOrValue? foo; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Bar && + other.id == id && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + id.hashCode + + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Bar.fromJson(Map json) => _$BarFromJson(json); + + Map toJson() => _$BarToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart new file mode 100644 index 000000000000..64f9509277cc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart @@ -0,0 +1,175 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo_ref_or_value.dart'; +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_create.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarCreate { + /// Returns a new [BarCreate] instance. + BarCreate({ + + this.barPropA, + + this.fooPropB, + + this.foo, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'barPropA', + required: false, + includeIfNull: false + ) + + + final String? barPropA; + + + + @JsonKey( + + name: r'fooPropB', + required: false, + includeIfNull: false + ) + + + final String? fooPropB; + + + + @JsonKey( + + name: r'foo', + required: false, + includeIfNull: false + ) + + + final FooRefOrValue? foo; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BarCreate && + other.barPropA == barPropA && + other.fooPropB == fooPropB && + other.foo == foo && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + barPropA.hashCode + + fooPropB.hashCode + + foo.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarCreate.fromJson(Map json) => _$BarCreateFromJson(json); + + Map toJson() => _$BarCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart new file mode 100644 index 000000000000..f6b6bc05e15c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRef { + /// Returns a new [BarRef] instance. + BarRef({ + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BarRef && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); + + Map toJson() => _$BarRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart new file mode 100644 index 000000000000..4103e72ca7f6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/bar_ref.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'bar_ref_or_value.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BarRefOrValue { + /// Returns a new [BarRefOrValue] instance. + BarRefOrValue({ + + this.href, + + required this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false + ) + + + final String id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BarRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory BarRefOrValue.fromJson(Map json) => _$BarRefOrValueFromJson(json); + + Map toJson() => _$BarRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart new file mode 100644 index 000000000000..707cb05a040f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart @@ -0,0 +1,135 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'capitalization.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Capitalization { + /// Returns a new [Capitalization] instance. + Capitalization({ + + this.smallCamel, + + this.capitalCamel, + + this.smallSnake, + + this.capitalSnake, + + this.sCAETHFlowPoints, + + this.ATT_NAME, + }); + + @JsonKey( + + name: r'smallCamel', + required: false, + includeIfNull: false + ) + + + final String? smallCamel; + + + + @JsonKey( + + name: r'CapitalCamel', + required: false, + includeIfNull: false + ) + + + final String? capitalCamel; + + + + @JsonKey( + + name: r'small_Snake', + required: false, + includeIfNull: false + ) + + + final String? smallSnake; + + + + @JsonKey( + + name: r'Capital_Snake', + required: false, + includeIfNull: false + ) + + + final String? capitalSnake; + + + + @JsonKey( + + name: r'SCA_ETH_Flow_Points', + required: false, + includeIfNull: false + ) + + + final String? sCAETHFlowPoints; + + + + /// Name of the pet + @JsonKey( + + name: r'ATT_NAME', + required: false, + includeIfNull: false + ) + + + final String? ATT_NAME; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; + + factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); + + Map toJson() => _$CapitalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart new file mode 100644 index 000000000000..0b176faf313e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'cat.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Cat { + /// Returns a new [Cat] instance. + Cat({ + + required this.className, + + this.color = 'red', + + this.declawed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + declawed.hashCode; + + factory Cat.fromJson(Map json) => _$CatFromJson(json); + + Map toJson() => _$CatToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart new file mode 100644 index 000000000000..b94c61579909 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'category.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Category { + /// Returns a new [Category] instance. + Category({ + + this.id, + + this.name = 'default-name', + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + defaultValue: 'default-name', + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Category && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; + + factory Category.fromJson(Map json) => _$CategoryFromJson(json); + + Map toJson() => _$CategoryToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart new file mode 100644 index 000000000000..01837bfcca96 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'class_model.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ClassModel { + /// Returns a new [ClassModel] instance. + ClassModel({ + + this.class_, + }); + + @JsonKey( + + name: r'_class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ClassModel && + other.class_ == class_; + + @override + int get hashCode => + class_.hashCode; + + factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); + + Map toJson() => _$ClassModelToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart new file mode 100644 index 000000000000..50ce619f3f15 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_missing_from_properties.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_missing_from_properties.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscMissingFromProperties { + /// Returns a new [ComposedDiscMissingFromProperties] instance. + ComposedDiscMissingFromProperties({ + + this.length, + }); + + @JsonKey( + + name: r'length', + required: false, + includeIfNull: false + ) + + + final int? length; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscMissingFromProperties && + other.length == length; + + @override + int get hashCode => + length.hashCode; + + factory ComposedDiscMissingFromProperties.fromJson(Map json) => _$ComposedDiscMissingFromPropertiesFromJson(json); + + Map toJson() => _$ComposedDiscMissingFromPropertiesToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart new file mode 100644 index 000000000000..b6a10c7582b5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_correct.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeCorrect { + /// Returns a new [ComposedDiscOptionalTypeCorrect] instance. + ComposedDiscOptionalTypeCorrect({ + + this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: false, + includeIfNull: false + ) + + + final String? fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscOptionalTypeCorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscOptionalTypeCorrect.fromJson(Map json) => _$ComposedDiscOptionalTypeCorrectFromJson(json); + + Map toJson() => _$ComposedDiscOptionalTypeCorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart new file mode 100644 index 000000000000..1576b2caae2b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_inconsistent.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeInconsistent { + /// Returns a new [ComposedDiscOptionalTypeInconsistent] instance. + ComposedDiscOptionalTypeInconsistent({ + + this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: false, + includeIfNull: false + ) + + + final String? fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscOptionalTypeInconsistent && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscOptionalTypeInconsistent.fromJson(Map json) => _$ComposedDiscOptionalTypeInconsistentFromJson(json); + + Map toJson() => _$ComposedDiscOptionalTypeInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..d340242de626 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_optional_type_incorrect.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscOptionalTypeIncorrect { + /// Returns a new [ComposedDiscOptionalTypeIncorrect] instance. + ComposedDiscOptionalTypeIncorrect({ + + this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: false, + includeIfNull: false + ) + + + final int? fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscOptionalTypeIncorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscOptionalTypeIncorrect.fromJson(Map json) => _$ComposedDiscOptionalTypeIncorrectFromJson(json); + + Map toJson() => _$ComposedDiscOptionalTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart new file mode 100644 index 000000000000..872902c846e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:openapi/src/model/disc_optional_type_correct.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_required_inconsistent.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscRequiredInconsistent { + /// Returns a new [ComposedDiscRequiredInconsistent] instance. + ComposedDiscRequiredInconsistent({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscRequiredInconsistent && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscRequiredInconsistent.fromJson(Map json) => _$ComposedDiscRequiredInconsistentFromJson(json); + + Map toJson() => _$ComposedDiscRequiredInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart new file mode 100644 index 000000000000..d2fe273df4c9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_type_inconsistent.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscTypeInconsistent { + /// Returns a new [ComposedDiscTypeInconsistent] instance. + ComposedDiscTypeInconsistent({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscTypeInconsistent && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscTypeInconsistent.fromJson(Map json) => _$ComposedDiscTypeInconsistentFromJson(json); + + Map toJson() => _$ComposedDiscTypeInconsistentToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart new file mode 100644 index 000000000000..7da0535ff755 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/disc_type_incorrect.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'composed_disc_type_incorrect.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ComposedDiscTypeIncorrect { + /// Returns a new [ComposedDiscTypeIncorrect] instance. + ComposedDiscTypeIncorrect({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final int fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ComposedDiscTypeIncorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory ComposedDiscTypeIncorrect.fromJson(Map json) => _$ComposedDiscTypeIncorrectFromJson(json); + + Map toJson() => _$ComposedDiscTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart new file mode 100644 index 000000000000..0151b72e23a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'deprecated_object.g.dart'; + + +@Deprecated('DeprecatedObject has been deprecated') +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DeprecatedObject { + /// Returns a new [DeprecatedObject] instance. + DeprecatedObject({ + + this.name, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && + other.name == name; + + @override + int get hashCode => + name.hashCode; + + factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); + + Map toJson() => _$DeprecatedObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart new file mode 100644 index 000000000000..428ab5aabe2a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_missing_from_properties.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscMissingFromProperties { + /// Returns a new [DiscMissingFromProperties] instance. + DiscMissingFromProperties({ + + this.length, + }); + + @JsonKey( + + name: r'length', + required: false, + includeIfNull: false + ) + + + final int? length; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DiscMissingFromProperties && + other.length == length; + + @override + int get hashCode => + length.hashCode; + + factory DiscMissingFromProperties.fromJson(Map json) => _$DiscMissingFromPropertiesFromJson(json); + + Map toJson() => _$DiscMissingFromPropertiesToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart new file mode 100644 index 000000000000..87c5ee5855ef --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_optional_type_correct.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscOptionalTypeCorrect { + /// Returns a new [DiscOptionalTypeCorrect] instance. + DiscOptionalTypeCorrect({ + + this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: false, + includeIfNull: false + ) + + + final String? fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DiscOptionalTypeCorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory DiscOptionalTypeCorrect.fromJson(Map json) => _$DiscOptionalTypeCorrectFromJson(json); + + Map toJson() => _$DiscOptionalTypeCorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart new file mode 100644 index 000000000000..c3c1c6745240 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_optional_type_incorrect.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscOptionalTypeIncorrect { + /// Returns a new [DiscOptionalTypeIncorrect] instance. + DiscOptionalTypeIncorrect({ + + this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: false, + includeIfNull: false + ) + + + final int? fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DiscOptionalTypeIncorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory DiscOptionalTypeIncorrect.fromJson(Map json) => _$DiscOptionalTypeIncorrectFromJson(json); + + Map toJson() => _$DiscOptionalTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart new file mode 100644 index 000000000000..12a5cfa8ac08 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'disc_type_incorrect.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class DiscTypeIncorrect { + /// Returns a new [DiscTypeIncorrect] instance. + DiscTypeIncorrect({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final int fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is DiscTypeIncorrect && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory DiscTypeIncorrect.fromJson(Map json) => _$DiscTypeIncorrectFromJson(json); + + Map toJson() => _$DiscTypeIncorrectToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart new file mode 100644 index 000000000000..a049d0479fb0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'dog.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Dog { + /// Returns a new [Dog] instance. + Dog({ + + required this.className, + + this.color = 'red', + + this.breed, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'breed', + required: false, + includeIfNull: false + ) + + + final String? breed; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + breed.hashCode; + + factory Dog.fromJson(Map json) => _$DogFromJson(json); + + Map toJson() => _$DogToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart new file mode 100644 index 000000000000..c95e0e404f88 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Entity { + /// Returns a new [Entity] instance. + Entity({ + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Entity && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Entity.fromJson(Map json) => _$EntityFromJson(json); + + Map toJson() => _$EntityToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart new file mode 100644 index 000000000000..91cf2f4ed1ae --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart @@ -0,0 +1,157 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'entity_ref.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EntityRef { + /// Returns a new [EntityRef] instance. + EntityRef({ + + this.name, + + this.atReferredType, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// Name of the related entity. + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + /// The actual type of the target instance when needed for disambiguation. + @JsonKey( + + name: r'@referredType', + required: false, + includeIfNull: false + ) + + + final String? atReferredType; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EntityRef && + other.name == name && + other.atReferredType == atReferredType && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + name.hashCode + + atReferredType.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory EntityRef.fromJson(Map json) => _$EntityRefFromJson(json); + + Map toJson() => _$EntityRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart new file mode 100644 index 000000000000..a97d069a3d25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart @@ -0,0 +1,92 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_arrays.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumArrays { + /// Returns a new [EnumArrays] instance. + EnumArrays({ + + this.justSymbol, + + this.arrayEnum, + }); + + @JsonKey( + + name: r'just_symbol', + required: false, + includeIfNull: false + ) + + + final EnumArraysJustSymbolEnum? justSymbol; + + + + @JsonKey( + + name: r'array_enum', + required: false, + includeIfNull: false + ) + + + final List? arrayEnum; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => + justSymbol.hashCode + + arrayEnum.hashCode; + + factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); + + Map toJson() => _$EnumArraysToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumArraysJustSymbolEnum { + @JsonValue(r'>=') + greaterThanEqual, + @JsonValue(r'$') + dollar, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumArraysArrayEnumEnum { + @JsonValue(r'fish') + fish, + @JsonValue(r'crab') + crab, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart new file mode 100644 index 000000000000..80555c14d038 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart @@ -0,0 +1,218 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum.dart'; +import 'package:openapi/src/model/outer_enum_default_value.dart'; +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'enum_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EnumTest { + /// Returns a new [EnumTest] instance. + EnumTest({ + + this.enumString, + + required this.enumStringRequired, + + this.enumInteger, + + this.enumNumber, + + this.outerEnum, + + this.outerEnumInteger, + + this.outerEnumDefaultValue, + + this.outerEnumIntegerDefaultValue, + }); + + @JsonKey( + + name: r'enum_string', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumStringEnum? enumString; + + + + @JsonKey( + + name: r'enum_string_required', + required: true, + includeIfNull: false + ) + + + final EnumTestEnumStringRequiredEnum enumStringRequired; + + + + @JsonKey( + + name: r'enum_integer', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumIntegerEnum? enumInteger; + + + + @JsonKey( + + name: r'enum_number', + required: false, + includeIfNull: false + ) + + + final EnumTestEnumNumberEnum? enumNumber; + + + + @JsonKey( + + name: r'outerEnum', + required: false, + includeIfNull: false + ) + + + final OuterEnum? outerEnum; + + + + @JsonKey( + + name: r'outerEnumInteger', + required: false, + includeIfNull: false + ) + + + final OuterEnumInteger? outerEnumInteger; + + + + @JsonKey( + + name: r'outerEnumDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumDefaultValue? outerEnumDefaultValue; + + + + @JsonKey( + + name: r'outerEnumIntegerDefaultValue', + required: false, + includeIfNull: false + ) + + + final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; + + factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); + + Map toJson() => _$EnumTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum EnumTestEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumStringRequiredEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'') + empty, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumIntegerEnum { + @JsonValue(1) + number1, + @JsonValue(-1) + numberNegative1, + @JsonValue(11184809) + unknownDefaultOpenApi, +} + + + +enum EnumTestEnumNumberEnum { + @JsonValue('1.1') + number1Period1, + @JsonValue('-1.2') + numberNegative1Period2, + @JsonValue('11184809') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart new file mode 100644 index 000000000000..c54846e3d45e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'extensible.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Extensible { + /// Returns a new [Extensible] instance. + Extensible({ + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Extensible && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Extensible.fromJson(Map json) => _$ExtensibleFromJson(json); + + Map toJson() => _$ExtensibleToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart new file mode 100644 index 000000000000..bd2a9dc6f2fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/model_file.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'file_schema_test_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FileSchemaTestClass { + /// Returns a new [FileSchemaTestClass] instance. + FileSchemaTestClass({ + + this.file, + + this.files, + }); + + @JsonKey( + + name: r'file', + required: false, + includeIfNull: false + ) + + + final ModelFile? file; + + + + @JsonKey( + + name: r'files', + required: false, + includeIfNull: false + ) + + + final List? files; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => + file.hashCode + + files.hashCode; + + factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); + + Map toJson() => _$FileSchemaTestClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart new file mode 100644 index 000000000000..591b297c5625 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart @@ -0,0 +1,158 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Foo { + /// Returns a new [Foo] instance. + Foo({ + + this.fooPropA, + + this.fooPropB, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'fooPropA', + required: false, + includeIfNull: false + ) + + + final String? fooPropA; + + + + @JsonKey( + + name: r'fooPropB', + required: false, + includeIfNull: false + ) + + + final String? fooPropB; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Foo && + other.fooPropA == fooPropA && + other.fooPropB == fooPropB && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + fooPropA.hashCode + + fooPropB.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Foo.fromJson(Map json) => _$FooFromJson(json); + + Map toJson() => _$FooToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart new file mode 100644 index 000000000000..0ea084ab4a00 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_basic_get_default_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooBasicGetDefaultResponse { + /// Returns a new [FooBasicGetDefaultResponse] instance. + FooBasicGetDefaultResponse({ + + this.string, + }); + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final Foo? string; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FooBasicGetDefaultResponse && + other.string == string; + + @override + int get hashCode => + string.hashCode; + + factory FooBasicGetDefaultResponse.fromJson(Map json) => _$FooBasicGetDefaultResponseFromJson(json); + + Map toJson() => _$FooBasicGetDefaultResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart new file mode 100644 index 000000000000..797ff7c32e59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRef { + /// Returns a new [FooRef] instance. + FooRef({ + + this.foorefPropA, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'foorefPropA', + required: false, + includeIfNull: false + ) + + + final String? foorefPropA; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FooRef && + other.foorefPropA == foorefPropA && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + foorefPropA.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); + + Map toJson() => _$FooRefToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart new file mode 100644 index 000000000000..6e45b169dc8d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/foo.dart'; +import 'package:openapi/src/model/foo_ref.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'foo_ref_or_value.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FooRefOrValue { + /// Returns a new [FooRefOrValue] instance. + FooRefOrValue({ + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FooRefOrValue && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory FooRefOrValue.fromJson(Map json) => _$FooRefOrValueFromJson(json); + + Map toJson() => _$FooRefOrValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart new file mode 100644 index 000000000000..91b35595a34d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart @@ -0,0 +1,302 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:dio/dio.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'format_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FormatTest { + /// Returns a new [FormatTest] instance. + FormatTest({ + + this.integer, + + this.int32, + + this.int64, + + required this.number, + + this.float, + + this.double_, + + this.decimal, + + this.string, + + required this.byte, + + this.binary, + + required this.date, + + this.dateTime, + + this.uuid, + + required this.password, + + this.patternWithDigits, + + this.patternWithDigitsAndDelimiter, + }); + + // minimum: 10 + // maximum: 100 + @JsonKey( + + name: r'integer', + required: false, + includeIfNull: false + ) + + + final int? integer; + + + + // minimum: 20 + // maximum: 200 + @JsonKey( + + name: r'int32', + required: false, + includeIfNull: false + ) + + + final int? int32; + + + + @JsonKey( + + name: r'int64', + required: false, + includeIfNull: false + ) + + + final int? int64; + + + + // minimum: 32.1 + // maximum: 543.2 + @JsonKey( + + name: r'number', + required: true, + includeIfNull: false + ) + + + final num number; + + + + // minimum: 54.3 + // maximum: 987.6 + @JsonKey( + + name: r'float', + required: false, + includeIfNull: false + ) + + + final double? float; + + + + // minimum: 67.8 + // maximum: 123.4 + @JsonKey( + + name: r'double', + required: false, + includeIfNull: false + ) + + + final double? double_; + + + + @JsonKey( + + name: r'decimal', + required: false, + includeIfNull: false + ) + + + final double? decimal; + + + + @JsonKey( + + name: r'string', + required: false, + includeIfNull: false + ) + + + final String? string; + + + + @JsonKey( + + name: r'byte', + required: true, + includeIfNull: false + ) + + + final String byte; + + + + @JsonKey(ignore: true) + + + final MultipartFile? binary; + + + + @JsonKey( + + name: r'date', + required: true, + includeIfNull: false + ) + + + final DateTime date; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'password', + required: true, + includeIfNull: false + ) + + + final String password; + + + + /// A string that is a 10 digit number. Can have leading zeros. + @JsonKey( + + name: r'pattern_with_digits', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigits; + + + + /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + @JsonKey( + + name: r'pattern_with_digits_and_delimiter', + required: false, + includeIfNull: false + ) + + + final String? patternWithDigitsAndDelimiter; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; + + factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); + + Map toJson() => _$FormatTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart new file mode 100644 index 000000000000..1fe8d76856a1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple.dart'; +import 'package:openapi/src/model/banana.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Fruit { + /// Returns a new [Fruit] instance. + Fruit({ + + this.color, + + this.kind, + + this.count, + }); + + @JsonKey( + + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final String? kind; + + + + @JsonKey( + + name: r'count', + required: false, + includeIfNull: false + ) + + + final num? count; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Fruit && + other.color == color && + other.kind == kind && + other.count == count; + + @override + int get hashCode => + color.hashCode + + kind.hashCode + + count.hashCode; + + factory Fruit.fromJson(Map json) => _$FruitFromJson(json); + + Map toJson() => _$FruitToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart new file mode 100644 index 000000000000..412d3e8c2848 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_all_of_disc.dart'; +import 'package:openapi/src/model/apple_all_of_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_all_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitAllOfDisc { + /// Returns a new [FruitAllOfDisc] instance. + FruitAllOfDisc({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitAllOfDisc && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitAllOfDisc.fromJson(Map json) => _$FruitAllOfDiscFromJson(json); + + Map toJson() => _$FruitAllOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart new file mode 100644 index 000000000000..87f9d8e75e9d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_type.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_any_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitAnyOfDisc { + /// Returns a new [FruitAnyOfDisc] instance. + FruitAnyOfDisc({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitAnyOfDisc && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitAnyOfDisc.fromJson(Map json) => _$FruitAnyOfDiscFromJson(json); + + Map toJson() => _$FruitAnyOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart new file mode 100644 index 000000000000..bf57d0cfba0e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_grandparent_disc.dart'; +import 'package:openapi/src/model/apple_grandparent_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_grandparent_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitGrandparentDisc { + /// Returns a new [FruitGrandparentDisc] instance. + FruitGrandparentDisc({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitGrandparentDisc && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitGrandparentDisc.fromJson(Map json) => _$FruitGrandparentDiscFromJson(json); + + Map toJson() => _$FruitGrandparentDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart new file mode 100644 index 000000000000..b847c36d5935 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDisc { + /// Returns a new [FruitInlineDisc] instance. + FruitInlineDisc({ + + required this.seeds, + + required this.fruitType, + + required this.length, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineDisc && + other.seeds == seeds && + other.fruitType == fruitType && + other.length == length; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode + + length.hashCode; + + factory FruitInlineDisc.fromJson(Map json) => _$FruitInlineDiscFromJson(json); + + Map toJson() => _$FruitInlineDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart new file mode 100644 index 000000000000..b40e4561588a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc_one_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDiscOneOf { + /// Returns a new [FruitInlineDiscOneOf] instance. + FruitInlineDiscOneOf({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineDiscOneOf && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory FruitInlineDiscOneOf.fromJson(Map json) => _$FruitInlineDiscOneOfFromJson(json); + + Map toJson() => _$FruitInlineDiscOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart new file mode 100644 index 000000000000..6cf10e08ec51 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_disc_one_of1.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineDiscOneOf1 { + /// Returns a new [FruitInlineDiscOneOf1] instance. + FruitInlineDiscOneOf1({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineDiscOneOf1 && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory FruitInlineDiscOneOf1.fromJson(Map json) => _$FruitInlineDiscOneOf1FromJson(json); + + Map toJson() => _$FruitInlineDiscOneOf1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart new file mode 100644 index 000000000000..b1f24bb65922 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDisc { + /// Returns a new [FruitInlineInlineDisc] instance. + FruitInlineInlineDisc({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineInlineDisc && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitInlineInlineDisc.fromJson(Map json) => _$FruitInlineInlineDiscFromJson(json); + + Map toJson() => _$FruitInlineInlineDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart new file mode 100644 index 000000000000..b3df0106fd03 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOf { + /// Returns a new [FruitInlineInlineDiscOneOf] instance. + FruitInlineInlineDiscOneOf({ + + required this.seeds, + + required this.fruitType, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineInlineDiscOneOf && + other.seeds == seeds && + other.fruitType == fruitType; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode; + + factory FruitInlineInlineDiscOneOf.fromJson(Map json) => _$FruitInlineInlineDiscOneOfFromJson(json); + + Map toJson() => _$FruitInlineInlineDiscOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart new file mode 100644 index 000000000000..adf4ae58f946 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of1.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOf1 { + /// Returns a new [FruitInlineInlineDiscOneOf1] instance. + FruitInlineInlineDiscOneOf1({ + + required this.length, + + required this.fruitType, + }); + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineInlineDiscOneOf1 && + other.length == length && + other.fruitType == fruitType; + + @override + int get hashCode => + length.hashCode + + fruitType.hashCode; + + factory FruitInlineInlineDiscOneOf1.fromJson(Map json) => _$FruitInlineInlineDiscOneOf1FromJson(json); + + Map toJson() => _$FruitInlineInlineDiscOneOf1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart new file mode 100644 index 000000000000..af9265de646a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_inline_inline_disc_one_of_one_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitInlineInlineDiscOneOfOneOf { + /// Returns a new [FruitInlineInlineDiscOneOfOneOf] instance. + FruitInlineInlineDiscOneOfOneOf({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitInlineInlineDiscOneOfOneOf && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitInlineInlineDiscOneOfOneOf.fromJson(Map json) => _$FruitInlineInlineDiscOneOfOneOfFromJson(json); + + Map toJson() => _$FruitInlineInlineDiscOneOfOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart new file mode 100644 index 000000000000..d3d978dfd78d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_one_of_disc.dart'; +import 'package:openapi/src/model/apple_one_of_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_one_of_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitOneOfDisc { + /// Returns a new [FruitOneOfDisc] instance. + FruitOneOfDisc({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitOneOfDisc && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitOneOfDisc.fromJson(Map json) => _$FruitOneOfDiscFromJson(json); + + Map toJson() => _$FruitOneOfDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart new file mode 100644 index 000000000000..f567d896cf26 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/banana_req_disc.dart'; +import 'package:openapi/src/model/apple_req_disc.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_req_disc.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitReqDisc { + /// Returns a new [FruitReqDisc] instance. + FruitReqDisc({ + + required this.seeds, + + required this.fruitType, + + required this.length, + }); + + @JsonKey( + + name: r'seeds', + required: true, + includeIfNull: false + ) + + + final int seeds; + + + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @JsonKey( + + name: r'length', + required: true, + includeIfNull: false + ) + + + final int length; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitReqDisc && + other.seeds == seeds && + other.fruitType == fruitType && + other.length == length; + + @override + int get hashCode => + seeds.hashCode + + fruitType.hashCode + + length.hashCode; + + factory FruitReqDisc.fromJson(Map json) => _$FruitReqDiscFromJson(json); + + Map toJson() => _$FruitReqDiscToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart new file mode 100644 index 000000000000..beb914444663 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_type.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitType { + /// Returns a new [FruitType] instance. + FruitType({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitType && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory FruitType.fromJson(Map json) => _$FruitTypeFromJson(json); + + Map toJson() => _$FruitTypeToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart new file mode 100644 index 000000000000..9f960afb4ce6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart @@ -0,0 +1,72 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/apple_variant1.dart'; +import 'package:openapi/src/model/grape_variant1.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'fruit_variant1.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class FruitVariant1 { + /// Returns a new [FruitVariant1] instance. + FruitVariant1({ + + this.color, + + this.kind, + }); + + @JsonKey( + + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final String? kind; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is FruitVariant1 && + other.color == color && + other.kind == kind; + + @override + int get hashCode => + color.hashCode + + kind.hashCode; + + factory FruitVariant1.fromJson(Map json) => _$FruitVariant1FromJson(json); + + Map toJson() => _$FruitVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart new file mode 100644 index 000000000000..be280b065a79 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/one_of_primitive_child.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'giga_one_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GigaOneOf { + /// Returns a new [GigaOneOf] instance. + GigaOneOf({ + + this.name, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GigaOneOf && + other.name == name; + + @override + int get hashCode => + name.hashCode; + + factory GigaOneOf.fromJson(Map json) => _$GigaOneOfFromJson(json); + + Map toJson() => _$GigaOneOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart new file mode 100644 index 000000000000..d1575e833cbc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'grape_variant1.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GrapeVariant1 { + /// Returns a new [GrapeVariant1] instance. + GrapeVariant1({ + + this.color, + }); + + @JsonKey( + + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GrapeVariant1 && + other.color == color; + + @override + int get hashCode => + color.hashCode; + + factory GrapeVariant1.fromJson(Map json) => _$GrapeVariant1FromJson(json); + + Map toJson() => _$GrapeVariant1ToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart new file mode 100644 index 000000000000..84c99fbc188c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'has_only_read_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HasOnlyReadOnly { + /// Returns a new [HasOnlyReadOnly] instance. + HasOnlyReadOnly({ + + this.bar, + + this.foo, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'foo', + required: false, + includeIfNull: false + ) + + + final String? foo; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && + other.bar == bar && + other.foo == foo; + + @override + int get hashCode => + bar.hashCode + + foo.hashCode; + + factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); + + Map toJson() => _$HasOnlyReadOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart new file mode 100644 index 000000000000..fcb2973b7514 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'health_check_result.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HealthCheckResult { + /// Returns a new [HealthCheckResult] instance. + HealthCheckResult({ + + this.nullableMessage, + }); + + @JsonKey( + + name: r'NullableMessage', + required: false, + includeIfNull: false + ) + + + final String? nullableMessage; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && + other.nullableMessage == nullableMessage; + + @override + int get hashCode => + (nullableMessage == null ? 0 : nullableMessage.hashCode); + + factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); + + Map toJson() => _$HealthCheckResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart new file mode 100644 index 000000000000..7ab19eabd5cd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'map_test.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MapTest { + /// Returns a new [MapTest] instance. + MapTest({ + + this.mapMapOfString, + + this.mapOfEnumString, + + this.directMap, + + this.indirectMap, + }); + + @JsonKey( + + name: r'map_map_of_string', + required: false, + includeIfNull: false + ) + + + final Map>? mapMapOfString; + + + + @JsonKey( + + name: r'map_of_enum_string', + required: false, + includeIfNull: false + ) + + + final Map? mapOfEnumString; + + + + @JsonKey( + + name: r'direct_map', + required: false, + includeIfNull: false + ) + + + final Map? directMap; + + + + @JsonKey( + + name: r'indirect_map', + required: false, + includeIfNull: false + ) + + + final Map? indirectMap; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; + + factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); + + Map toJson() => _$MapTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum MapTestMapOfEnumStringEnum { + @JsonValue(r'UPPER') + UPPER, + @JsonValue(r'lower') + lower, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart new file mode 100644 index 000000000000..e2e3cd0b857a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/animal.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'mixed_properties_and_additional_properties_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MixedPropertiesAndAdditionalPropertiesClass { + /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. + MixedPropertiesAndAdditionalPropertiesClass({ + + this.uuid, + + this.dateTime, + + this.map, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @JsonKey( + + name: r'dateTime', + required: false, + includeIfNull: false + ) + + + final DateTime? dateTime; + + + + @JsonKey( + + name: r'map', + required: false, + includeIfNull: false + ) + + + final Map? map; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => + uuid.hashCode + + dateTime.hashCode + + map.hashCode; + + factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); + + Map toJson() => _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart new file mode 100644 index 000000000000..346f1257555f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model200_response.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Model200Response { + /// Returns a new [Model200Response] instance. + Model200Response({ + + this.name, + + this.class_, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final int? name; + + + + @JsonKey( + + name: r'class', + required: false, + includeIfNull: false + ) + + + final String? class_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Model200Response && + other.name == name && + other.class_ == class_; + + @override + int get hashCode => + name.hashCode + + class_.hashCode; + + factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); + + Map toJson() => _$Model200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart new file mode 100644 index 000000000000..14e22005a161 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_client.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelClient { + /// Returns a new [ModelClient] instance. + ModelClient({ + + this.client, + }); + + @JsonKey( + + name: r'client', + required: false, + includeIfNull: false + ) + + + final String? client; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelClient && + other.client == client; + + @override + int get hashCode => + client.hashCode; + + factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); + + Map toJson() => _$ModelClientToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart new file mode 100644 index 000000000000..8abf107d98e6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum ModelEnumClass { + @JsonValue(r'_abc') + abc, + @JsonValue(r'-efg') + efg, + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart new file mode 100644 index 000000000000..fe95e3ff0029 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_file.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelFile { + /// Returns a new [ModelFile] instance. + ModelFile({ + + this.sourceURI, + }); + + /// Test capitalization + @JsonKey( + + name: r'sourceURI', + required: false, + includeIfNull: false + ) + + + final String? sourceURI; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelFile && + other.sourceURI == sourceURI; + + @override + int get hashCode => + sourceURI.hashCode; + + factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); + + Map toJson() => _$ModelFileToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart new file mode 100644 index 000000000000..543b79ac9f13 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_list.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelList { + /// Returns a new [ModelList] instance. + ModelList({ + + this.n123list, + }); + + @JsonKey( + + name: r'123-list', + required: false, + includeIfNull: false + ) + + + final String? n123list; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelList && + other.n123list == n123list; + + @override + int get hashCode => + n123list.hashCode; + + factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); + + Map toJson() => _$ModelListToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart new file mode 100644 index 000000000000..192b134d8fc6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'model_return.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ModelReturn { + /// Returns a new [ModelReturn] instance. + ModelReturn({ + + this.return_, + }); + + @JsonKey( + + name: r'return', + required: false, + includeIfNull: false + ) + + + final int? return_; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelReturn && + other.return_ == return_; + + @override + int get hashCode => + return_.hashCode; + + factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); + + Map toJson() => _$ModelReturnToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart new file mode 100644 index 000000000000..6613fa3afc8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart @@ -0,0 +1,102 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'name.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Name { + /// Returns a new [Name] instance. + Name({ + + required this.name, + + this.snakeCase, + + this.property, + + this.n123number, + }); + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final int name; + + + + @JsonKey( + + name: r'snake_case', + required: false, + includeIfNull: false + ) + + + final int? snakeCase; + + + + @JsonKey( + + name: r'property', + required: false, + includeIfNull: false + ) + + + final String? property; + + + + @JsonKey( + + name: r'123Number', + required: false, + includeIfNull: false + ) + + + final int? n123number; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; + + factory Name.fromJson(Map json) => _$NameFromJson(json); + + Map toJson() => _$NameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart new file mode 100644 index 000000000000..897d489ba450 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart @@ -0,0 +1,230 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'nullable_class.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NullableClass { + /// Returns a new [NullableClass] instance. + NullableClass({ + + this.integerProp, + + this.numberProp, + + this.booleanProp, + + this.stringProp, + + this.dateProp, + + this.datetimeProp, + + this.arrayNullableProp, + + this.arrayAndItemsNullableProp, + + this.arrayItemsNullable, + + this.objectNullableProp, + + this.objectAndItemsNullableProp, + + this.objectItemsNullable, + }); + + @JsonKey( + + name: r'integer_prop', + required: false, + includeIfNull: false + ) + + + final int? integerProp; + + + + @JsonKey( + + name: r'number_prop', + required: false, + includeIfNull: false + ) + + + final num? numberProp; + + + + @JsonKey( + + name: r'boolean_prop', + required: false, + includeIfNull: false + ) + + + final bool? booleanProp; + + + + @JsonKey( + + name: r'string_prop', + required: false, + includeIfNull: false + ) + + + final String? stringProp; + + + + @JsonKey( + + name: r'date_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? dateProp; + + + + @JsonKey( + + name: r'datetime_prop', + required: false, + includeIfNull: false + ) + + + final DateTime? datetimeProp; + + + + @JsonKey( + + name: r'array_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayNullableProp; + + + + @JsonKey( + + name: r'array_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final List? arrayAndItemsNullableProp; + + + + @JsonKey( + + name: r'array_items_nullable', + required: false, + includeIfNull: false + ) + + + final List? arrayItemsNullable; + + + + @JsonKey( + + name: r'object_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectNullableProp; + + + + @JsonKey( + + name: r'object_and_items_nullable_prop', + required: false, + includeIfNull: false + ) + + + final Map? objectAndItemsNullableProp; + + + + @JsonKey( + + name: r'object_items_nullable', + required: false, + includeIfNull: false + ) + + + final Map? objectItemsNullable; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; + + factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); + + Map toJson() => _$NullableClassToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart new file mode 100644 index 000000000000..3ca6bf704b59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'number_only.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NumberOnly { + /// Returns a new [NumberOnly] instance. + NumberOnly({ + + this.justNumber, + }); + + @JsonKey( + + name: r'JustNumber', + required: false, + includeIfNull: false + ) + + + final num? justNumber; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NumberOnly && + other.justNumber == justNumber; + + @override + int get hashCode => + justNumber.hashCode; + + factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); + + Map toJson() => _$NumberOnlyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart new file mode 100644 index 000000000000..dce29b30d982 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/deprecated_object.dart'; +import 'package:openapi/src/model/bar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'object_with_deprecated_fields.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ObjectWithDeprecatedFields { + /// Returns a new [ObjectWithDeprecatedFields] instance. + ObjectWithDeprecatedFields({ + + this.uuid, + + this.id, + + this.deprecatedRef, + + this.bars, + }); + + @JsonKey( + + name: r'uuid', + required: false, + includeIfNull: false + ) + + + final String? uuid; + + + + @Deprecated('id has been deprecated') + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final num? id; + + + + @Deprecated('deprecatedRef has been deprecated') + @JsonKey( + + name: r'deprecatedRef', + required: false, + includeIfNull: false + ) + + + final DeprecatedObject? deprecatedRef; + + + + @Deprecated('bars has been deprecated') + @JsonKey( + + name: r'bars', + required: false, + includeIfNull: false + ) + + + final List? bars; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + uuid.hashCode + + id.hashCode + + deprecatedRef.hashCode + + bars.hashCode; + + factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); + + Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart new file mode 100644 index 000000000000..820718622275 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'one_of_primitive_child.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OneOfPrimitiveChild { + /// Returns a new [OneOfPrimitiveChild] instance. + OneOfPrimitiveChild({ + + this.name, + }); + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OneOfPrimitiveChild && + other.name == name; + + @override + int get hashCode => + name.hashCode; + + factory OneOfPrimitiveChild.fromJson(Map json) => _$OneOfPrimitiveChildFromJson(json); + + Map toJson() => _$OneOfPrimitiveChildToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart new file mode 100644 index 000000000000..54134b511316 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart @@ -0,0 +1,148 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'order.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Order { + /// Returns a new [Order] instance. + Order({ + + this.id, + + this.petId, + + this.quantity, + + this.shipDate, + + this.status, + + this.complete = false, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'petId', + required: false, + includeIfNull: false + ) + + + final int? petId; + + + + @JsonKey( + + name: r'quantity', + required: false, + includeIfNull: false + ) + + + final int? quantity; + + + + @JsonKey( + + name: r'shipDate', + required: false, + includeIfNull: false + ) + + + final DateTime? shipDate; + + + + /// Order Status + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final OrderStatusEnum? status; + + + + @JsonKey( + defaultValue: false, + name: r'complete', + required: false, + includeIfNull: false + ) + + + final bool? complete; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; + + factory Order.fromJson(Map json) => _$OrderFromJson(json); + + Map toJson() => _$OrderToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// Order Status +enum OrderStatusEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart new file mode 100644 index 000000000000..f2509cb99213 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_composite.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterComposite { + /// Returns a new [OuterComposite] instance. + OuterComposite({ + + this.myNumber, + + this.myString, + + this.myBoolean, + }); + + @JsonKey( + + name: r'my_number', + required: false, + includeIfNull: false + ) + + + final num? myNumber; + + + + @JsonKey( + + name: r'my_string', + required: false, + includeIfNull: false + ) + + + final String? myString; + + + + @JsonKey( + + name: r'my_boolean', + required: false, + includeIfNull: false + ) + + + final bool? myBoolean; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + + myString.hashCode + + myBoolean.hashCode; + + factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); + + Map toJson() => _$OuterCompositeToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart new file mode 100644 index 000000000000..514507968c66 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnum { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart new file mode 100644 index 000000000000..0c8116edea96 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumDefaultValue { + @JsonValue(r'placed') + placed, + @JsonValue(r'approved') + approved, + @JsonValue(r'delivered') + delivered, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart new file mode 100644 index 000000000000..34268d0e9c53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumInteger { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart new file mode 100644 index 000000000000..97b325938828 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum OuterEnumIntegerDefaultValue { + @JsonValue(0) + number0, + @JsonValue(1) + number1, + @JsonValue(2) + number2, + @JsonValue(11184809) + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart new file mode 100644 index 000000000000..76d18676a110 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -0,0 +1,55 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/outer_enum_integer.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'outer_object_with_enum_property.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class OuterObjectWithEnumProperty { + /// Returns a new [OuterObjectWithEnumProperty] instance. + OuterObjectWithEnumProperty({ + + required this.value, + }); + + @JsonKey( + + name: r'value', + required: true, + includeIfNull: false + ) + + + final OuterEnumInteger value; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && + other.value == value; + + @override + int get hashCode => + value.hashCode; + + factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); + + Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart new file mode 100644 index 000000000000..166ff4e6af69 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'parent.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Parent { + /// Returns a new [Parent] instance. + Parent({ + + required this.fruitType, + }); + + @JsonKey( + + name: r'fruitType', + required: true, + includeIfNull: false + ) + + + final String fruitType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Parent && + other.fruitType == fruitType; + + @override + int get hashCode => + fruitType.hashCode; + + factory Parent.fromJson(Map json) => _$ParentFromJson(json); + + Map toJson() => _$ParentToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart new file mode 100644 index 000000000000..cb955e849bb6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pasta.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pasta { + /// Returns a new [Pasta] instance. + Pasta({ + + this.vendor, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'vendor', + required: false, + includeIfNull: false + ) + + + final String? vendor; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Pasta && + other.vendor == vendor && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + vendor.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pasta.fromJson(Map json) => _$PastaFromJson(json); + + Map toJson() => _$PastaToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart new file mode 100644 index 000000000000..28d6294bae59 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart @@ -0,0 +1,150 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/category.dart'; +import 'package:openapi/src/model/tag.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pet.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pet { + /// Returns a new [Pet] instance. + Pet({ + + this.id, + + this.category, + + required this.name, + + required this.photoUrls, + + this.tags, + + this.status, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'category', + required: false, + includeIfNull: false + ) + + + final Category? category; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false + ) + + + final String name; + + + + @JsonKey( + + name: r'photoUrls', + required: true, + includeIfNull: false + ) + + + final Set photoUrls; + + + + @JsonKey( + + name: r'tags', + required: false, + includeIfNull: false + ) + + + final List? tags; + + + + /// pet status in the store + @JsonKey( + + name: r'status', + required: false, + includeIfNull: false + ) + + + final PetStatusEnum? status; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; + + factory Pet.fromJson(Map json) => _$PetFromJson(json); + + Map toJson() => _$PetToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +/// pet status in the store +enum PetStatusEnum { + @JsonValue(r'available') + available, + @JsonValue(r'pending') + pending, + @JsonValue(r'sold') + sold, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart new file mode 100644 index 000000000000..a098d524e52e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/entity.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Pizza { + /// Returns a new [Pizza] instance. + Pizza({ + + this.pizzaSize, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'pizzaSize', + required: false, + includeIfNull: false + ) + + + final num? pizzaSize; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Pizza && + other.pizzaSize == pizzaSize && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + pizzaSize.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); + + Map toJson() => _$PizzaToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart new file mode 100644 index 000000000000..de6bb5bd6ae7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/pizza.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pizza_speziale.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PizzaSpeziale { + /// Returns a new [PizzaSpeziale] instance. + PizzaSpeziale({ + + this.toppings, + + this.href, + + this.id, + + this.atSchemaLocation, + + this.atBaseType, + + required this.atType, + }); + + @JsonKey( + + name: r'toppings', + required: false, + includeIfNull: false + ) + + + final String? toppings; + + + + /// Hyperlink reference + @JsonKey( + + name: r'href', + required: false, + includeIfNull: false + ) + + + final String? href; + + + + /// unique identifier + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final String? id; + + + + /// A URI to a JSON-Schema file that defines additional attributes and relationships + @JsonKey( + + name: r'@schemaLocation', + required: false, + includeIfNull: false + ) + + + final String? atSchemaLocation; + + + + /// When sub-classing, this defines the super-class + @JsonKey( + + name: r'@baseType', + required: false, + includeIfNull: false + ) + + + final String? atBaseType; + + + + /// When sub-classing, this defines the sub-class Extensible name + @JsonKey( + + name: r'@type', + required: true, + includeIfNull: false + ) + + + final String atType; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PizzaSpeziale && + other.toppings == toppings && + other.href == href && + other.id == id && + other.atSchemaLocation == atSchemaLocation && + other.atBaseType == atBaseType && + other.atType == atType; + + @override + int get hashCode => + toppings.hashCode + + href.hashCode + + id.hashCode + + atSchemaLocation.hashCode + + atBaseType.hashCode + + atType.hashCode; + + factory PizzaSpeziale.fromJson(Map json) => _$PizzaSpezialeFromJson(json); + + Map toJson() => _$PizzaSpezialeToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart new file mode 100644 index 000000000000..c71c088f1381 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'read_only_first.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReadOnlyFirst { + /// Returns a new [ReadOnlyFirst] instance. + ReadOnlyFirst({ + + this.bar, + + this.baz, + }); + + @JsonKey( + + name: r'bar', + required: false, + includeIfNull: false + ) + + + final String? bar; + + + + @JsonKey( + + name: r'baz', + required: false, + includeIfNull: false + ) + + + final String? baz; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && + other.bar == bar && + other.baz == baz; + + @override + int get hashCode => + bar.hashCode + + baz.hashCode; + + factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); + + Map toJson() => _$ReadOnlyFirstToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart new file mode 100644 index 000000000000..ca56d9841a5a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + + +enum SingleRefType { + @JsonValue(r'admin') + admin, + @JsonValue(r'user') + user, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart new file mode 100644 index 000000000000..acd3ba099576 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart @@ -0,0 +1,54 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'special_model_name.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialModelName { + /// Returns a new [SpecialModelName] instance. + SpecialModelName({ + + this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + }); + + @JsonKey( + + name: r'$special[property.name]', + required: false, + includeIfNull: false + ) + + + final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; + + factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); + + Map toJson() => _$SpecialModelNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart new file mode 100644 index 000000000000..d8a87eec1820 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart @@ -0,0 +1,70 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'tag.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class Tag { + /// Returns a new [Tag] instance. + Tag({ + + this.id, + + this.name, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false + ) + + + final String? name; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is Tag && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; + + factory Tag.fromJson(Map json) => _$TagFromJson(json); + + Map toJson() => _$TagToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart new file mode 100644 index 000000000000..62f132ce776d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart @@ -0,0 +1,167 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'user.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class User { + /// Returns a new [User] instance. + User({ + + this.id, + + this.username, + + this.firstName, + + this.lastName, + + this.email, + + this.password, + + this.phone, + + this.userStatus, + }); + + @JsonKey( + + name: r'id', + required: false, + includeIfNull: false + ) + + + final int? id; + + + + @JsonKey( + + name: r'username', + required: false, + includeIfNull: false + ) + + + final String? username; + + + + @JsonKey( + + name: r'firstName', + required: false, + includeIfNull: false + ) + + + final String? firstName; + + + + @JsonKey( + + name: r'lastName', + required: false, + includeIfNull: false + ) + + + final String? lastName; + + + + @JsonKey( + + name: r'email', + required: false, + includeIfNull: false + ) + + + final String? email; + + + + @JsonKey( + + name: r'password', + required: false, + includeIfNull: false + ) + + + final String? password; + + + + @JsonKey( + + name: r'phone', + required: false, + includeIfNull: false + ) + + + final String? phone; + + + + /// User Status + @JsonKey( + + name: r'userStatus', + required: false, + includeIfNull: false + ) + + + final int? userStatus; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; + + factory User.fromJson(Map json) => _$UserFromJson(json); + + Map toJson() => _$UserToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml new file mode 100644 index 000000000000..d005a785419f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml @@ -0,0 +1,16 @@ +name: openapi +version: 1.0.0 +description: OpenAPI API client +homepage: homepage + +environment: + sdk: '>=2.15.0 <3.0.0' + +dependencies: + dio: '^5.2.0' + json_annotation: '^4.4.0' + +dev_dependencies: + build_runner: any + json_serializable: '^6.1.5' + test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart new file mode 100644 index 000000000000..fd8299fb998f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AdditionalPropertiesClass +void main() { + final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + group(AdditionalPropertiesClass, () { + // Map mapProperty + test('to test the property `mapProperty`', () async { + // TODO + }); + + // Map> mapOfMapProperty + test('to test the property `mapOfMapProperty`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart new file mode 100644 index 000000000000..2c4a84f1cb39 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Addressable +void main() { + final Addressable? instance = /* Addressable(...) */ null; + // TODO add properties to the entity + + group(Addressable, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart new file mode 100644 index 000000000000..ad5da909f6e3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AllOfWithSingleRef +void main() { + final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; + // TODO add properties to the entity + + group(AllOfWithSingleRef, () { + // String username + test('to test the property `username`', () async { + // TODO + }); + + // SingleRefType singleRefType + test('to test the property `singleRefType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart new file mode 100644 index 000000000000..83c65b22bfc3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Animal +void main() { + final Animal? instance = /* Animal(...) */ null; + // TODO add properties to the entity + + group(Animal, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart new file mode 100644 index 000000000000..ddafef2a831b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for AnotherFakeApi +void main() { + final instance = Openapi().getAnotherFakeApi(); + + group(AnotherFakeApi, () { + // To test special tags + // + // To test special tags and operation ID starting with number + // + //Future call123testSpecialTags(ModelClient modelClient) async + test('test call123testSpecialTags', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart new file mode 100644 index 000000000000..9487afd7f58c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ApiResponse +void main() { + final ApiResponse? instance = /* ApiResponse(...) */ null; + // TODO add properties to the entity + + group(ApiResponse, () { + // int code + test('to test the property `code`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart new file mode 100644 index 000000000000..795a76a02d4a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleAllOfDisc +void main() { + final AppleAllOfDisc? instance = /* AppleAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(AppleAllOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart new file mode 100644 index 000000000000..6a3ddd70df85 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleGrandparentDisc +void main() { + final AppleGrandparentDisc? instance = /* AppleGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(AppleGrandparentDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart new file mode 100644 index 000000000000..02e0384c46c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleOneOfDisc +void main() { + final AppleOneOfDisc? instance = /* AppleOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(AppleOneOfDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart new file mode 100644 index 000000000000..4f6319e1dac1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleReqDisc +void main() { + final AppleReqDisc? instance = /* AppleReqDisc(...) */ null; + // TODO add properties to the entity + + group(AppleReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart new file mode 100644 index 000000000000..200492f8b1f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Apple +void main() { + final Apple? instance = /* Apple(...) */ null; + // TODO add properties to the entity + + group(Apple, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart new file mode 100644 index 000000000000..3da39610c385 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for AppleVariant1 +void main() { + final AppleVariant1? instance = /* AppleVariant1(...) */ null; + // TODO add properties to the entity + + group(AppleVariant1, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart new file mode 100644 index 000000000000..79c0d3f3bba8 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfArrayOfNumberOnly +void main() { + final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfArrayOfNumberOnly, () { + // List> arrayArrayNumber + test('to test the property `arrayArrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart new file mode 100644 index 000000000000..d80be97cf147 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayOfNumberOnly +void main() { + final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; + // TODO add properties to the entity + + group(ArrayOfNumberOnly, () { + // List arrayNumber + test('to test the property `arrayNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart new file mode 100644 index 000000000000..bfe7c84fd122 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ArrayTest +void main() { + final ArrayTest? instance = /* ArrayTest(...) */ null; + // TODO add properties to the entity + + group(ArrayTest, () { + // List arrayOfString + test('to test the property `arrayOfString`', () async { + // TODO + }); + + // List> arrayArrayOfInteger + test('to test the property `arrayArrayOfInteger`', () async { + // TODO + }); + + // List> arrayArrayOfModel + test('to test the property `arrayArrayOfModel`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart new file mode 100644 index 000000000000..63ddbb143c2e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaAllOfDisc +void main() { + final BananaAllOfDisc? instance = /* BananaAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(BananaAllOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart new file mode 100644 index 000000000000..c8cd21759361 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaGrandparentDisc +void main() { + final BananaGrandparentDisc? instance = /* BananaGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(BananaGrandparentDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart new file mode 100644 index 000000000000..b28908dce973 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaOneOfDisc +void main() { + final BananaOneOfDisc? instance = /* BananaOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(BananaOneOfDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart new file mode 100644 index 000000000000..9e3dd9f4e58f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BananaReqDisc +void main() { + final BananaReqDisc? instance = /* BananaReqDisc(...) */ null; + // TODO add properties to the entity + + group(BananaReqDisc, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart new file mode 100644 index 000000000000..ae681c740af5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Banana +void main() { + final Banana? instance = /* Banana(...) */ null; + // TODO add properties to the entity + + group(Banana, () { + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart new file mode 100644 index 000000000000..73be91c446e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart @@ -0,0 +1,18 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for BarApi +void main() { + final instance = Openapi().getBarApi(); + + group(BarApi, () { + // Create a Bar + // + //Future createBar(BarCreate barCreate) async + test('test createBar', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart new file mode 100644 index 000000000000..720b7afc6e94 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarCreate +void main() { + final BarCreate? instance = /* BarCreate(...) */ null; + // TODO add properties to the entity + + group(BarCreate, () { + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart new file mode 100644 index 000000000000..68ef8d7e473d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRefOrValue +void main() { + final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; + // TODO add properties to the entity + + group(BarRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart new file mode 100644 index 000000000000..9901ee8da41e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for BarRef +void main() { + final BarRef? instance = /* BarRef(...) */ null; + // TODO add properties to the entity + + group(BarRef, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart new file mode 100644 index 000000000000..bacdc3d3b62d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart @@ -0,0 +1,55 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Bar +void main() { + final Bar? instance = /* Bar(...) */ null; + // TODO add properties to the entity + + group(Bar, () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String barPropA + test('to test the property `barPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // FooRefOrValue foo + test('to test the property `foo`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart new file mode 100644 index 000000000000..156b0ee4993c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Capitalization +void main() { + final Capitalization? instance = /* Capitalization(...) */ null; + // TODO add properties to the entity + + group(Capitalization, () { + // String smallCamel + test('to test the property `smallCamel`', () async { + // TODO + }); + + // String capitalCamel + test('to test the property `capitalCamel`', () async { + // TODO + }); + + // String smallSnake + test('to test the property `smallSnake`', () async { + // TODO + }); + + // String capitalSnake + test('to test the property `capitalSnake`', () async { + // TODO + }); + + // String sCAETHFlowPoints + test('to test the property `sCAETHFlowPoints`', () async { + // TODO + }); + + // Name of the pet + // String ATT_NAME + test('to test the property `ATT_NAME`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart new file mode 100644 index 000000000000..0a8811bd37f7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Cat +void main() { + final Cat? instance = /* Cat(...) */ null; + // TODO add properties to the entity + + group(Cat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart new file mode 100644 index 000000000000..0ed6921ae7fc --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Category +void main() { + final Category? instance = /* Category(...) */ null; + // TODO add properties to the entity + + group(Category, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: 'default-name') + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart new file mode 100644 index 000000000000..e2dda7bab74e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ClassModel +void main() { + final ClassModel? instance = /* ClassModel(...) */ null; + // TODO add properties to the entity + + group(ClassModel, () { + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..6aa4ea7cd3f3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscMissingFromProperties +void main() { + final ComposedDiscMissingFromProperties? instance = /* ComposedDiscMissingFromProperties(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..019707164585 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeCorrect +void main() { + final ComposedDiscOptionalTypeCorrect? instance = /* ComposedDiscOptionalTypeCorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart new file mode 100644 index 000000000000..a7908a9af523 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeInconsistent +void main() { + final ComposedDiscOptionalTypeInconsistent? instance = /* ComposedDiscOptionalTypeInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..75c12126867c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscOptionalTypeIncorrect +void main() { + final ComposedDiscOptionalTypeIncorrect? instance = /* ComposedDiscOptionalTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart new file mode 100644 index 000000000000..474919be74c1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscRequiredInconsistent +void main() { + final ComposedDiscRequiredInconsistent? instance = /* ComposedDiscRequiredInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscRequiredInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart new file mode 100644 index 000000000000..0d4e5de48f57 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeInconsistent +void main() { + final ComposedDiscTypeInconsistent? instance = /* ComposedDiscTypeInconsistent(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscTypeInconsistent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart new file mode 100644 index 000000000000..e6319e3932e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ComposedDiscTypeIncorrect +void main() { + final ComposedDiscTypeIncorrect? instance = /* ComposedDiscTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(ComposedDiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart new file mode 100644 index 000000000000..5e638c26329e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for DefaultApi +void main() { + final instance = Openapi().getDefaultApi(); + + group(DefaultApi, () { + //Future fooBasicGet() async + test('test fooBasicGet', () async { + // TODO + }); + + //Future list() async + test('test list', () async { + // TODO + }); + + //Future oneofGet() async + test('test oneofGet', () async { + // TODO + }); + + //Future test({ Object body }) async + test('test test', () async { + // TODO + }); + + //Future variant1Get() async + test('test variant1Get', () async { + // TODO + }); + + //Future variant2Get() async + test('test variant2Get', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart new file mode 100644 index 000000000000..1b2214668577 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DeprecatedObject +void main() { + final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; + // TODO add properties to the entity + + group(DeprecatedObject, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart new file mode 100644 index 000000000000..6588519317b3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscMissingFromProperties +void main() { + final DiscMissingFromProperties? instance = /* DiscMissingFromProperties(...) */ null; + // TODO add properties to the entity + + group(DiscMissingFromProperties, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart new file mode 100644 index 000000000000..6f52229b070d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeCorrect +void main() { + final DiscOptionalTypeCorrect? instance = /* DiscOptionalTypeCorrect(...) */ null; + // TODO add properties to the entity + + group(DiscOptionalTypeCorrect, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart new file mode 100644 index 000000000000..6503824b7980 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscOptionalTypeIncorrect +void main() { + final DiscOptionalTypeIncorrect? instance = /* DiscOptionalTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(DiscOptionalTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart new file mode 100644 index 000000000000..9eb0795df41b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for DiscTypeIncorrect +void main() { + final DiscTypeIncorrect? instance = /* DiscTypeIncorrect(...) */ null; + // TODO add properties to the entity + + group(DiscTypeIncorrect, () { + // int fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart new file mode 100644 index 000000000000..98097bd4bf25 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Dog +void main() { + final Dog? instance = /* Dog(...) */ null; + // TODO add properties to the entity + + group(Dog, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // String breed + test('to test the property `breed`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart new file mode 100644 index 000000000000..65fed045507a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EntityRef +void main() { + final EntityRef? instance = /* EntityRef(...) */ null; + // TODO add properties to the entity + + group(EntityRef, () { + // Name of the related entity. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // The actual type of the target instance when needed for disambiguation. + // String atReferredType + test('to test the property `atReferredType`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart new file mode 100644 index 000000000000..b34dd0ec767d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Entity +void main() { + final Entity? instance = /* Entity(...) */ null; + // TODO add properties to the entity + + group(Entity, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart new file mode 100644 index 000000000000..30d12204ba17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumArrays +void main() { + final EnumArrays? instance = /* EnumArrays(...) */ null; + // TODO add properties to the entity + + group(EnumArrays, () { + // String justSymbol + test('to test the property `justSymbol`', () async { + // TODO + }); + + // List arrayEnum + test('to test the property `arrayEnum`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart new file mode 100644 index 000000000000..befb9901ce9d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for EnumTest +void main() { + final EnumTest? instance = /* EnumTest(...) */ null; + // TODO add properties to the entity + + group(EnumTest, () { + // String enumString + test('to test the property `enumString`', () async { + // TODO + }); + + // String enumStringRequired + test('to test the property `enumStringRequired`', () async { + // TODO + }); + + // int enumInteger + test('to test the property `enumInteger`', () async { + // TODO + }); + + // double enumNumber + test('to test the property `enumNumber`', () async { + // TODO + }); + + // OuterEnum outerEnum + test('to test the property `outerEnum`', () async { + // TODO + }); + + // OuterEnumInteger outerEnumInteger + test('to test the property `outerEnumInteger`', () async { + // TODO + }); + + // OuterEnumDefaultValue outerEnumDefaultValue + test('to test the property `outerEnumDefaultValue`', () async { + // TODO + }); + + // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + test('to test the property `outerEnumIntegerDefaultValue`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart new file mode 100644 index 000000000000..df1f73c05b35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Extensible +void main() { + final Extensible? instance = /* Extensible(...) */ null; + // TODO add properties to the entity + + group(Extensible, () { + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart new file mode 100644 index 000000000000..06418dfa53c4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart @@ -0,0 +1,140 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeApi +void main() { + final instance = Openapi().getFakeApi(); + + group(FakeApi, () { + // Health check endpoint + // + //Future fakeHealthGet() async + test('test fakeHealthGet', () async { + // TODO + }); + + // test http signature authentication + // + //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async + test('test fakeHttpSignatureTest', () async { + // TODO + }); + + // Test serialization of outer boolean types + // + //Future fakeOuterBooleanSerialize({ bool body }) async + test('test fakeOuterBooleanSerialize', () async { + // TODO + }); + + // Test serialization of object with outer number type + // + //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async + test('test fakeOuterCompositeSerialize', () async { + // TODO + }); + + // Test serialization of outer number types + // + //Future fakeOuterNumberSerialize({ num body }) async + test('test fakeOuterNumberSerialize', () async { + // TODO + }); + + // Test serialization of outer string types + // + //Future fakeOuterStringSerialize({ String body }) async + test('test fakeOuterStringSerialize', () async { + // TODO + }); + + // Test serialization of enum (int) properties with examples + // + //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async + test('test fakePropertyEnumIntegerSerialize', () async { + // TODO + }); + + // For this test, the body has to be a binary file. + // + //Future testBodyWithBinary(MultipartFile body) async + test('test testBodyWithBinary', () async { + // TODO + }); + + // For this test, the body for this request must reference a schema named `File`. + // + //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async + test('test testBodyWithFileSchema', () async { + // TODO + }); + + //Future testBodyWithQueryParams(String query, User user) async + test('test testBodyWithQueryParams', () async { + // TODO + }); + + // To test \"client\" model + // + // To test \"client\" model + // + //Future testClientModel(ModelClient modelClient) async + test('test testClientModel', () async { + // TODO + }); + + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // + //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async + test('test testEndpointParameters', () async { + // TODO + }); + + // To test enum parameters + // + // To test enum parameters + // + //Future testEnumParameters({ List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString }) async + test('test testEnumParameters', () async { + // TODO + }); + + // Fake endpoint to test group parameters (optional) + // + // Fake endpoint to test group parameters (optional) + // + //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async + test('test testGroupParameters', () async { + // TODO + }); + + // test inline additionalProperties + // + // + // + //Future testInlineAdditionalProperties(Map requestBody) async + test('test testInlineAdditionalProperties', () async { + // TODO + }); + + // test json serialization of form data + // + // + // + //Future testJsonFormData(String param, String param2) async + test('test testJsonFormData', () async { + // TODO + }); + + // To test the collection format in query parameters + // + //Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async + test('test testQueryParameterCollectionFormat', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart new file mode 100644 index 000000000000..3075147f52fd --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FakeClassnameTags123Api +void main() { + final instance = Openapi().getFakeClassnameTags123Api(); + + group(FakeClassnameTags123Api, () { + // To test class name in snake case + // + // To test class name in snake case + // + //Future testClassname(ModelClient modelClient) async + test('test testClassname', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart new file mode 100644 index 000000000000..2ccd0d450ce7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FileSchemaTestClass +void main() { + final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; + // TODO add properties to the entity + + group(FileSchemaTestClass, () { + // ModelFile file + test('to test the property `file`', () async { + // TODO + }); + + // List files + test('to test the property `files`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart new file mode 100644 index 000000000000..40bc24e691ea --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart @@ -0,0 +1,25 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for FooApi +void main() { + final instance = Openapi().getFooApi(); + + group(FooApi, () { + // Create a Foo + // + //Future createFoo({ Foo foo }) async + test('test createFoo', () async { + // TODO + }); + + // GET all Foos + // + //Future> getAllFoos() async + test('test getAllFoos', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart new file mode 100644 index 000000000000..d344c491bc93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooBasicGetDefaultResponse +void main() { + final FooBasicGetDefaultResponse? instance = /* FooBasicGetDefaultResponse(...) */ null; + // TODO add properties to the entity + + group(FooBasicGetDefaultResponse, () { + // Foo string + test('to test the property `string`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart new file mode 100644 index 000000000000..5e1422e41a2f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRefOrValue +void main() { + final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; + // TODO add properties to the entity + + group(FooRefOrValue, () { + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart new file mode 100644 index 000000000000..b5258ac11d7d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FooRef +void main() { + final FooRef? instance = /* FooRef(...) */ null; + // TODO add properties to the entity + + group(FooRef, () { + // String foorefPropA + test('to test the property `foorefPropA`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart new file mode 100644 index 000000000000..e4ccad0f338a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Foo +void main() { + final Foo? instance = /* Foo(...) */ null; + // TODO add properties to the entity + + group(Foo, () { + // String fooPropA + test('to test the property `fooPropA`', () async { + // TODO + }); + + // String fooPropB + test('to test the property `fooPropB`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart new file mode 100644 index 000000000000..b08838d81a37 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FormatTest +void main() { + final FormatTest? instance = /* FormatTest(...) */ null; + // TODO add properties to the entity + + group(FormatTest, () { + // int integer + test('to test the property `integer`', () async { + // TODO + }); + + // int int32 + test('to test the property `int32`', () async { + // TODO + }); + + // int int64 + test('to test the property `int64`', () async { + // TODO + }); + + // num number + test('to test the property `number`', () async { + // TODO + }); + + // double float + test('to test the property `float`', () async { + // TODO + }); + + // double double_ + test('to test the property `double_`', () async { + // TODO + }); + + // double decimal + test('to test the property `decimal`', () async { + // TODO + }); + + // String string + test('to test the property `string`', () async { + // TODO + }); + + // String byte + test('to test the property `byte`', () async { + // TODO + }); + + // MultipartFile binary + test('to test the property `binary`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // A string that is a 10 digit number. Can have leading zeros. + // String patternWithDigits + test('to test the property `patternWithDigits`', () async { + // TODO + }); + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + // String patternWithDigitsAndDelimiter + test('to test the property `patternWithDigitsAndDelimiter`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart new file mode 100644 index 000000000000..809603237282 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAllOfDisc +void main() { + final FruitAllOfDisc? instance = /* FruitAllOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitAllOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart new file mode 100644 index 000000000000..4e1075e27963 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitAnyOfDisc +void main() { + final FruitAnyOfDisc? instance = /* FruitAnyOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitAnyOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart new file mode 100644 index 000000000000..bb27a8c3bb35 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitGrandparentDisc +void main() { + final FruitGrandparentDisc? instance = /* FruitGrandparentDisc(...) */ null; + // TODO add properties to the entity + + group(FruitGrandparentDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..1d0795670ac0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf1 +void main() { + final FruitInlineDiscOneOf1? instance = /* FruitInlineDiscOneOf1(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..29b97e1ac71a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDiscOneOf +void main() { + final FruitInlineDiscOneOf? instance = /* FruitInlineDiscOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart new file mode 100644 index 000000000000..e4d8b8c6abeb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineDisc +void main() { + final FruitInlineDisc? instance = /* FruitInlineDisc(...) */ null; + // TODO add properties to the entity + + group(FruitInlineDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart new file mode 100644 index 000000000000..5cb5a73f910e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf1 +void main() { + final FruitInlineInlineDiscOneOf1? instance = /* FruitInlineInlineDiscOneOf1(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOf1, () { + // int length + test('to test the property `length`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart new file mode 100644 index 000000000000..b00e9c4ba91e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOfOneOf +void main() { + final FruitInlineInlineDiscOneOfOneOf? instance = /* FruitInlineInlineDiscOneOfOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOfOneOf, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart new file mode 100644 index 000000000000..c55ffc399277 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDiscOneOf +void main() { + final FruitInlineInlineDiscOneOf? instance = /* FruitInlineInlineDiscOneOf(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDiscOneOf, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart new file mode 100644 index 000000000000..cc609633a2e1 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitInlineInlineDisc +void main() { + final FruitInlineInlineDisc? instance = /* FruitInlineInlineDisc(...) */ null; + // TODO add properties to the entity + + group(FruitInlineInlineDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart new file mode 100644 index 000000000000..1af3c64a1719 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitOneOfDisc +void main() { + final FruitOneOfDisc? instance = /* FruitOneOfDisc(...) */ null; + // TODO add properties to the entity + + group(FruitOneOfDisc, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart new file mode 100644 index 000000000000..d0f31e458df4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitReqDisc +void main() { + final FruitReqDisc? instance = /* FruitReqDisc(...) */ null; + // TODO add properties to the entity + + group(FruitReqDisc, () { + // int seeds + test('to test the property `seeds`', () async { + // TODO + }); + + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + // int length + test('to test the property `length`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart new file mode 100644 index 000000000000..8dfac99108f2 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Fruit +void main() { + final Fruit? instance = /* Fruit(...) */ null; + // TODO add properties to the entity + + group(Fruit, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // num count + test('to test the property `count`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart new file mode 100644 index 000000000000..24a25d03a935 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitType +void main() { + final FruitType? instance = /* FruitType(...) */ null; + // TODO add properties to the entity + + group(FruitType, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart new file mode 100644 index 000000000000..ae3da72d4eb9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for FruitVariant1 +void main() { + final FruitVariant1? instance = /* FruitVariant1(...) */ null; + // TODO add properties to the entity + + group(FruitVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart new file mode 100644 index 000000000000..10e23cf1ef9e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for GigaOneOf +void main() { + final GigaOneOf? instance = /* GigaOneOf(...) */ null; + // TODO add properties to the entity + + group(GigaOneOf, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart new file mode 100644 index 000000000000..6d508469e62b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for GrapeVariant1 +void main() { + final GrapeVariant1? instance = /* GrapeVariant1(...) */ null; + // TODO add properties to the entity + + group(GrapeVariant1, () { + // String color + test('to test the property `color`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart new file mode 100644 index 000000000000..d72429a31bb5 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HasOnlyReadOnly +void main() { + final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; + // TODO add properties to the entity + + group(HasOnlyReadOnly, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String foo + test('to test the property `foo`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart new file mode 100644 index 000000000000..b2b48337b76c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for HealthCheckResult +void main() { + final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; + // TODO add properties to the entity + + group(HealthCheckResult, () { + // String nullableMessage + test('to test the property `nullableMessage`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart new file mode 100644 index 000000000000..909415df7540 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MapTest +void main() { + final MapTest? instance = /* MapTest(...) */ null; + // TODO add properties to the entity + + group(MapTest, () { + // Map> mapMapOfString + test('to test the property `mapMapOfString`', () async { + // TODO + }); + + // Map mapOfEnumString + test('to test the property `mapOfEnumString`', () async { + // TODO + }); + + // Map directMap + test('to test the property `directMap`', () async { + // TODO + }); + + // Map indirectMap + test('to test the property `indirectMap`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart new file mode 100644 index 000000000000..0115f01ed6be --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for MixedPropertiesAndAdditionalPropertiesClass +void main() { + final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; + // TODO add properties to the entity + + group(MixedPropertiesAndAdditionalPropertiesClass, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // DateTime dateTime + test('to test the property `dateTime`', () async { + // TODO + }); + + // Map map + test('to test the property `map`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart new file mode 100644 index 000000000000..de8cf3037b6b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Model200Response +void main() { + final Model200Response? instance = /* Model200Response(...) */ null; + // TODO add properties to the entity + + group(Model200Response, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // String class_ + test('to test the property `class_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart new file mode 100644 index 000000000000..44faf62f15b4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelClient +void main() { + final ModelClient? instance = /* ModelClient(...) */ null; + // TODO add properties to the entity + + group(ModelClient, () { + // String client + test('to test the property `client`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart new file mode 100644 index 000000000000..03e5855bf004 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelEnumClass +void main() { + + group(ModelEnumClass, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart new file mode 100644 index 000000000000..8ea65f6ccb41 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart @@ -0,0 +1,17 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelFile +void main() { + final ModelFile? instance = /* ModelFile(...) */ null; + // TODO add properties to the entity + + group(ModelFile, () { + // Test capitalization + // String sourceURI + test('to test the property `sourceURI`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart new file mode 100644 index 000000000000..f748eee993ac --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelList +void main() { + final ModelList? instance = /* ModelList(...) */ null; + // TODO add properties to the entity + + group(ModelList, () { + // String n123list + test('to test the property `n123list`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart new file mode 100644 index 000000000000..cfc17807c151 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ModelReturn +void main() { + final ModelReturn? instance = /* ModelReturn(...) */ null; + // TODO add properties to the entity + + group(ModelReturn, () { + // int return_ + test('to test the property `return_`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart new file mode 100644 index 000000000000..4f3f7f633728 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Name +void main() { + final Name? instance = /* Name(...) */ null; + // TODO add properties to the entity + + group(Name, () { + // int name + test('to test the property `name`', () async { + // TODO + }); + + // int snakeCase + test('to test the property `snakeCase`', () async { + // TODO + }); + + // String property + test('to test the property `property`', () async { + // TODO + }); + + // int n123number + test('to test the property `n123number`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart new file mode 100644 index 000000000000..0ab76167983b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NullableClass +void main() { + final NullableClass? instance = /* NullableClass(...) */ null; + // TODO add properties to the entity + + group(NullableClass, () { + // int integerProp + test('to test the property `integerProp`', () async { + // TODO + }); + + // num numberProp + test('to test the property `numberProp`', () async { + // TODO + }); + + // bool booleanProp + test('to test the property `booleanProp`', () async { + // TODO + }); + + // String stringProp + test('to test the property `stringProp`', () async { + // TODO + }); + + // DateTime dateProp + test('to test the property `dateProp`', () async { + // TODO + }); + + // DateTime datetimeProp + test('to test the property `datetimeProp`', () async { + // TODO + }); + + // List arrayNullableProp + test('to test the property `arrayNullableProp`', () async { + // TODO + }); + + // List arrayAndItemsNullableProp + test('to test the property `arrayAndItemsNullableProp`', () async { + // TODO + }); + + // List arrayItemsNullable + test('to test the property `arrayItemsNullable`', () async { + // TODO + }); + + // Map objectNullableProp + test('to test the property `objectNullableProp`', () async { + // TODO + }); + + // Map objectAndItemsNullableProp + test('to test the property `objectAndItemsNullableProp`', () async { + // TODO + }); + + // Map objectItemsNullable + test('to test the property `objectItemsNullable`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart new file mode 100644 index 000000000000..12b19c59dfb7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for NumberOnly +void main() { + final NumberOnly? instance = /* NumberOnly(...) */ null; + // TODO add properties to the entity + + group(NumberOnly, () { + // num justNumber + test('to test the property `justNumber`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart new file mode 100644 index 000000000000..956b0b5e727c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ObjectWithDeprecatedFields +void main() { + final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; + // TODO add properties to the entity + + group(ObjectWithDeprecatedFields, () { + // String uuid + test('to test the property `uuid`', () async { + // TODO + }); + + // num id + test('to test the property `id`', () async { + // TODO + }); + + // DeprecatedObject deprecatedRef + test('to test the property `deprecatedRef`', () async { + // TODO + }); + + // List bars + test('to test the property `bars`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart new file mode 100644 index 000000000000..09b6866b4ab0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OneOfPrimitiveChild +void main() { + final OneOfPrimitiveChild? instance = /* OneOfPrimitiveChild(...) */ null; + // TODO add properties to the entity + + group(OneOfPrimitiveChild, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart new file mode 100644 index 000000000000..45b02097daed --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Order +void main() { + final Order? instance = /* Order(...) */ null; + // TODO add properties to the entity + + group(Order, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int petId + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart new file mode 100644 index 000000000000..a5f0172ba21c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterComposite +void main() { + final OuterComposite? instance = /* OuterComposite(...) */ null; + // TODO add properties to the entity + + group(OuterComposite, () { + // num myNumber + test('to test the property `myNumber`', () async { + // TODO + }); + + // String myString + test('to test the property `myString`', () async { + // TODO + }); + + // bool myBoolean + test('to test the property `myBoolean`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart new file mode 100644 index 000000000000..502c8326be58 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumDefaultValue +void main() { + + group(OuterEnumDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart new file mode 100644 index 000000000000..c535fe8ac354 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumIntegerDefaultValue +void main() { + + group(OuterEnumIntegerDefaultValue, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart new file mode 100644 index 000000000000..d945bc8c489d --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnumInteger +void main() { + + group(OuterEnumInteger, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart new file mode 100644 index 000000000000..8e11eb02fb8a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterEnum +void main() { + + group(OuterEnum, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart new file mode 100644 index 000000000000..3d72c6188e17 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for OuterObjectWithEnumProperty +void main() { + final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; + // TODO add properties to the entity + + group(OuterObjectWithEnumProperty, () { + // OuterEnumInteger value + test('to test the property `value`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart new file mode 100644 index 000000000000..e2f1d26ee3e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Parent +void main() { + final Parent? instance = /* Parent(...) */ null; + // TODO add properties to the entity + + group(Parent, () { + // String fruitType + test('to test the property `fruitType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart new file mode 100644 index 000000000000..c944fa0db8e7 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pasta +void main() { + final Pasta? instance = /* Pasta(...) */ null; + // TODO add properties to the entity + + group(Pasta, () { + // String vendor + test('to test the property `vendor`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart new file mode 100644 index 000000000000..85a28bcfbe53 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart @@ -0,0 +1,92 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for PetApi +void main() { + final instance = Openapi().getPetApi(); + + group(PetApi, () { + // Add a new pet to the store + // + // + // + //Future addPet(Pet pet) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + // + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(Set tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + // + // + //Future updatePet(Pet pet) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + // + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + // + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + // uploads an image (required) + // + // + // + //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async + test('test uploadFileWithRequiredFile', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart new file mode 100644 index 000000000000..20b5e3e06735 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pet +void main() { + final Pet? instance = /* Pet(...) */ null; + // TODO add properties to the entity + + group(Pet, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Category category + test('to test the property `category`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Set photoUrls + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart new file mode 100644 index 000000000000..d013ccc06315 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for PizzaSpeziale +void main() { + final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; + // TODO add properties to the entity + + group(PizzaSpeziale, () { + // String toppings + test('to test the property `toppings`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart new file mode 100644 index 000000000000..f23c37b80e8b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Pizza +void main() { + final Pizza? instance = /* Pizza(...) */ null; + // TODO add properties to the entity + + group(Pizza, () { + // num pizzaSize + test('to test the property `pizzaSize`', () async { + // TODO + }); + + // Hyperlink reference + // String href + test('to test the property `href`', () async { + // TODO + }); + + // unique identifier + // String id + test('to test the property `id`', () async { + // TODO + }); + + // A URI to a JSON-Schema file that defines additional attributes and relationships + // String atSchemaLocation + test('to test the property `atSchemaLocation`', () async { + // TODO + }); + + // When sub-classing, this defines the super-class + // String atBaseType + test('to test the property `atBaseType`', () async { + // TODO + }); + + // When sub-classing, this defines the sub-class Extensible name + // String atType + test('to test the property `atType`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart new file mode 100644 index 000000000000..bcefd75befb6 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for ReadOnlyFirst +void main() { + final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; + // TODO add properties to the entity + + group(ReadOnlyFirst, () { + // String bar + test('to test the property `bar`', () async { + // TODO + }); + + // String baz + test('to test the property `baz`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart new file mode 100644 index 000000000000..5cd85add393e --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SingleRefType +void main() { + + group(SingleRefType, () { + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart new file mode 100644 index 000000000000..23b58324ef99 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialModelName +void main() { + final SpecialModelName? instance = /* SpecialModelName(...) */ null; + // TODO add properties to the entity + + group(SpecialModelName, () { + // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart new file mode 100644 index 000000000000..08f7f738043b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart @@ -0,0 +1,47 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for StoreApi +void main() { + final instance = Openapi().getStoreApi(); + + group(StoreApi, () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + // + // + //Future placeOrder(Order order) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart new file mode 100644 index 000000000000..ffe49b3179c3 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for Tag +void main() { + final Tag? instance = /* Tag(...) */ null; + // TODO add properties to the entity + + group(Tag, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart new file mode 100644 index 000000000000..4bf28b67623b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart @@ -0,0 +1,83 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + + +/// tests for UserApi +void main() { + final instance = Openapi().getUserApi(); + + group(UserApi, () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User user) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithArrayInput(List user) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + // + // + //Future createUsersWithListInput(List user) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + // + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + // + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + // + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User user) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart new file mode 100644 index 000000000000..847b14196b93 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart @@ -0,0 +1,52 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for User +void main() { + final User? instance = /* User(...) */ null; + // TODO add properties to the entity + + group(User, () { + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String phone + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus + test('to test the property `userStatus`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES index 18008f8208c3..58cb7a2275e9 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES @@ -236,112 +236,3 @@ lib/src/repository_base.dart lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml -test/additional_properties_class_test.dart -test/addressable_test.dart -test/all_of_with_single_ref_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/apple_all_of_disc_test.dart -test/apple_grandparent_disc_test.dart -test/apple_one_of_disc_test.dart -test/apple_req_disc_test.dart -test/apple_test.dart -test/apple_variant1_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/banana_all_of_disc_test.dart -test/banana_grandparent_disc_test.dart -test/banana_one_of_disc_test.dart -test/banana_req_disc_test.dart -test/banana_test.dart -test/bar_api_test.dart -test/bar_create_test.dart -test/bar_ref_or_value_test.dart -test/bar_ref_test.dart -test/bar_test.dart -test/capitalization_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/composed_disc_missing_from_properties_test.dart -test/composed_disc_optional_type_correct_test.dart -test/composed_disc_optional_type_inconsistent_test.dart -test/composed_disc_optional_type_incorrect_test.dart -test/composed_disc_required_inconsistent_test.dart -test/composed_disc_type_inconsistent_test.dart -test/composed_disc_type_incorrect_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/disc_missing_from_properties_test.dart -test/disc_optional_type_correct_test.dart -test/disc_optional_type_incorrect_test.dart -test/disc_type_incorrect_test.dart -test/dog_test.dart -test/entity_ref_test.dart -test/entity_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/extensible_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_api_test.dart -test/foo_basic_get_default_response_test.dart -test/foo_ref_or_value_test.dart -test/foo_ref_test.dart -test/foo_test.dart -test/format_test_test.dart -test/fruit_all_of_disc_test.dart -test/fruit_any_of_disc_test.dart -test/fruit_grandparent_disc_test.dart -test/fruit_inline_disc_one_of1_test.dart -test/fruit_inline_disc_one_of_test.dart -test/fruit_inline_disc_test.dart -test/fruit_inline_inline_disc_one_of1_test.dart -test/fruit_inline_inline_disc_one_of_one_of_test.dart -test/fruit_inline_inline_disc_one_of_test.dart -test/fruit_inline_inline_disc_test.dart -test/fruit_one_of_disc_test.dart -test/fruit_req_disc_test.dart -test/fruit_test.dart -test/fruit_type_test.dart -test/fruit_variant1_test.dart -test/giga_one_of_test.dart -test/grape_variant1_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/one_of_primitive_child_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/parent_test.dart -test/pasta_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/pizza_speziale_test.dart -test/pizza_test.dart -test/read_only_first_test.dart -test/single_ref_type_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md b/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md index 3ddbcd3b89f8..fe2ee6a43a13 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md @@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen +- Build package: org.openapitools.codegen.languages.DartNextClientCodegen ## Requirements diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart index 1865b320d1b4..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart @@ -2,6 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // + export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart index 28ca0f8e189c..37e8fcbda65d 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart @@ -15,6 +15,7 @@ import 'package:openapi/src/model/model_client.dart'; part 'another_fake_api.g.dart'; class AnotherFakeApi { + final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -34,7 +35,7 @@ class AnotherFakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -42,12 +43,18 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.call123testSpecialTags( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -56,16 +63,19 @@ class AnotherFakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ModelClient)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -87,9 +97,10 @@ class AnotherFakeApi { extra: _response.extra, ); } -} +} class AnotherFakeApiRaw { + final Dio _dio; const AnotherFakeApiRaw(this._dio); @@ -108,7 +119,7 @@ class AnotherFakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ Object? body, String? requestContentType, String? acceptContentType, @@ -145,4 +156,8 @@ class AnotherFakeApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart index 340e65c4594b..b70423894fba 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart @@ -16,16 +16,17 @@ import 'package:openapi/src/model/bar_create.dart'; part 'bar_api.g.dart'; class BarApi { + final BarApiRaw rawApi; final SerializationRepositoryBase _repository; const BarApi(this.rawApi, this._repository); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -35,7 +36,7 @@ class BarApi { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioException] if API call or serialization fails - Future> createBar({ + Future> createBar({ required BarCreate barCreate, CancelToken? cancelToken, Map? headers, @@ -43,12 +44,18 @@ class BarApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = - encodeBodyParameter(_repository, barCreate, const TypeInfo(BarCreate)); + _bodyData = encodeBodyParameter(_repository, barCreate, const TypeInfo( + + + BarCreate + ) + +); final _response = await rawApi.createBar( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -57,15 +64,19 @@ class BarApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Bar? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Bar)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Bar + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -87,18 +98,19 @@ class BarApi { extra: _response.extra, ); } -} +} class BarApiRaw { + final Dio _dio; const BarApiRaw(this._dio); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -108,7 +120,7 @@ class BarApiRaw { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioException] if API call or serialization fails - Future> createBar({ + Future> createBar({ Object? body, String? requestContentType, String? acceptContentType, @@ -145,4 +157,8 @@ class BarApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart index 7c9a637f1329..923c671c1f3c 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart @@ -20,13 +20,14 @@ import 'package:openapi/src/model/giga_one_of.dart'; part 'default_api.g.dart'; class DefaultApi { + final DefaultApiRaw rawApi; final SerializationRepositoryBase _repository; const DefaultApi(this.rawApi, this._repository); /// fooBasicGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -38,31 +39,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data /// Throws [DioException] if API call or serialization fails - Future> fooBasicGet({ + Future> fooBasicGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.fooBasicGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooBasicGetDefaultResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, - const TypeInfo(FooBasicGetDefaultResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FooBasicGetDefaultResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -86,7 +93,7 @@ class DefaultApi { } /// list - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -98,30 +105,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data /// Throws [DioException] if API call or serialization fails - Future> list({ + Future> list({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.list( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); GigaOneOf? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(GigaOneOf)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + GigaOneOf + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -145,7 +159,7 @@ class DefaultApi { } /// oneofGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -157,30 +171,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [Fruit] as data /// Throws [DioException] if API call or serialization fails - Future> oneofGet({ + Future> oneofGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.oneofGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Fruit? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Fruit)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Fruit + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -204,10 +225,10 @@ class DefaultApi { } /// test - /// + /// /// /// Parameters: - /// * [body] + /// * [body] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -217,20 +238,26 @@ class DefaultApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> test({ - JsonObject? body, + Future> test({ + JsonObject? body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, body, const TypeInfo.nullable(JsonObject)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + + + JsonObject + ) + +); final _response = await rawApi.test( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -239,13 +266,13 @@ class DefaultApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// variant1Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -257,31 +284,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data /// Throws [DioException] if API call or serialization fails - Future> variant1Get({ + Future> variant1Get({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.variant1Get( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FruitVariant1? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FruitVariant1)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FruitVariant1 + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -305,7 +338,7 @@ class DefaultApi { } /// variant2Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -317,31 +350,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data /// Throws [DioException] if API call or serialization fails - Future> variant2Get({ + Future> variant2Get({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.variant2Get( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FruitAllOfDisc? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FruitAllOfDisc)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FruitAllOfDisc + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -363,15 +402,16 @@ class DefaultApi { extra: _response.extra, ); } -} +} class DefaultApiRaw { + final Dio _dio; const DefaultApiRaw(this._dio); /// fooBasicGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -383,7 +423,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data /// Throws [DioException] if API call or serialization fails - Future> fooBasicGet({ + Future> fooBasicGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -422,7 +462,7 @@ class DefaultApiRaw { } /// list - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -434,7 +474,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data /// Throws [DioException] if API call or serialization fails - Future> list({ + Future> list({ Object? body, String? requestContentType, String? acceptContentType, @@ -473,7 +513,7 @@ class DefaultApiRaw { } /// oneofGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -485,7 +525,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [Fruit] as data /// Throws [DioException] if API call or serialization fails - Future> oneofGet({ + Future> oneofGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -524,10 +564,10 @@ class DefaultApiRaw { } /// test - /// + /// /// /// Parameters: - /// * [body] + /// * [body] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -537,7 +577,7 @@ class DefaultApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> test({ + Future> test({ Object? body, String? requestContentType, String? acceptContentType, @@ -576,7 +616,7 @@ class DefaultApiRaw { } /// variant1Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -588,7 +628,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data /// Throws [DioException] if API call or serialization fails - Future> variant1Get({ + Future> variant1Get({ Object? body, String? requestContentType, String? acceptContentType, @@ -627,7 +667,7 @@ class DefaultApiRaw { } /// variant2Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -639,7 +679,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data /// Throws [DioException] if API call or serialization fails - Future> variant2Get({ + Future> variant2Get({ Object? body, String? requestContentType, String? acceptContentType, @@ -676,4 +716,8 @@ class DefaultApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart index b915fdcde47a..821054b216ce 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart @@ -25,13 +25,14 @@ import 'package:openapi/src/model/user.dart'; part 'fake_api.g.dart'; class FakeApi { + final FakeApiRaw rawApi; final SerializationRepositoryBase _repository; const FakeApi(this.rawApi, this._repository); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -43,31 +44,37 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioException] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.fakeHealthGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); HealthCheckResult? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(HealthCheckResult)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + HealthCheckResult + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -91,7 +98,7 @@ class FakeApi { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -106,7 +113,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ required Pet pet, required String query1, required String header1, @@ -116,18 +123,32 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.fakeHttpSignatureTest( - query1: encodeQueryParameter( - _repository, - query1, - const TypeInfo(String), - ), - header1: - encodeStringParameter(_repository, header1, const TypeInfo(String)), + + query1: encodeQueryParameter(_repository, query1, const TypeInfo( + + + String + ) + +, ), + header1: encodeStringParameter(_repository, header1, const TypeInfo( + + + String + ) + +), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -136,7 +157,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -155,7 +176,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ required bool body, CancelToken? cancelToken, Map? headers, @@ -163,11 +184,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(bool)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + bool + ) + +); final _response = await rawApi.fakeOuterBooleanSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -176,15 +204,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); bool? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(bool)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + bool + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -221,7 +253,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ required OuterComposite outerComposite, CancelToken? cancelToken, Map? headers, @@ -229,12 +261,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, outerComposite, const TypeInfo(OuterComposite)); + _bodyData = encodeBodyParameter(_repository, outerComposite, const TypeInfo( + + + OuterComposite + ) + +); final _response = await rawApi.fakeOuterCompositeSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -243,16 +281,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterComposite? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(OuterComposite)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + OuterComposite + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -289,7 +330,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ required num body, CancelToken? cancelToken, Map? headers, @@ -297,11 +338,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(num)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + num + ) + +); final _response = await rawApi.fakeOuterNumberSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -310,15 +358,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); num? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(num)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + num + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -355,7 +407,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ required String body, CancelToken? cancelToken, Map? headers, @@ -363,11 +415,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo(String)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + + + String + ) + +); final _response = await rawApi.fakeOuterStringSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -376,15 +435,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(String)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + String + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -421,8 +484,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioException] if API call or serialization fails - Future> - fakePropertyEnumIntegerSerialize({ + Future> fakePropertyEnumIntegerSerialize({ required OuterObjectWithEnumProperty outerObjectWithEnumProperty, CancelToken? cancelToken, Map? headers, @@ -430,12 +492,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, outerObjectWithEnumProperty, - const TypeInfo(OuterObjectWithEnumProperty)); + _bodyData = encodeBodyParameter(_repository, outerObjectWithEnumProperty, const TypeInfo( + + + OuterObjectWithEnumProperty + ) + +); final _response = await rawApi.fakePropertyEnumIntegerSerialize( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -444,16 +512,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); OuterObjectWithEnumProperty? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, - const TypeInfo(OuterObjectWithEnumProperty)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + OuterObjectWithEnumProperty + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -490,7 +561,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ required MultipartFile? body, CancelToken? cancelToken, Map? headers, @@ -498,12 +569,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, body, const TypeInfo.nullable(MultipartFile)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + + + MultipartFile + ) + +); final _response = await rawApi.testBodyWithBinary( + body: _bodyData, requestContentType: 'image/png', cancelToken: cancelToken, @@ -512,7 +589,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -521,7 +598,7 @@ class FakeApi { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -531,7 +608,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ required FileSchemaTestClass fileSchemaTestClass, CancelToken? cancelToken, Map? headers, @@ -539,12 +616,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, fileSchemaTestClass, const TypeInfo(FileSchemaTestClass)); + _bodyData = encodeBodyParameter(_repository, fileSchemaTestClass, const TypeInfo( + + + FileSchemaTestClass + ) + +); final _response = await rawApi.testBodyWithFileSchema( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -553,17 +636,17 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -573,7 +656,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required String query, required User user, CancelToken? cancelToken, @@ -582,16 +665,25 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.testBodyWithQueryParams( - query: encodeQueryParameter( - _repository, - query, - const TypeInfo(String), - ), + + query: encodeQueryParameter(_repository, query, const TypeInfo( + + + String + ) + +, ), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -600,7 +692,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -619,7 +711,7 @@ class FakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -627,12 +719,18 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.testClientModel( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -641,16 +739,19 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ModelClient)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -673,8 +774,8 @@ class FakeApi { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -700,7 +801,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ required num number, required double double_, required String patternWithoutDelimiter, @@ -721,46 +822,112 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (integer != null) - r'integer': - encodeFormParameter(_repository, integer, const TypeInfo(int)), - if (int32 != null) - r'int32': encodeFormParameter(_repository, int32, const TypeInfo(int)), - if (int64 != null) - r'int64': encodeFormParameter(_repository, int64, const TypeInfo(int)), - r'number': encodeFormParameter(_repository, number, const TypeInfo(num)), - if (float != null) - r'float': - encodeFormParameter(_repository, float, const TypeInfo(double)), - r'double': - encodeFormParameter(_repository, double_, const TypeInfo(double)), - if (string != null) - r'string': - encodeFormParameter(_repository, string, const TypeInfo(String)), - r'pattern_without_delimiter': encodeFormParameter( - _repository, patternWithoutDelimiter, const TypeInfo(String)), - r'byte': encodeFormParameter(_repository, byte, const TypeInfo(String)), - if (binary != null) - r'binary': - encodeFormParameter(_repository, binary, const TypeInfo(Uint8List)), - if (date != null) - r'date': encodeFormParameter(_repository, date, const TypeInfo(Date)), - if (dateTime != null) - r'dateTime': encodeFormParameter( - _repository, dateTime, const TypeInfo(DateTime)), - if (password != null) - r'password': - encodeFormParameter(_repository, password, const TypeInfo(String)), - if (callback != null) - r'callback': - encodeFormParameter(_repository, callback, const TypeInfo(String)), + if (integer != null) r'integer': encodeFormParameter(_repository, integer, const TypeInfo( + + + int + ) + +), + if (int32 != null) r'int32': encodeFormParameter(_repository, int32, const TypeInfo( + + + int + ) + +), + if (int64 != null) r'int64': encodeFormParameter(_repository, int64, const TypeInfo( + + + int + ) + +), + r'number': encodeFormParameter(_repository, number, const TypeInfo( + + + num + ) + +), + if (float != null) r'float': encodeFormParameter(_repository, float, const TypeInfo( + + + double + ) + +), + r'double': encodeFormParameter(_repository, double_, const TypeInfo( + + + double + ) + +), + if (string != null) r'string': encodeFormParameter(_repository, string, const TypeInfo( + + + String + ) + +), + r'pattern_without_delimiter': encodeFormParameter(_repository, patternWithoutDelimiter, const TypeInfo( + + + String + ) + +), + r'byte': encodeFormParameter(_repository, byte, const TypeInfo( + + + String + ) + +), + if (binary != null) r'binary': encodeFormParameter(_repository, binary, const TypeInfo( + + + Uint8List + ) + +), + if (date != null) r'date': encodeFormParameter(_repository, date, const TypeInfo( + + + Date + ) + +), + if (dateTime != null) r'dateTime': encodeFormParameter(_repository, dateTime, const TypeInfo( + + + DateTime + ) + +), + if (password != null) r'password': encodeFormParameter(_repository, password, const TypeInfo( + + + String + ) + +), + if (callback != null) r'callback': encodeFormParameter(_repository, callback, const TypeInfo( + + + String + ) + +), }; _bodyData = _bodyMap; final _response = await rawApi.testEndpointParameters( + body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -769,7 +936,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -779,14 +946,14 @@ class FakeApi { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') - /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -796,78 +963,117 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ required BuiltList enumHeaderStringArray, - EnumHeaderStringEnum enumHeaderString = EnumHeaderStringEnum.efg, + EnumHeaderStringEnum enumHeaderString = r'-efg', required BuiltList enumQueryStringArray, - EnumQueryStringEnum enumQueryString = EnumQueryStringEnum.efg, + EnumQueryStringEnum enumQueryString = r'-efg', required EnumQueryIntegerEnum enumQueryInteger, required EnumQueryDoubleEnum enumQueryDouble, required BuiltList enumQueryModelArray, - BuiltList? enumFormStringArray = [ r'$' ], - EnumFormStringEnum enumFormString = EnumFormStringEnum.efg, + BuiltList enumFormStringArray = r'$', + EnumFormStringEnum enumFormString = r'-efg', CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (enumFormStringArray != null) - r'enum_form_string_array': encodeFormParameter( - _repository, - enumFormStringArray, - const TypeInfo(BuiltList, [ - const TypeInfo(InnerEnum), - ])), - if (enumFormString != null) - r'enum_form_string': encodeFormParameter( - _repository, enumFormString, const TypeInfo(EnumFormStringEnum)), + if (enumFormStringArray != null) r'enum_form_string_array': encodeFormParameter(_repository, enumFormStringArray, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + InnerEnum + + ) + +, + ]) + +), + if (enumFormString != null) r'enum_form_string': encodeFormParameter(_repository, enumFormString, const TypeInfo( + + EnumFormStringEnum + + ) + +), }; _bodyData = _bodyMap; final _response = await rawApi.testEnumParameters( - enumHeaderStringArray: encodeStringParameter( - _repository, - enumHeaderStringArray, - const TypeInfo(BuiltList, [ - const TypeInfo(EnumHeaderStringArrayEnum), - ])), - enumHeaderString: encodeStringParameter( - _repository, enumHeaderString, const TypeInfo(EnumHeaderStringEnum)), - enumQueryStringArray: encodeQueryParameter( - _repository, - enumQueryStringArray, - const TypeInfo(BuiltList, [ - const TypeInfo(EnumQueryStringArrayEnum), - ]), - format: ListFormat.multi, - ), - enumQueryString: encodeQueryParameter( - _repository, - enumQueryString, - const TypeInfo(EnumQueryStringEnum), - ), - enumQueryInteger: encodeQueryParameter( - _repository, - enumQueryInteger, - const TypeInfo(EnumQueryIntegerEnum), - ), - enumQueryDouble: encodeQueryParameter( - _repository, - enumQueryDouble, - const TypeInfo(EnumQueryDoubleEnum), - ), - enumQueryModelArray: encodeQueryParameter( - _repository, - enumQueryModelArray, - const TypeInfo(BuiltList, [ - const TypeInfo(ModelEnumClass), - ]), - format: ListFormat.multi, - ), + + enumHeaderStringArray: encodeStringParameter(_repository, enumHeaderStringArray, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + EnumHeaderStringArrayEnum + + ) + +, + ]) + +), + enumHeaderString: encodeStringParameter(_repository, enumHeaderString, const TypeInfo( + + EnumHeaderStringEnum + + ) + +), + enumQueryStringArray: encodeQueryParameter(_repository, enumQueryStringArray, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + EnumQueryStringArrayEnum + + ) + +, + ]) + +, format: ListFormat.multi,), + enumQueryString: encodeQueryParameter(_repository, enumQueryString, const TypeInfo( + + EnumQueryStringEnum + + ) + +, ), + enumQueryInteger: encodeQueryParameter(_repository, enumQueryInteger, const TypeInfo( + + EnumQueryIntegerEnum + + ) + +, ), + enumQueryDouble: encodeQueryParameter(_repository, enumQueryDouble, const TypeInfo( + + EnumQueryDoubleEnum + + ) + +, ), + enumQueryModelArray: encodeQueryParameter(_repository, enumQueryModelArray, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + ModelEnumClass + + ) + +, + ]) + +, format: ListFormat.multi,), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -876,7 +1082,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -900,7 +1106,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required int requiredStringGroup, required bool requiredBooleanGroup, required int requiredInt64Group, @@ -913,45 +1119,66 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.testGroupParameters( - requiredStringGroup: encodeQueryParameter( - _repository, - requiredStringGroup, - const TypeInfo(int), - ), - requiredBooleanGroup: encodeStringParameter( - _repository, requiredBooleanGroup, const TypeInfo(bool)), - requiredInt64Group: encodeQueryParameter( - _repository, - requiredInt64Group, - const TypeInfo(int), - ), - stringGroup: encodeQueryParameter( - _repository, - stringGroup, - const TypeInfo(int), - ), - booleanGroup: encodeStringParameter( - _repository, booleanGroup, const TypeInfo(bool)), - int64Group: encodeQueryParameter( - _repository, - int64Group, - const TypeInfo(int), - ), + + requiredStringGroup: encodeQueryParameter(_repository, requiredStringGroup, const TypeInfo( + + + int + ) + +, ), + requiredBooleanGroup: encodeStringParameter(_repository, requiredBooleanGroup, const TypeInfo( + + + bool + ) + +), + requiredInt64Group: encodeQueryParameter(_repository, requiredInt64Group, const TypeInfo( + + + int + ) + +, ), + stringGroup: encodeQueryParameter(_repository, stringGroup, const TypeInfo( + + + int + ) + +, ), + booleanGroup: encodeStringParameter(_repository, booleanGroup, const TypeInfo( + + + bool + ) + +), + int64Group: encodeQueryParameter(_repository, int64Group, const TypeInfo( + + + int + ) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -964,7 +1191,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ required BuiltMap requestBody, CancelToken? cancelToken, Map? headers, @@ -972,17 +1199,24 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, - requestBody, - const TypeInfo(BuiltMap, [ - TypeInfo(String), - const TypeInfo(String), - ])); + _bodyData = encodeBodyParameter(_repository, requestBody, const TypeInfo( + BuiltMap, [ + TypeInfo(String), + const TypeInfo( + + String + + ) + +, + ]) + +); final _response = await rawApi.testInlineAdditionalProperties( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -991,13 +1225,13 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -1011,7 +1245,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ required String param, required String param2, CancelToken? cancelToken, @@ -1020,16 +1254,28 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - r'param': encodeFormParameter(_repository, param, const TypeInfo(String)), - r'param2': - encodeFormParameter(_repository, param2, const TypeInfo(String)), + r'param': encodeFormParameter(_repository, param, const TypeInfo( + + + String + ) + +), + r'param2': encodeFormParameter(_repository, param2, const TypeInfo( + + + String + ) + +), }; _bodyData = _bodyMap; final _response = await rawApi.testJsonFormData( + body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -1038,7 +1284,7 @@ class FakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -1047,13 +1293,13 @@ class FakeApi { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1063,7 +1309,7 @@ class FakeApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required BuiltList pipe, required BuiltList ioutil, required BuiltList http, @@ -1077,80 +1323,116 @@ class FakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.testQueryParameterCollectionFormat( - pipe: encodeQueryParameter( - _repository, - pipe, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.pipes, - ), - ioutil: encodeQueryParameter( - _repository, - ioutil, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), - http: encodeQueryParameter( - _repository, - http, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.ssv, - ), - url: encodeQueryParameter( - _repository, - url, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), - context: encodeQueryParameter( - _repository, - context, - const TypeInfo(BuiltList, [ - const TypeInfo(String), - ]), - format: ListFormat.multi, - ), - allowEmpty: encodeQueryParameter( - _repository, - allowEmpty, - const TypeInfo(String), - ), - language: encodeQueryParameter( - _repository, - language, - const TypeInfo(BuiltMap, [ - TypeInfo(String), - const TypeInfo(String), - ]), - ), + + pipe: encodeQueryParameter(_repository, pipe, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.pipes,), + ioutil: encodeQueryParameter(_repository, ioutil, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + http: encodeQueryParameter(_repository, http, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.ssv,), + url: encodeQueryParameter(_repository, url, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + context: encodeQueryParameter(_repository, context, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.multi,), + allowEmpty: encodeQueryParameter(_repository, allowEmpty, const TypeInfo( + + + String + ) + +, ), + language: encodeQueryParameter(_repository, language, const TypeInfo( + BuiltMap, [ + TypeInfo(String), + const TypeInfo( + + String + + ) + +, + ]) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } -} +} class FakeApiRaw { + final Dio _dio; const FakeApiRaw(this._dio); /// Health check endpoint - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -1162,7 +1444,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data /// Throws [DioException] if API call or serialization fails - Future> fakeHealthGet({ + Future> fakeHealthGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -1201,7 +1483,7 @@ class FakeApiRaw { } /// test http signature authentication - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -1216,7 +1498,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> fakeHttpSignatureTest({ + Future> fakeHttpSignatureTest({ Object? query1, String? header1, Object? body, @@ -1282,7 +1564,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [bool] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ + Future> fakeOuterBooleanSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1334,7 +1616,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterComposite] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ + Future> fakeOuterCompositeSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1386,7 +1668,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [num] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterNumberSerialize({ + Future> fakeOuterNumberSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1438,7 +1720,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> fakeOuterStringSerialize({ + Future> fakeOuterStringSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1490,7 +1772,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data /// Throws [DioException] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ + Future> fakePropertyEnumIntegerSerialize({ Object? body, String? requestContentType, String? acceptContentType, @@ -1542,7 +1824,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithBinary({ + Future> testBodyWithBinary({ Object? body, String? requestContentType, String? acceptContentType, @@ -1584,7 +1866,7 @@ class FakeApiRaw { /// For this test, the body for this request must reference a schema named `File`. /// /// Parameters: - /// * [fileSchemaTestClass] + /// * [fileSchemaTestClass] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1594,7 +1876,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithFileSchema({ + Future> testBodyWithFileSchema({ Object? body, String? requestContentType, String? acceptContentType, @@ -1633,11 +1915,11 @@ class FakeApiRaw { } /// testBodyWithQueryParams - /// + /// /// /// Parameters: - /// * [query] - /// * [user] + /// * [query] + /// * [user] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1647,7 +1929,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testBodyWithQueryParams({ + Future> testBodyWithQueryParams({ required Object query, Object? body, String? requestContentType, @@ -1705,7 +1987,7 @@ class FakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClientModel({ + Future> testClientModel({ Object? body, String? requestContentType, String? acceptContentType, @@ -1743,8 +2025,8 @@ class FakeApiRaw { ); } - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Parameters: /// * [number] - None @@ -1770,7 +2052,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testEndpointParameters({ + Future> testEndpointParameters({ Object? body, String? requestContentType, String? acceptContentType, @@ -1819,14 +2101,14 @@ class FakeApiRaw { /// /// Parameters: /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') + /// * [enumHeaderString] - Header parameter enum test (string) (Default: r'-efg') /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') + /// * [enumQueryString] - Query parameter enum test (string) (Default: r'-efg') /// * [enumQueryInteger] - Query parameter enum test (double) /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') - /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') + /// * [enumQueryModelArray] + /// * [enumFormStringArray] - Form parameter enum test (string array) (Default: r'$') + /// * [enumFormString] - Form parameter enum test (string) (Default: r'-efg') /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -1836,7 +2118,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testEnumParameters({ + Future> testEnumParameters({ String? enumHeaderStringArray, String? enumHeaderString, Object? enumQueryStringArray, @@ -1859,8 +2141,7 @@ class FakeApiRaw { final _options = Options( method: r'GET', headers: { - if (enumHeaderStringArray != null) - r'enum_header_string_array': enumHeaderStringArray, + if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, if (enumHeaderString != null) r'enum_header_string': enumHeaderString, if (acceptContentType != null) 'Accept': acceptContentType, ...?headers, @@ -1875,13 +2156,11 @@ class FakeApiRaw { ); final _queryParameters = { - if (enumQueryStringArray != null) - r'enum_query_string_array': enumQueryStringArray, + if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, if (enumQueryString != null) r'enum_query_string': enumQueryString, if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) - r'enum_query_model_array': enumQueryModelArray, + if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, }; return await _dio.request( @@ -1914,7 +2193,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testGroupParameters({ + Future> testGroupParameters({ required Object requiredStringGroup, required String requiredBooleanGroup, required Object requiredInt64Group, @@ -1975,7 +2254,7 @@ class FakeApiRaw { } /// test inline additionalProperties - /// + /// /// /// Parameters: /// * [requestBody] - request body @@ -1988,7 +2267,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testInlineAdditionalProperties({ + Future> testInlineAdditionalProperties({ Object? body, String? requestContentType, String? acceptContentType, @@ -2027,7 +2306,7 @@ class FakeApiRaw { } /// test json serialization of form data - /// + /// /// /// Parameters: /// * [param] - field1 @@ -2041,7 +2320,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testJsonFormData({ + Future> testJsonFormData({ Object? body, String? requestContentType, String? acceptContentType, @@ -2083,13 +2362,13 @@ class FakeApiRaw { /// To test the collection format in query parameters /// /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] + /// * [pipe] + /// * [ioutil] + /// * [http] + /// * [url] + /// * [context] + /// * [allowEmpty] + /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -2099,7 +2378,7 @@ class FakeApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ + Future> testQueryParameterCollectionFormat({ required Object pipe, required Object ioutil, required Object http, @@ -2154,199 +2433,208 @@ class FakeApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + class EnumHeaderStringArrayEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'>') - static const EnumHeaderStringArrayEnum greaterThan = - _$enumHeaderStringArrayEnum_greaterThan; + static const EnumHeaderStringArrayEnum greaterThan = _$enumHeaderStringArrayEnum_greaterThan; @BuiltValueEnumConst(wireName: r'$') - static const EnumHeaderStringArrayEnum dollar = - _$enumHeaderStringArrayEnum_dollar; + static const EnumHeaderStringArrayEnum dollar = _$enumHeaderStringArrayEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumHeaderStringArrayEnum unknownDefaultOpenApi = - _$enumHeaderStringArrayEnum_unknownDefaultOpenApi; + static const EnumHeaderStringArrayEnum unknownDefaultOpenApi = _$enumHeaderStringArrayEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumHeaderStringArrayEnumSerializer; + static Serializer get serializer => _$enumHeaderStringArrayEnumSerializer; - const EnumHeaderStringArrayEnum._(String name) : super(name); + const EnumHeaderStringArrayEnum._(String name): super(name); - static BuiltSet get values => - _$enumHeaderStringArrayEnumValues; - static EnumHeaderStringArrayEnum valueOf(String name) => - _$enumHeaderStringArrayEnumValueOf(name); + static BuiltSet get values => _$enumHeaderStringArrayEnumValues; + static EnumHeaderStringArrayEnum valueOf(String name) => _$enumHeaderStringArrayEnumValueOf(name); } + class EnumHeaderStringEnum extends EnumClass { + /// Header parameter enum test (string) @BuiltValueEnumConst(wireName: r'_abc') static const EnumHeaderStringEnum abc = _$enumHeaderStringEnum_abc; - /// Header parameter enum test (string) @BuiltValueEnumConst(wireName: r'-efg') static const EnumHeaderStringEnum efg = _$enumHeaderStringEnum_efg; - /// Header parameter enum test (string) @BuiltValueEnumConst(wireName: r'(xyz)') - static const EnumHeaderStringEnum leftParenthesisXyzRightParenthesis = - _$enumHeaderStringEnum_leftParenthesisXyzRightParenthesis; - + static const EnumHeaderStringEnum leftParenthesisXyzRightParenthesis = _$enumHeaderStringEnum_leftParenthesisXyzRightParenthesis; /// Header parameter enum test (string) @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumHeaderStringEnum unknownDefaultOpenApi = - _$enumHeaderStringEnum_unknownDefaultOpenApi; + static const EnumHeaderStringEnum unknownDefaultOpenApi = _$enumHeaderStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumHeaderStringEnumSerializer; + static Serializer get serializer => _$enumHeaderStringEnumSerializer; - const EnumHeaderStringEnum._(String name) : super(name); + const EnumHeaderStringEnum._(String name): super(name); - static BuiltSet get values => - _$enumHeaderStringEnumValues; - static EnumHeaderStringEnum valueOf(String name) => - _$enumHeaderStringEnumValueOf(name); + static BuiltSet get values => _$enumHeaderStringEnumValues; + static EnumHeaderStringEnum valueOf(String name) => _$enumHeaderStringEnumValueOf(name); } class EnumQueryStringArrayEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'>') - static const EnumQueryStringArrayEnum greaterThan = - _$enumQueryStringArrayEnum_greaterThan; + static const EnumQueryStringArrayEnum greaterThan = _$enumQueryStringArrayEnum_greaterThan; @BuiltValueEnumConst(wireName: r'$') - static const EnumQueryStringArrayEnum dollar = - _$enumQueryStringArrayEnum_dollar; + static const EnumQueryStringArrayEnum dollar = _$enumQueryStringArrayEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumQueryStringArrayEnum unknownDefaultOpenApi = - _$enumQueryStringArrayEnum_unknownDefaultOpenApi; + static const EnumQueryStringArrayEnum unknownDefaultOpenApi = _$enumQueryStringArrayEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumQueryStringArrayEnumSerializer; + static Serializer get serializer => _$enumQueryStringArrayEnumSerializer; - const EnumQueryStringArrayEnum._(String name) : super(name); + const EnumQueryStringArrayEnum._(String name): super(name); - static BuiltSet get values => - _$enumQueryStringArrayEnumValues; - static EnumQueryStringArrayEnum valueOf(String name) => - _$enumQueryStringArrayEnumValueOf(name); + static BuiltSet get values => _$enumQueryStringArrayEnumValues; + static EnumQueryStringArrayEnum valueOf(String name) => _$enumQueryStringArrayEnumValueOf(name); } + class EnumQueryStringEnum extends EnumClass { + /// Query parameter enum test (string) @BuiltValueEnumConst(wireName: r'_abc') static const EnumQueryStringEnum abc = _$enumQueryStringEnum_abc; - /// Query parameter enum test (string) @BuiltValueEnumConst(wireName: r'-efg') static const EnumQueryStringEnum efg = _$enumQueryStringEnum_efg; - /// Query parameter enum test (string) @BuiltValueEnumConst(wireName: r'(xyz)') - static const EnumQueryStringEnum leftParenthesisXyzRightParenthesis = - _$enumQueryStringEnum_leftParenthesisXyzRightParenthesis; - + static const EnumQueryStringEnum leftParenthesisXyzRightParenthesis = _$enumQueryStringEnum_leftParenthesisXyzRightParenthesis; /// Query parameter enum test (string) @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumQueryStringEnum unknownDefaultOpenApi = - _$enumQueryStringEnum_unknownDefaultOpenApi; + static const EnumQueryStringEnum unknownDefaultOpenApi = _$enumQueryStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumQueryStringEnumSerializer; + static Serializer get serializer => _$enumQueryStringEnumSerializer; - const EnumQueryStringEnum._(String name) : super(name); + const EnumQueryStringEnum._(String name): super(name); - static BuiltSet get values => - _$enumQueryStringEnumValues; - static EnumQueryStringEnum valueOf(String name) => - _$enumQueryStringEnumValueOf(name); + static BuiltSet get values => _$enumQueryStringEnumValues; + static EnumQueryStringEnum valueOf(String name) => _$enumQueryStringEnumValueOf(name); } class EnumQueryIntegerEnum extends EnumClass { + /// Query parameter enum test (double) @BuiltValueEnumConst(wireNumber: 1) static const EnumQueryIntegerEnum number1 = _$enumQueryIntegerEnum_number1; - /// Query parameter enum test (double) @BuiltValueEnumConst(wireNumber: -2) - static const EnumQueryIntegerEnum numberNegative2 = - _$enumQueryIntegerEnum_numberNegative2; - + static const EnumQueryIntegerEnum numberNegative2 = _$enumQueryIntegerEnum_numberNegative2; /// Query parameter enum test (double) @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const EnumQueryIntegerEnum unknownDefaultOpenApi = - _$enumQueryIntegerEnum_unknownDefaultOpenApi; + static const EnumQueryIntegerEnum unknownDefaultOpenApi = _$enumQueryIntegerEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumQueryIntegerEnumSerializer; + static Serializer get serializer => _$enumQueryIntegerEnumSerializer; - const EnumQueryIntegerEnum._(String name) : super(name); + const EnumQueryIntegerEnum._(String name): super(name); - static BuiltSet get values => - _$enumQueryIntegerEnumValues; - static EnumQueryIntegerEnum valueOf(String name) => - _$enumQueryIntegerEnumValueOf(name); + static BuiltSet get values => _$enumQueryIntegerEnumValues; + static EnumQueryIntegerEnum valueOf(String name) => _$enumQueryIntegerEnumValueOf(name); } class EnumQueryDoubleEnum extends EnumClass { + /// Query parameter enum test (double) @BuiltValueEnumConst(wireName: r'1.1') - static const EnumQueryDoubleEnum number1Period1 = - _$enumQueryDoubleEnum_number1Period1; - + static const EnumQueryDoubleEnum number1Period1 = _$enumQueryDoubleEnum_number1Period1; /// Query parameter enum test (double) @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumQueryDoubleEnum numberNegative1Period2 = - _$enumQueryDoubleEnum_numberNegative1Period2; - + static const EnumQueryDoubleEnum numberNegative1Period2 = _$enumQueryDoubleEnum_numberNegative1Period2; /// Query parameter enum test (double) @BuiltValueEnumConst(wireName: r'11184809', fallback: true) - static const EnumQueryDoubleEnum unknownDefaultOpenApi = - _$enumQueryDoubleEnum_unknownDefaultOpenApi; + static const EnumQueryDoubleEnum unknownDefaultOpenApi = _$enumQueryDoubleEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumQueryDoubleEnumSerializer; + static Serializer get serializer => _$enumQueryDoubleEnumSerializer; - const EnumQueryDoubleEnum._(String name) : super(name); + const EnumQueryDoubleEnum._(String name): super(name); - static BuiltSet get values => - _$enumQueryDoubleEnumValues; - static EnumQueryDoubleEnum valueOf(String name) => - _$enumQueryDoubleEnumValueOf(name); + static BuiltSet get values => _$enumQueryDoubleEnumValues; + static EnumQueryDoubleEnum valueOf(String name) => _$enumQueryDoubleEnumValueOf(name); } + class InnerEnum extends EnumClass { + + static Serializer get serializer => _$innerEnumSerializer; - const InnerEnum._(String name) : super(name); + const InnerEnum._(String name): super(name); static BuiltSet get values => _$innerEnumValues; static InnerEnum valueOf(String name) => _$innerEnumValueOf(name); } + class EnumFormStringEnum extends EnumClass { + /// Form parameter enum test (string) @BuiltValueEnumConst(wireName: r'_abc') static const EnumFormStringEnum abc = _$enumFormStringEnum_abc; - /// Form parameter enum test (string) @BuiltValueEnumConst(wireName: r'-efg') static const EnumFormStringEnum efg = _$enumFormStringEnum_efg; - /// Form parameter enum test (string) @BuiltValueEnumConst(wireName: r'(xyz)') - static const EnumFormStringEnum leftParenthesisXyzRightParenthesis = - _$enumFormStringEnum_leftParenthesisXyzRightParenthesis; - + static const EnumFormStringEnum leftParenthesisXyzRightParenthesis = _$enumFormStringEnum_leftParenthesisXyzRightParenthesis; /// Form parameter enum test (string) @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumFormStringEnum unknownDefaultOpenApi = - _$enumFormStringEnum_unknownDefaultOpenApi; + static const EnumFormStringEnum unknownDefaultOpenApi = _$enumFormStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumFormStringEnumSerializer; + static Serializer get serializer => _$enumFormStringEnumSerializer; - const EnumFormStringEnum._(String name) : super(name); + const EnumFormStringEnum._(String name): super(name); static BuiltSet get values => _$enumFormStringEnumValues; - static EnumFormStringEnum valueOf(String name) => - _$enumFormStringEnumValueOf(name); + static EnumFormStringEnum valueOf(String name) => _$enumFormStringEnumValueOf(name); } + + + + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart index 022dec341edd..4b738508ff61 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart @@ -15,6 +15,7 @@ import 'package:openapi/src/model/model_client.dart'; part 'fake_classname_tags123_api.g.dart'; class FakeClassnameTags123Api { + final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -34,7 +35,7 @@ class FakeClassnameTags123Api { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -42,12 +43,18 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.testClassname( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -56,16 +63,19 @@ class FakeClassnameTags123Api { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ModelClient)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -87,9 +97,10 @@ class FakeClassnameTags123Api { extra: _response.extra, ); } -} +} class FakeClassnameTags123ApiRaw { + final Dio _dio; const FakeClassnameTags123ApiRaw(this._dio); @@ -108,7 +119,7 @@ class FakeClassnameTags123ApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ Object? body, String? requestContentType, String? acceptContentType, @@ -152,4 +163,8 @@ class FakeClassnameTags123ApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart index 6f734e3e859c..8a31381a45e4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart @@ -16,13 +16,14 @@ import 'package:openapi/src/model/foo_ref_or_value.dart'; part 'foo_api.g.dart'; class FooApi { + final FooApiRaw rawApi; final SerializationRepositoryBase _repository; const FooApi(this.rawApi, this._repository); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -35,7 +36,7 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioException] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ required Foo foo, CancelToken? cancelToken, Map? headers, @@ -43,11 +44,18 @@ class FooApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo(Foo)); + _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo( + + + Foo + ) + +); final _response = await rawApi.createFoo( + body: _bodyData, requestContentType: 'application/json;charset=utf-8', cancelToken: cancelToken, @@ -56,16 +64,19 @@ class FooApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooRefOrValue? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FooRefOrValue)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FooRefOrValue + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -89,7 +100,7 @@ class FooApi { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -101,35 +112,43 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioException] if API call or serialization fails - Future>> getAllFoos({ + Future>> getAllFoos({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getAllFoos( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltList? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(BuiltList, [ - const TypeInfo(FooRefOrValue), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + FooRefOrValue + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -151,15 +170,16 @@ class FooApi { extra: _response.extra, ); } -} +} class FooApiRaw { + final Dio _dio; const FooApiRaw(this._dio); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -172,7 +192,7 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioException] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ Object? body, String? requestContentType, String? acceptContentType, @@ -211,7 +231,7 @@ class FooApiRaw { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -223,7 +243,7 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioException] if API call or serialization fails - Future> getAllFoos({ + Future> getAllFoos({ Object? body, String? requestContentType, String? acceptContentType, @@ -260,4 +280,8 @@ class FooApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart index 7dd6645958f2..d65f20abe9c6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart @@ -17,13 +17,14 @@ import 'package:openapi/src/model/pet.dart'; part 'pet_api.g.dart'; class PetApi { + final PetApiRaw rawApi; final SerializationRepositoryBase _repository; const PetApi(this.rawApi, this._repository); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -36,7 +37,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ + Future> addPet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -44,11 +45,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.addPet( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -57,17 +65,17 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -77,7 +85,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required int petId, required String apiKey, CancelToken? cancelToken, @@ -86,18 +94,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deletePet( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), - apiKey: - encodeStringParameter(_repository, apiKey, const TypeInfo(String)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), + apiKey: encodeStringParameter(_repository, apiKey, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -116,7 +138,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioException] if API call or serialization fails - Future>> findPetsByStatus({ + Future>> findPetsByStatus({ @Deprecated('status is deprecated') required BuiltList status, CancelToken? cancelToken, Map? headers, @@ -124,36 +146,49 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.findPetsByStatus( - status: encodeQueryParameter( - _repository, - status, - const TypeInfo(BuiltList, [ - const TypeInfo(StatusEnum), - ]), - format: ListFormat.csv, - ), + + status: encodeQueryParameter(_repository, status, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + StatusEnum + + ) + +, + ]) + +, format: ListFormat.csv,), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltList? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(BuiltList, [ - const TypeInfo(Pet), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + Pet + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -191,7 +226,7 @@ class PetApi { /// Returns a [Future] containing a [Response] with a [BuiltSet] as data /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ + Future>> findPetsByTags({ required BuiltSet tags, CancelToken? cancelToken, Map? headers, @@ -199,36 +234,49 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.findPetsByTags( - tags: encodeQueryParameter( - _repository, - tags, - const TypeInfo(BuiltSet, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), + + tags: encodeQueryParameter(_repository, tags, const TypeInfo( + BuiltSet, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltSet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(BuiltSet, [ - const TypeInfo(Pet), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + BuiltSet, [ + + const TypeInfo( + + Pet + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -265,7 +313,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required int petId, CancelToken? cancelToken, Map? headers, @@ -273,24 +321,37 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getPetById( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Pet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Pet)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Pet + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -314,7 +375,7 @@ class PetApi { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -327,7 +388,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -335,11 +396,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.updatePet( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -348,13 +416,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -369,7 +437,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required int petId, required String name, required String status, @@ -379,19 +447,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (name != null) - r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), - if (status != null) - r'status': - encodeFormParameter(_repository, status, const TypeInfo(String)), + if (name != null) r'name': encodeFormParameter(_repository, name, const TypeInfo( + + + String + ) + +), + if (status != null) r'status': encodeFormParameter(_repository, status, const TypeInfo( + + + String + ) + +), }; _bodyData = _bodyMap; final _response = await rawApi.updatePetWithForm( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -400,13 +484,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -421,7 +505,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required int petId, required String additionalMetadata, required MultipartFile file, @@ -431,20 +515,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) - r'additionalMetadata': encodeFormParameter( - _repository, additionalMetadata, const TypeInfo(String)), - if (file != null) - r'file': encodeFormParameter( - _repository, file, const TypeInfo(MultipartFile)), + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + + + String + ) + +), + if (file != null) r'file': encodeFormParameter(_repository, file, const TypeInfo( + + + MultipartFile + ) + +), }; _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -453,16 +552,19 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ApiResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ApiResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -486,7 +588,7 @@ class PetApi { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -501,7 +603,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, required String additionalMetadata, @@ -511,19 +613,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) - r'additionalMetadata': encodeFormParameter( - _repository, additionalMetadata, const TypeInfo(String)), - r'requiredFile': encodeFormParameter( - _repository, requiredFile, const TypeInfo(MultipartFile)), + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + + + String + ) + +), + r'requiredFile': encodeFormParameter(_repository, requiredFile, const TypeInfo( + + + MultipartFile + ) + +), }; _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFileWithRequiredFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -532,16 +650,19 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ApiResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ApiResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -563,15 +684,16 @@ class PetApi { extra: _response.extra, ); } -} +} class PetApiRaw { + final Dio _dio; const PetApiRaw(this._dio); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -584,7 +706,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ + Future> addPet({ Object? body, String? requestContentType, String? acceptContentType, @@ -628,11 +750,11 @@ class PetApiRaw { } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -642,7 +764,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required String petId, String? apiKey, Object? body, @@ -656,8 +778,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -703,7 +824,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltList] as data /// Throws [DioException] if API call or serialization fails - Future> findPetsByStatus({ + Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, String? requestContentType, @@ -767,7 +888,7 @@ class PetApiRaw { /// Returns a [Future] containing a [Response] with a [BuiltSet] as data /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future> findPetsByTags({ + Future> findPetsByTags({ required Object tags, Object? body, String? requestContentType, @@ -830,7 +951,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required String petId, Object? body, String? requestContentType, @@ -843,8 +964,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'GET', headers: { @@ -878,7 +998,7 @@ class PetApiRaw { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -891,7 +1011,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ Object? body, String? requestContentType, String? acceptContentType, @@ -935,7 +1055,7 @@ class PetApiRaw { } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -950,7 +1070,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required String petId, Object? body, String? requestContentType, @@ -963,8 +1083,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -996,7 +1115,7 @@ class PetApiRaw { } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1011,7 +1130,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required String petId, Object? body, String? requestContentType, @@ -1024,8 +1143,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}/uploadImage' - .replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1057,7 +1175,7 @@ class PetApiRaw { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1072,7 +1190,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required String petId, Object? body, String? requestContentType, @@ -1085,8 +1203,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile' - .replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1116,10 +1233,15 @@ class PetApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + @Deprecated('StatusEnum has been deprecated') class StatusEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'available') static const StatusEnum available = _$statusEnum_available; @BuiltValueEnumConst(wireName: r'pending') @@ -1127,13 +1249,27 @@ class StatusEnum extends EnumClass { @BuiltValueEnumConst(wireName: r'sold') static const StatusEnum sold = _$statusEnum_sold; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const StatusEnum unknownDefaultOpenApi = - _$statusEnum_unknownDefaultOpenApi; + static const StatusEnum unknownDefaultOpenApi = _$statusEnum_unknownDefaultOpenApi; static Serializer get serializer => _$statusEnumSerializer; - const StatusEnum._(String name) : super(name); + const StatusEnum._(String name): super(name); static BuiltSet get values => _$statusEnumValues; static StatusEnum valueOf(String name) => _$statusEnumValueOf(name); } + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart index 25188260c46a..7a14f7a28ff8 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart @@ -16,6 +16,7 @@ import 'package:openapi/src/model/order.dart'; part 'store_api.g.dart'; class StoreApi { + final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -35,7 +36,7 @@ class StoreApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, CancelToken? cancelToken, Map? headers, @@ -43,17 +44,25 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deleteOrder( - orderId: - encodeStringParameter(_repository, orderId, const TypeInfo(String)), + + orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -71,36 +80,43 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [BuiltMap] as data /// Throws [DioException] if API call or serialization fails - Future>> getInventory({ + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getInventory( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); BuiltMap? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(BuiltMap, [ - TypeInfo(String), - const TypeInfo(int), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + BuiltMap, [ + TypeInfo(String), + const TypeInfo( + + int + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -137,7 +153,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required int orderId, CancelToken? cancelToken, Map? headers, @@ -145,24 +161,37 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getOrderById( - orderId: encodeStringParameter(_repository, orderId, const TypeInfo(int)), + + orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + + + int + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Order + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -186,7 +215,7 @@ class StoreApi { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -199,7 +228,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ required Order order, CancelToken? cancelToken, Map? headers, @@ -207,11 +236,18 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, order, const TypeInfo(Order)); + _bodyData = encodeBodyParameter(_repository, order, const TypeInfo( + + + Order + ) + +); final _response = await rawApi.placeOrder( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -220,15 +256,19 @@ class StoreApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Order + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -250,9 +290,10 @@ class StoreApi { extra: _response.extra, ); } -} +} class StoreApiRaw { + final Dio _dio; const StoreApiRaw(this._dio); @@ -271,7 +312,7 @@ class StoreApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, @@ -284,8 +325,7 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}' - .replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -324,7 +364,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [BuiltMap] as data /// Throws [DioException] if API call or serialization fails - Future> getInventory({ + Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, @@ -383,7 +423,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required String orderId, Object? body, String? requestContentType, @@ -396,8 +436,7 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}' - .replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'GET', headers: { @@ -424,7 +463,7 @@ class StoreApiRaw { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -437,7 +476,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, @@ -474,4 +513,10 @@ class StoreApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart index de82febad6f1..a70612cfedfb 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart @@ -16,6 +16,7 @@ import 'package:openapi/src/model/user.dart'; part 'user_api.g.dart'; class UserApi { + final UserApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -35,7 +36,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUser({ + Future> createUser({ required User user, CancelToken? cancelToken, Map? headers, @@ -43,11 +44,18 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.createUser( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -56,13 +64,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -75,7 +83,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ required BuiltList user, CancelToken? cancelToken, Map? headers, @@ -83,16 +91,24 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, - user, - const TypeInfo(BuiltList, [ - const TypeInfo(User), - ])); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + User + + ) + +, + ]) + +); final _response = await rawApi.createUsersWithArrayInput( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -101,13 +117,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -120,7 +136,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ required BuiltList user, CancelToken? cancelToken, Map? headers, @@ -128,16 +144,24 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, - user, - const TypeInfo(BuiltList, [ - const TypeInfo(User), - ])); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + BuiltList, [ + + const TypeInfo( + + User + + ) + +, + ]) + +); final _response = await rawApi.createUsersWithListInput( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -146,7 +170,7 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -165,7 +189,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, CancelToken? cancelToken, Map? headers, @@ -173,23 +197,31 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deleteUser( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -202,7 +234,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, CancelToken? cancelToken, Map? headers, @@ -210,25 +242,37 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getUserByName( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); User? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(User)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + User + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -252,7 +296,7 @@ class UserApi { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -266,7 +310,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required String username, required String password, CancelToken? cancelToken, @@ -275,33 +319,44 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.loginUser( - username: encodeQueryParameter( - _repository, - username, - const TypeInfo(String), - ), - password: encodeQueryParameter( - _repository, - password, - const TypeInfo(String), - ), + + username: encodeQueryParameter(_repository, username, const TypeInfo( + + + String + ) + +, ), + password: encodeQueryParameter(_repository, password, const TypeInfo( + + + String + ) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(String)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + String + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -325,7 +380,7 @@ class UserApi { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -337,22 +392,25 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.logoutUser( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -372,7 +430,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, required User user, CancelToken? cancelToken, @@ -381,13 +439,25 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.updateUser( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -396,13 +466,14 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } -} +} class UserApiRaw { + final Dio _dio; const UserApiRaw(this._dio); @@ -421,7 +492,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUser({ + Future> createUser({ Object? body, String? requestContentType, String? acceptContentType, @@ -460,7 +531,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -473,7 +544,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ Object? body, String? requestContentType, String? acceptContentType, @@ -512,7 +583,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -525,7 +596,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ Object? body, String? requestContentType, String? acceptContentType, @@ -577,7 +648,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, Object? body, String? requestContentType, @@ -590,8 +661,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'DELETE', headers: { @@ -618,7 +688,7 @@ class UserApiRaw { } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -631,7 +701,7 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, Object? body, String? requestContentType, @@ -644,8 +714,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'GET', headers: { @@ -672,7 +741,7 @@ class UserApiRaw { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -686,7 +755,7 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required Object username, required Object password, Object? body, @@ -733,7 +802,7 @@ class UserApiRaw { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -745,7 +814,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ Object? body, String? requestContentType, String? acceptContentType, @@ -798,7 +867,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, Object? body, String? requestContentType, @@ -811,8 +880,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'PUT', headers: { @@ -837,4 +905,16 @@ class UserApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart index f0bc019b85df..bc683f074d55 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart @@ -15,6 +15,7 @@ class Openapi { final Dio dio; final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, SerializationRepositoryBase? serializationRepositoryOverride, @@ -25,9 +26,7 @@ class Openapi { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), - this.serializationRepository = serializationRepositoryOverride ?? - BuiltValueJsonRepository(standardSerializers) { + )), this.serializationRepository = serializationRepositoryOverride ?? BuiltValueJsonRepository(standardSerializers) { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -42,36 +41,25 @@ class Openapi { void setOAuthToken(String name, String token) { if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) - as OAuthInterceptor) - .tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; } } void setBearerAuth(String name, String token) { if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) - as BearerAuthInterceptor) - .tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; } } void setBasicAuth(String name, String username, String password) { if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) - as BasicAuthInterceptor) - .authInfo[name] = BasicAuthInfo(username, password); + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); } } void setApiKey(String name, String apiKey) { if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this - .dio - .interceptors - .firstWhere((element) => element is ApiKeyAuthInterceptor) - as ApiKeyAuthInterceptor) - .apiKeys[name] = apiKey; + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; } } @@ -102,8 +90,7 @@ class Openapi { /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api( - FakeClassnameTags123ApiRaw(dio), serializationRepository); + return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); } /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart index 6ba61211c680..cca5b3427a0a 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart @@ -11,14 +11,14 @@ Object encodeFormParameter( T value, TypeInfo type, ) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; } String encodeStringParameter( @@ -34,14 +34,14 @@ Object encodeBodyParameter( T value, TypeInfo type, ) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; } Object encodeQueryParameter( @@ -50,21 +50,21 @@ Object encodeQueryParameter( TypeInfo type, { ListFormat format = ListFormat.multi, }) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; } ListParam encodeCollectionQueryParameter( @@ -73,17 +73,16 @@ ListParam encodeCollectionQueryParameter( TypeInfo type, { ListFormat format = ListFormat.multi, }) { - final serialized = repository.serialize( - value, - type, - ); - if (serialized is Iterable) { - return ListParam(serialized.toList(), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); + final serialized = repository.serialize( + value, + type, + ); + if (serialized is Iterable) { + return ListParam(serialized.toList(), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } -TOutput decodeResponse( - SerializationRepositoryBase repository, TInput value, TypeInfo type) { +TOutput decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) { return repository.deserialize(value, type); -} +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart index 7219f2ecefa2..f038e92358ef 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart @@ -2,4 +2,4 @@ export 'api_key_auth.dart'; export 'basic_auth.dart'; export 'oauth.dart'; export 'bearer_auth.dart'; -export 'auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart index 312a5ad42602..ee16e3f0f92f 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart @@ -2,6 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // + import 'package:dio/dio.dart'; import 'package:openapi/src/auth/auth.dart'; @@ -10,8 +11,7 @@ class ApiKeyAuthInterceptor extends AuthInterceptor { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = - getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); for (final info in authInfo) { final authName = info['name'] as String; final authKeyName = info['keyName'] as String; diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart index c6fcca595cb3..f7ae9bf3f11e 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart @@ -8,8 +8,7 @@ abstract class AuthInterceptor extends Interceptor { /// Get auth information on given route for the given type. /// Can return an empty list if type is not present on auth data or /// if route doesn't need authentication. - List> getAuthInfo( - RequestOptions route, bool Function(Map secure) handles) { + List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { if (route.extra.containsKey('secure')) { final auth = route.extra['secure'] as List>; return auth.where((secure) => handles(secure)).toList(); diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart index 07b9efc0df0c..b6e6dce04f9c 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart @@ -22,17 +22,12 @@ class BasicAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final metadataAuthInfo = getAuthInfo( - options, - (secure) => - (secure['type'] == 'http' && secure['scheme'] == 'basic') || - secure['type'] == 'basic'); + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); for (final info in metadataAuthInfo) { final authName = info['name'] as String; final basicAuthInfo = authInfo[authName]; if (basicAuthInfo != null) { - final basicAuth = - 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; + final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; options.headers['Authorization'] = basicAuth; break; } diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart index 6723de5020d3..1d4402b376c0 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart @@ -13,8 +13,7 @@ class BearerAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, - (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart index 44403e3358be..337cf762b0ce 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart @@ -13,8 +13,7 @@ class OAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, - (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart index 2994744ffcfb..06e023d91be5 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart @@ -7,6 +7,7 @@ import 'package:built_value/serializer.dart'; import 'model/date.dart'; class DateSerializer implements PrimitiveSerializer { + const DateSerializer(); @override diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart index 34022add8e5e..a5194f1d0c48 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart @@ -12,12 +12,10 @@ part 'additional_properties_class.g.dart'; /// AdditionalPropertiesClass /// /// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] +/// * [mapProperty] +/// * [mapOfMapProperty] @BuiltValue() -abstract class AdditionalPropertiesClass - implements - Built { +abstract class AdditionalPropertiesClass implements Built { @BuiltValueField(wireName: r'map_property') BuiltMap? get mapProperty; @@ -26,25 +24,18 @@ abstract class AdditionalPropertiesClass AdditionalPropertiesClass._(); - factory AdditionalPropertiesClass( - [void updates(AdditionalPropertiesClassBuilder b)]) = - _$AdditionalPropertiesClass; + factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; @BuiltValueHook(initializeBuilder: true) static void _defaults(AdditionalPropertiesClassBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AdditionalPropertiesClassSerializer(); + static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); } -class _$AdditionalPropertiesClassSerializer - implements PrimitiveSerializer { +class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - AdditionalPropertiesClass, - _$AdditionalPropertiesClass - ]; + final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; @override final String wireName = r'AdditionalPropertiesClass'; @@ -58,18 +49,14 @@ class _$AdditionalPropertiesClassSerializer yield r'map_property'; yield serializers.serialize( object.mapProperty, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(String)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), ); } if (object.mapOfMapProperty != null) { yield r'map_of_map_property'; yield serializers.serialize( object.mapOfMapProperty, - specifiedType: const FullType(BuiltMap, [ - FullType(String), - FullType(BuiltMap, [FullType(String), FullType(String)]) - ]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), ); } } @@ -80,9 +67,7 @@ class _$AdditionalPropertiesClassSerializer AdditionalPropertiesClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -100,18 +85,14 @@ class _$AdditionalPropertiesClassSerializer case r'map_property': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(String)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), ) as BuiltMap; result.mapProperty.replace(valueDes); break; case r'map_of_map_property': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [ - FullType(String), - FullType(BuiltMap, [FullType(String), FullType(String)]) - ]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), ) as BuiltMap>; result.mapOfMapProperty.replace(valueDes); break; @@ -143,3 +124,6 @@ class _$AdditionalPropertiesClassSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart index 22e9ab761489..20ed539904b1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart @@ -14,7 +14,7 @@ part 'addressable.g.dart'; /// * [href] - Hyperlink reference /// * [id] - unique identifier @BuiltValue(instantiable: false) -abstract class Addressable { +abstract class Addressable { /// Hyperlink reference @BuiltValueField(wireName: r'href') String? get href; @@ -61,9 +61,7 @@ class _$AddressableSerializer implements PrimitiveSerializer { Addressable object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -72,19 +70,16 @@ class _$AddressableSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, - specifiedType: FullType($Addressable)) as $Addressable; + return serializers.deserialize(serialized, specifiedType: FullType($Addressable)) as $Addressable; } } /// a concrete implementation of [Addressable], since [Addressable] is not instantiable @BuiltValue(instantiable: true) -abstract class $Addressable - implements Addressable, Built<$Addressable, $AddressableBuilder> { +abstract class $Addressable implements Addressable, Built<$Addressable, $AddressableBuilder> { $Addressable._(); - factory $Addressable([void Function($AddressableBuilder)? updates]) = - _$$Addressable; + factory $Addressable([void Function($AddressableBuilder)? updates]) = _$$Addressable; @BuiltValueHook(initializeBuilder: true) static void _defaults($AddressableBuilder b) => b; @@ -163,3 +158,6 @@ class _$$AddressableSerializer implements PrimitiveSerializer<$Addressable> { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart index 6f04a161e942..a305a71e08d1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart @@ -12,11 +12,10 @@ part 'all_of_with_single_ref.g.dart'; /// AllOfWithSingleRef /// /// Properties: -/// * [username] -/// * [singleRefType] +/// * [username] +/// * [singleRefType] @BuiltValue() -abstract class AllOfWithSingleRef - implements Built { +abstract class AllOfWithSingleRef implements Built { @BuiltValueField(wireName: r'username') String? get username; @@ -26,19 +25,16 @@ abstract class AllOfWithSingleRef AllOfWithSingleRef._(); - factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = - _$AllOfWithSingleRef; + factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = _$AllOfWithSingleRef; @BuiltValueHook(initializeBuilder: true) static void _defaults(AllOfWithSingleRefBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AllOfWithSingleRefSerializer(); + static Serializer get serializer => _$AllOfWithSingleRefSerializer(); } -class _$AllOfWithSingleRefSerializer - implements PrimitiveSerializer { +class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer { @override final Iterable types = const [AllOfWithSingleRef, _$AllOfWithSingleRef]; @@ -72,9 +68,7 @@ class _$AllOfWithSingleRefSerializer AllOfWithSingleRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -131,3 +125,6 @@ class _$AllOfWithSingleRefSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart index 11c09dbea949..fffd873218c9 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart @@ -13,10 +13,10 @@ part 'animal.g.dart'; /// Animal /// /// Properties: -/// * [className] -/// * [color] +/// * [className] +/// * [color] @BuiltValue(instantiable: false) -abstract class Animal { +abstract class Animal { @BuiltValueField(wireName: r'className') String get className; @@ -35,27 +35,26 @@ abstract class Animal { } extension AnimalDiscriminatorExt on Animal { - String? get discriminatorValue { - if (this is Cat) { - return r'CAT'; + String? get discriminatorValue { + if (this is Cat) { + return r'CAT'; + } + if (this is Dog) { + return r'DOG'; + } + return null; } - if (this is Dog) { - return r'DOG'; - } - return null; - } } - extension AnimalBuilderDiscriminatorExt on AnimalBuilder { - String? get discriminatorValue { - if (this is CatBuilder) { - return r'CAT'; + String? get discriminatorValue { + if (this is CatBuilder) { + return r'CAT'; + } + if (this is DogBuilder) { + return r'DOG'; + } + return null; } - if (this is DogBuilder) { - return r'DOG'; - } - return null; - } } class _$AnimalSerializer implements PrimitiveSerializer { @@ -96,9 +95,7 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -109,18 +106,14 @@ class _$AnimalSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; switch (discValue) { case r'CAT': - return serializers.deserialize(serialized, specifiedType: FullType(Cat)) - as Cat; + return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; case r'DOG': - return serializers.deserialize(serialized, specifiedType: FullType(Dog)) - as Dog; + return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; default: - return serializers.deserialize(serialized, - specifiedType: FullType($Animal)) as $Animal; + return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; } } } @@ -209,3 +202,6 @@ class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart index 14e9ccff7852..3c65365a2614 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart @@ -11,9 +11,9 @@ part 'api_response.g.dart'; /// ApiResponse /// /// Properties: -/// * [code] -/// * [type] -/// * [message] +/// * [code] +/// * [type] +/// * [message] @BuiltValue() abstract class ApiResponse implements Built { @BuiltValueField(wireName: r'code') @@ -77,9 +77,7 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { ApiResponse object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -143,3 +141,7 @@ class _$ApiResponseSerializer implements PrimitiveSerializer { return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart index fa77c28e614c..c6ae23d72363 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart @@ -11,7 +11,7 @@ part 'apple.g.dart'; /// Apple /// /// Properties: -/// * [kind] +/// * [kind] @BuiltValue() abstract class Apple implements Built { @BuiltValueField(wireName: r'kind') @@ -55,9 +55,7 @@ class _$AppleSerializer implements PrimitiveSerializer { Apple object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$AppleSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart index 65ef1bafcf52..deb40a48bb1b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart @@ -12,29 +12,25 @@ part 'apple_all_of_disc.g.dart'; /// AppleAllOfDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class AppleAllOfDisc - implements FruitType, Built { +abstract class AppleAllOfDisc implements FruitType, Built { @BuiltValueField(wireName: r'seeds') int get seeds; AppleAllOfDisc._(); - factory AppleAllOfDisc([void updates(AppleAllOfDiscBuilder b)]) = - _$AppleAllOfDisc; + factory AppleAllOfDisc([void updates(AppleAllOfDiscBuilder b)]) = _$AppleAllOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(AppleAllOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AppleAllOfDiscSerializer(); + static Serializer get serializer => _$AppleAllOfDiscSerializer(); } -class _$AppleAllOfDiscSerializer - implements PrimitiveSerializer { +class _$AppleAllOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [AppleAllOfDisc, _$AppleAllOfDisc]; @@ -64,9 +60,7 @@ class _$AppleAllOfDiscSerializer AppleAllOfDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -123,3 +117,6 @@ class _$AppleAllOfDiscSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart index 7612f5cef18d..2ec1ff48ada0 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart @@ -12,36 +12,27 @@ part 'apple_grandparent_disc.g.dart'; /// AppleGrandparentDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class AppleGrandparentDisc - implements - Parent, - Built { +abstract class AppleGrandparentDisc implements Parent, Built { @BuiltValueField(wireName: r'seeds') int get seeds; AppleGrandparentDisc._(); - factory AppleGrandparentDisc([void updates(AppleGrandparentDiscBuilder b)]) = - _$AppleGrandparentDisc; + factory AppleGrandparentDisc([void updates(AppleGrandparentDiscBuilder b)]) = _$AppleGrandparentDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(AppleGrandparentDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AppleGrandparentDiscSerializer(); + static Serializer get serializer => _$AppleGrandparentDiscSerializer(); } -class _$AppleGrandparentDiscSerializer - implements PrimitiveSerializer { +class _$AppleGrandparentDiscSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - AppleGrandparentDisc, - _$AppleGrandparentDisc - ]; + final Iterable types = const [AppleGrandparentDisc, _$AppleGrandparentDisc]; @override final String wireName = r'AppleGrandparentDisc'; @@ -69,9 +60,7 @@ class _$AppleGrandparentDiscSerializer AppleGrandparentDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,3 +117,6 @@ class _$AppleGrandparentDiscSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart index a69bc64f1d77..a8513ff3fe73 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart @@ -13,11 +13,10 @@ part 'apple_one_of_disc.g.dart'; /// AppleOneOfDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class AppleOneOfDisc - implements Built { +abstract class AppleOneOfDisc implements Built { @BuiltValueField(wireName: r'seeds') int get seeds; @@ -26,19 +25,16 @@ abstract class AppleOneOfDisc AppleOneOfDisc._(); - factory AppleOneOfDisc([void updates(AppleOneOfDiscBuilder b)]) = - _$AppleOneOfDisc; + factory AppleOneOfDisc([void updates(AppleOneOfDiscBuilder b)]) = _$AppleOneOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(AppleOneOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AppleOneOfDiscSerializer(); + static Serializer get serializer => _$AppleOneOfDiscSerializer(); } -class _$AppleOneOfDiscSerializer - implements PrimitiveSerializer { +class _$AppleOneOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [AppleOneOfDisc, _$AppleOneOfDisc]; @@ -64,11 +60,8 @@ class _$AppleOneOfDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -107,9 +100,7 @@ class _$AppleOneOfDiscSerializer }) { final result = AppleOneOfDiscBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(FruitType), - ]); + final targetType = const FullType(OneOf, [FullType(FruitType), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -121,8 +112,10 @@ class _$AppleOneOfDiscSerializer result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart index f569000b454e..59215a68be6e 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart @@ -11,11 +11,10 @@ part 'apple_req_disc.g.dart'; /// AppleReqDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class AppleReqDisc - implements Built { +abstract class AppleReqDisc implements Built { @BuiltValueField(wireName: r'seeds') int get seeds; @@ -63,9 +62,7 @@ class _$AppleReqDiscSerializer implements PrimitiveSerializer { AppleReqDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -122,3 +119,6 @@ class _$AppleReqDiscSerializer implements PrimitiveSerializer { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart index 673ced865449..45bd9d65b160 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart @@ -11,24 +11,21 @@ part 'apple_variant1.g.dart'; /// AppleVariant1 /// /// Properties: -/// * [kind] +/// * [kind] @BuiltValue() -abstract class AppleVariant1 - implements Built { +abstract class AppleVariant1 implements Built { @BuiltValueField(wireName: r'kind') String? get kind; AppleVariant1._(); - factory AppleVariant1([void updates(AppleVariant1Builder b)]) = - _$AppleVariant1; + factory AppleVariant1([void updates(AppleVariant1Builder b)]) = _$AppleVariant1; @BuiltValueHook(initializeBuilder: true) static void _defaults(AppleVariant1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$AppleVariant1Serializer(); + static Serializer get serializer => _$AppleVariant1Serializer(); } class _$AppleVariant1Serializer implements PrimitiveSerializer { @@ -58,9 +55,7 @@ class _$AppleVariant1Serializer implements PrimitiveSerializer { AppleVariant1 object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -110,3 +105,5 @@ class _$AppleVariant1Serializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart index 0f51b17b901d..44ebbd8534a5 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart @@ -12,35 +12,26 @@ part 'array_of_array_of_number_only.g.dart'; /// ArrayOfArrayOfNumberOnly /// /// Properties: -/// * [arrayArrayNumber] +/// * [arrayArrayNumber] @BuiltValue() -abstract class ArrayOfArrayOfNumberOnly - implements - Built { +abstract class ArrayOfArrayOfNumberOnly implements Built { @BuiltValueField(wireName: r'ArrayArrayNumber') BuiltList>? get arrayArrayNumber; ArrayOfArrayOfNumberOnly._(); - factory ArrayOfArrayOfNumberOnly( - [void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = - _$ArrayOfArrayOfNumberOnly; + factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ArrayOfArrayOfNumberOnlySerializer(); + static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); } -class _$ArrayOfArrayOfNumberOnlySerializer - implements PrimitiveSerializer { +class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ArrayOfArrayOfNumberOnly, - _$ArrayOfArrayOfNumberOnly - ]; + final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; @override final String wireName = r'ArrayOfArrayOfNumberOnly'; @@ -54,9 +45,7 @@ class _$ArrayOfArrayOfNumberOnlySerializer yield r'ArrayArrayNumber'; yield serializers.serialize( object.arrayArrayNumber, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(num)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), ); } } @@ -67,9 +56,7 @@ class _$ArrayOfArrayOfNumberOnlySerializer ArrayOfArrayOfNumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -87,9 +74,7 @@ class _$ArrayOfArrayOfNumberOnlySerializer case r'ArrayArrayNumber': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(num)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]), ) as BuiltList>; result.arrayArrayNumber.replace(valueDes); break; @@ -121,3 +106,5 @@ class _$ArrayOfArrayOfNumberOnlySerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart index 5aeb707cbb32..2d514a03780e 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart @@ -12,28 +12,24 @@ part 'array_of_number_only.g.dart'; /// ArrayOfNumberOnly /// /// Properties: -/// * [arrayNumber] +/// * [arrayNumber] @BuiltValue() -abstract class ArrayOfNumberOnly - implements Built { +abstract class ArrayOfNumberOnly implements Built { @BuiltValueField(wireName: r'ArrayNumber') BuiltList? get arrayNumber; ArrayOfNumberOnly._(); - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = - _$ArrayOfNumberOnly; + factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(ArrayOfNumberOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ArrayOfNumberOnlySerializer(); + static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); } -class _$ArrayOfNumberOnlySerializer - implements PrimitiveSerializer { +class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer { @override final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; @@ -60,9 +56,7 @@ class _$ArrayOfNumberOnlySerializer ArrayOfNumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -112,3 +106,5 @@ class _$ArrayOfNumberOnlySerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart index e0fe071b45ef..aeb7af9ca8bd 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart @@ -13,9 +13,9 @@ part 'array_test.g.dart'; /// ArrayTest /// /// Properties: -/// * [arrayOfString] -/// * [arrayArrayOfInteger] -/// * [arrayArrayOfModel] +/// * [arrayOfString] +/// * [arrayArrayOfInteger] +/// * [arrayArrayOfModel] @BuiltValue() abstract class ArrayTest implements Built { @BuiltValueField(wireName: r'array_of_string') @@ -61,18 +61,14 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { yield r'array_array_of_integer'; yield serializers.serialize( object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(int)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), ); } if (object.arrayArrayOfModel != null) { yield r'array_array_of_model'; yield serializers.serialize( object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(ReadOnlyFirst)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), ); } } @@ -83,9 +79,7 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { ArrayTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -110,18 +104,14 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { case r'array_array_of_integer': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(int)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]), ) as BuiltList>; result.arrayArrayOfInteger.replace(valueDes); break; case r'array_array_of_model': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltList, [ - FullType(BuiltList, [FullType(ReadOnlyFirst)]) - ]), + specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]), ) as BuiltList>; result.arrayArrayOfModel.replace(valueDes); break; @@ -153,3 +143,7 @@ class _$ArrayTestSerializer implements PrimitiveSerializer { return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart index 00c090ee8727..c688570da180 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart @@ -11,7 +11,7 @@ part 'banana.g.dart'; /// Banana /// /// Properties: -/// * [count] +/// * [count] @BuiltValue() abstract class Banana implements Built { @BuiltValueField(wireName: r'count') @@ -55,9 +55,7 @@ class _$BananaSerializer implements PrimitiveSerializer { Banana object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$BananaSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart index 6ed5d198ad92..2839c4adbef2 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart @@ -12,29 +12,25 @@ part 'banana_all_of_disc.g.dart'; /// BananaAllOfDisc /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class BananaAllOfDisc - implements FruitType, Built { +abstract class BananaAllOfDisc implements FruitType, Built { @BuiltValueField(wireName: r'length') int get length; BananaAllOfDisc._(); - factory BananaAllOfDisc([void updates(BananaAllOfDiscBuilder b)]) = - _$BananaAllOfDisc; + factory BananaAllOfDisc([void updates(BananaAllOfDiscBuilder b)]) = _$BananaAllOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(BananaAllOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BananaAllOfDiscSerializer(); + static Serializer get serializer => _$BananaAllOfDiscSerializer(); } -class _$BananaAllOfDiscSerializer - implements PrimitiveSerializer { +class _$BananaAllOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [BananaAllOfDisc, _$BananaAllOfDisc]; @@ -64,9 +60,7 @@ class _$BananaAllOfDiscSerializer BananaAllOfDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -123,3 +117,6 @@ class _$BananaAllOfDiscSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart index 45200de2eb1c..1298bf5d0e1f 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart @@ -12,36 +12,27 @@ part 'banana_grandparent_disc.g.dart'; /// BananaGrandparentDisc /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class BananaGrandparentDisc - implements - Parent, - Built { +abstract class BananaGrandparentDisc implements Parent, Built { @BuiltValueField(wireName: r'length') int get length; BananaGrandparentDisc._(); - factory BananaGrandparentDisc( - [void updates(BananaGrandparentDiscBuilder b)]) = _$BananaGrandparentDisc; + factory BananaGrandparentDisc([void updates(BananaGrandparentDiscBuilder b)]) = _$BananaGrandparentDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(BananaGrandparentDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BananaGrandparentDiscSerializer(); + static Serializer get serializer => _$BananaGrandparentDiscSerializer(); } -class _$BananaGrandparentDiscSerializer - implements PrimitiveSerializer { +class _$BananaGrandparentDiscSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - BananaGrandparentDisc, - _$BananaGrandparentDisc - ]; + final Iterable types = const [BananaGrandparentDisc, _$BananaGrandparentDisc]; @override final String wireName = r'BananaGrandparentDisc'; @@ -69,9 +60,7 @@ class _$BananaGrandparentDiscSerializer BananaGrandparentDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,3 +117,6 @@ class _$BananaGrandparentDiscSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart index 5eb4611232d0..8c02260d910d 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart @@ -13,11 +13,10 @@ part 'banana_one_of_disc.g.dart'; /// BananaOneOfDisc /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class BananaOneOfDisc - implements Built { +abstract class BananaOneOfDisc implements Built { @BuiltValueField(wireName: r'length') int get length; @@ -26,19 +25,16 @@ abstract class BananaOneOfDisc BananaOneOfDisc._(); - factory BananaOneOfDisc([void updates(BananaOneOfDiscBuilder b)]) = - _$BananaOneOfDisc; + factory BananaOneOfDisc([void updates(BananaOneOfDiscBuilder b)]) = _$BananaOneOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(BananaOneOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BananaOneOfDiscSerializer(); + static Serializer get serializer => _$BananaOneOfDiscSerializer(); } -class _$BananaOneOfDiscSerializer - implements PrimitiveSerializer { +class _$BananaOneOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [BananaOneOfDisc, _$BananaOneOfDisc]; @@ -64,11 +60,8 @@ class _$BananaOneOfDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -107,9 +100,7 @@ class _$BananaOneOfDiscSerializer }) { final result = BananaOneOfDiscBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(FruitType), - ]); + final targetType = const FullType(OneOf, [FullType(FruitType), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -121,8 +112,10 @@ class _$BananaOneOfDiscSerializer result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart index 0338f1853788..e44930d39738 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart @@ -11,11 +11,10 @@ part 'banana_req_disc.g.dart'; /// BananaReqDisc /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class BananaReqDisc - implements Built { +abstract class BananaReqDisc implements Built { @BuiltValueField(wireName: r'length') int get length; @@ -24,15 +23,13 @@ abstract class BananaReqDisc BananaReqDisc._(); - factory BananaReqDisc([void updates(BananaReqDiscBuilder b)]) = - _$BananaReqDisc; + factory BananaReqDisc([void updates(BananaReqDiscBuilder b)]) = _$BananaReqDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(BananaReqDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BananaReqDiscSerializer(); + static Serializer get serializer => _$BananaReqDiscSerializer(); } class _$BananaReqDiscSerializer implements PrimitiveSerializer { @@ -65,9 +62,7 @@ class _$BananaReqDiscSerializer implements PrimitiveSerializer { BananaReqDisc object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -124,3 +119,6 @@ class _$BananaReqDiscSerializer implements PrimitiveSerializer { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart index ba6b35ebf7df..986656f37487 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart @@ -13,10 +13,10 @@ part 'bar.g.dart'; /// Bar /// /// Properties: -/// * [id] -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [id] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class @@ -37,7 +37,7 @@ abstract class Bar implements Entity, Built { factory Bar([void updates(BarBuilder b)]) = _$Bar; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(BarBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarSerializer(); @@ -117,9 +117,7 @@ class _$BarSerializer implements PrimitiveSerializer { Bar object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -218,3 +216,12 @@ class _$BarSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart index 5d726a9957e4..2782abd4f02c 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart @@ -13,9 +13,9 @@ part 'bar_create.g.dart'; /// BarCreate /// /// Properties: -/// * [barPropA] -/// * [fooPropB] -/// * [foo] +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -37,7 +37,7 @@ abstract class BarCreate implements Entity, Built { factory BarCreate([void updates(BarCreateBuilder b)]) = _$BarCreate; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarCreateBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(BarCreateBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarCreateSerializer(); @@ -117,9 +117,7 @@ class _$BarCreateSerializer implements PrimitiveSerializer { BarCreate object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -218,3 +216,12 @@ class _$BarCreateSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart index f77429fa929b..f110362c6250 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart @@ -24,7 +24,7 @@ abstract class BarRef implements EntityRef, Built { factory BarRef([void updates(BarRefBuilder b)]) = _$BarRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(BarRefBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(BarRefBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$BarRefSerializer(); @@ -97,9 +97,7 @@ class _$BarRefSerializer implements PrimitiveSerializer { BarRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -191,3 +189,9 @@ class _$BarRefSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart index eeb993907a02..8155a455a2c3 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart @@ -20,8 +20,7 @@ part 'bar_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class BarRefOrValue - implements Built { +abstract class BarRefOrValue implements Built { /// One Of [Bar], [BarRef] OneOf get oneOf; @@ -34,39 +33,36 @@ abstract class BarRefOrValue BarRefOrValue._(); - factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = - _$BarRefOrValue; + factory BarRefOrValue([void updates(BarRefOrValueBuilder b)]) = _$BarRefOrValue; @BuiltValueHook(initializeBuilder: true) static void _defaults(BarRefOrValueBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$BarRefOrValueSerializer(); + static Serializer get serializer => _$BarRefOrValueSerializer(); } extension BarRefOrValueDiscriminatorExt on BarRefOrValue { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarRef) { + return r'BarRef'; + } + return null; } - if (this is BarRef) { - return r'BarRef'; - } - return null; - } } - extension BarRefOrValueBuilderDiscriminatorExt on BarRefOrValueBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; - } - if (this is BarRefBuilder) { - return r'BarRef'; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarRefBuilder) { + return r'BarRef'; + } + return null; } - return null; - } } class _$BarRefOrValueSerializer implements PrimitiveSerializer { @@ -80,7 +76,8 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, BarRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -89,8 +86,7 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -102,15 +98,10 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { final result = BarRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(BarRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - Bar, - BarRef, - ]; + final oneOfTypes = [Bar, BarRef, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -129,13 +120,15 @@ class _$BarRefOrValueSerializer implements PrimitiveSerializer { oneOfType = BarRef; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart index cbd4bf8cf926..b0f8cff09ea4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart @@ -11,15 +11,14 @@ part 'capitalization.g.dart'; /// Capitalization /// /// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet +/// * [smallCamel] +/// * [capitalCamel] +/// * [smallSnake] +/// * [capitalSnake] +/// * [sCAETHFlowPoints] +/// * [ATT_NAME] - Name of the pet @BuiltValue() -abstract class Capitalization - implements Built { +abstract class Capitalization implements Built { @BuiltValueField(wireName: r'smallCamel') String? get smallCamel; @@ -35,25 +34,22 @@ abstract class Capitalization @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') String? get sCAETHFlowPoints; - /// Name of the pet + /// Name of the pet @BuiltValueField(wireName: r'ATT_NAME') String? get ATT_NAME; Capitalization._(); - factory Capitalization([void updates(CapitalizationBuilder b)]) = - _$Capitalization; + factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; @BuiltValueHook(initializeBuilder: true) static void _defaults(CapitalizationBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$CapitalizationSerializer(); + static Serializer get serializer => _$CapitalizationSerializer(); } -class _$CapitalizationSerializer - implements PrimitiveSerializer { +class _$CapitalizationSerializer implements PrimitiveSerializer { @override final Iterable types = const [Capitalization, _$Capitalization]; @@ -115,9 +111,7 @@ class _$CapitalizationSerializer Capitalization object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -202,3 +196,10 @@ class _$CapitalizationSerializer return result.build(); } } + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart index a307712bb62e..0b824a6aa2f9 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart @@ -12,9 +12,9 @@ part 'cat.g.dart'; /// Cat /// /// Properties: -/// * [className] -/// * [color] -/// * [declawed] +/// * [className] +/// * [color] +/// * [declawed] @BuiltValue() abstract class Cat implements Animal, Built { @BuiltValueField(wireName: r'declawed') @@ -25,9 +25,8 @@ abstract class Cat implements Animal, Built { factory Cat([void updates(CatBuilder b)]) = _$Cat; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b - ..className = b.discriminatorValue - ..color = 'red'; + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); @@ -72,9 +71,7 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -138,3 +135,7 @@ class _$CatSerializer implements PrimitiveSerializer { return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart index 9c6f73f7df11..9d5449029f87 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart @@ -11,8 +11,8 @@ part 'category.g.dart'; /// Category /// /// Properties: -/// * [id] -/// * [name] +/// * [id] +/// * [name] @BuiltValue() abstract class Category implements Built { @BuiltValueField(wireName: r'id') @@ -26,7 +26,8 @@ abstract class Category implements Built { factory Category([void updates(CategoryBuilder b)]) = _$Category; @BuiltValueHook(initializeBuilder: true) - static void _defaults(CategoryBuilder b) => b..name = 'default-name'; + static void _defaults(CategoryBuilder b) => b + ..name = 'default-name'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CategorySerializer(); @@ -64,9 +65,7 @@ class _$CategorySerializer implements PrimitiveSerializer { Category object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -123,3 +122,6 @@ class _$CategorySerializer implements PrimitiveSerializer { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart index 74442b2e44ac..052af6bbd403 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart @@ -11,7 +11,7 @@ part 'class_model.g.dart'; /// Model for testing model with \"_class\" property /// /// Properties: -/// * [classField] +/// * [classField] @BuiltValue() abstract class ClassModel implements Built { @BuiltValueField(wireName: r'_class') @@ -55,9 +55,7 @@ class _$ClassModelSerializer implements PrimitiveSerializer { ClassModel object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$ClassModelSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart index 8767ad934402..a1d262bbd1e6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart @@ -13,12 +13,9 @@ part 'composed_disc_missing_from_properties.g.dart'; /// ComposedDiscMissingFromProperties /// /// Properties: -/// * [length] +/// * [length] @BuiltValue() -abstract class ComposedDiscMissingFromProperties - implements - Built { +abstract class ComposedDiscMissingFromProperties implements Built { /// One Of [DiscMissingFromProperties] OneOf get oneOf; @@ -30,45 +27,35 @@ abstract class ComposedDiscMissingFromProperties ComposedDiscMissingFromProperties._(); - factory ComposedDiscMissingFromProperties( - [void updates(ComposedDiscMissingFromPropertiesBuilder b)]) = - _$ComposedDiscMissingFromProperties; + factory ComposedDiscMissingFromProperties([void updates(ComposedDiscMissingFromPropertiesBuilder b)]) = _$ComposedDiscMissingFromProperties; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscMissingFromPropertiesBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscMissingFromPropertiesSerializer(); + static Serializer get serializer => _$ComposedDiscMissingFromPropertiesSerializer(); } -extension ComposedDiscMissingFromPropertiesDiscriminatorExt - on ComposedDiscMissingFromProperties { - String? get discriminatorValue { - if (this is DiscMissingFromProperties) { - return r'DiscMissingFromProperties'; +extension ComposedDiscMissingFromPropertiesDiscriminatorExt on ComposedDiscMissingFromProperties { + String? get discriminatorValue { + if (this is DiscMissingFromProperties) { + return r'DiscMissingFromProperties'; + } + return null; } - return null; - } } - -extension ComposedDiscMissingFromPropertiesBuilderDiscriminatorExt - on ComposedDiscMissingFromPropertiesBuilder { - String? get discriminatorValue { - if (this is DiscMissingFromPropertiesBuilder) { - return r'DiscMissingFromProperties'; +extension ComposedDiscMissingFromPropertiesBuilderDiscriminatorExt on ComposedDiscMissingFromPropertiesBuilder { + String? get discriminatorValue { + if (this is DiscMissingFromPropertiesBuilder) { + return r'DiscMissingFromProperties'; + } + return null; } - return null; - } } -class _$ComposedDiscMissingFromPropertiesSerializer - implements PrimitiveSerializer { +class _$ComposedDiscMissingFromPropertiesSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscMissingFromProperties, - _$ComposedDiscMissingFromProperties - ]; + final Iterable types = const [ComposedDiscMissingFromProperties, _$ComposedDiscMissingFromProperties]; @override final String wireName = r'ComposedDiscMissingFromProperties'; @@ -77,7 +64,8 @@ class _$ComposedDiscMissingFromPropertiesSerializer Serializers serializers, ComposedDiscMissingFromProperties object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -86,8 +74,7 @@ class _$ComposedDiscMissingFromPropertiesSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -99,15 +86,10 @@ class _$ComposedDiscMissingFromPropertiesSerializer final result = ComposedDiscMissingFromPropertiesBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscMissingFromProperties.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscMissingFromProperties.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscMissingFromProperties, - ]; + final oneOfTypes = [DiscMissingFromProperties, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -119,13 +101,11 @@ class _$ComposedDiscMissingFromPropertiesSerializer oneOfType = DiscMissingFromProperties; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart index fadcf3b8a5b2..18b7006591ee 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart @@ -13,12 +13,9 @@ part 'composed_disc_optional_type_correct.g.dart'; /// ComposedDiscOptionalTypeCorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscOptionalTypeCorrect - implements - Built { +abstract class ComposedDiscOptionalTypeCorrect implements Built { /// One Of [DiscOptionalTypeCorrect] OneOf get oneOf; @@ -30,45 +27,35 @@ abstract class ComposedDiscOptionalTypeCorrect ComposedDiscOptionalTypeCorrect._(); - factory ComposedDiscOptionalTypeCorrect( - [void updates(ComposedDiscOptionalTypeCorrectBuilder b)]) = - _$ComposedDiscOptionalTypeCorrect; + factory ComposedDiscOptionalTypeCorrect([void updates(ComposedDiscOptionalTypeCorrectBuilder b)]) = _$ComposedDiscOptionalTypeCorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscOptionalTypeCorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscOptionalTypeCorrectSerializer(); + static Serializer get serializer => _$ComposedDiscOptionalTypeCorrectSerializer(); } -extension ComposedDiscOptionalTypeCorrectDiscriminatorExt - on ComposedDiscOptionalTypeCorrect { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrect) { - return r'DiscOptionalTypeCorrect'; +extension ComposedDiscOptionalTypeCorrectDiscriminatorExt on ComposedDiscOptionalTypeCorrect { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + return null; } - return null; - } } - -extension ComposedDiscOptionalTypeCorrectBuilderDiscriminatorExt - on ComposedDiscOptionalTypeCorrectBuilder { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrectBuilder) { - return r'DiscOptionalTypeCorrect'; +extension ComposedDiscOptionalTypeCorrectBuilderDiscriminatorExt on ComposedDiscOptionalTypeCorrectBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + return null; } - return null; - } } -class _$ComposedDiscOptionalTypeCorrectSerializer - implements PrimitiveSerializer { +class _$ComposedDiscOptionalTypeCorrectSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscOptionalTypeCorrect, - _$ComposedDiscOptionalTypeCorrect - ]; + final Iterable types = const [ComposedDiscOptionalTypeCorrect, _$ComposedDiscOptionalTypeCorrect]; @override final String wireName = r'ComposedDiscOptionalTypeCorrect'; @@ -77,7 +64,8 @@ class _$ComposedDiscOptionalTypeCorrectSerializer Serializers serializers, ComposedDiscOptionalTypeCorrect object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -86,8 +74,7 @@ class _$ComposedDiscOptionalTypeCorrectSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -99,15 +86,10 @@ class _$ComposedDiscOptionalTypeCorrectSerializer final result = ComposedDiscOptionalTypeCorrectBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscOptionalTypeCorrect.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscOptionalTypeCorrect.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscOptionalTypeCorrect, - ]; + final oneOfTypes = [DiscOptionalTypeCorrect, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -119,13 +101,11 @@ class _$ComposedDiscOptionalTypeCorrectSerializer oneOfType = DiscOptionalTypeCorrect; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart index c4b3ecd2c73b..920bfbb7a38a 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart @@ -14,12 +14,9 @@ part 'composed_disc_optional_type_inconsistent.g.dart'; /// ComposedDiscOptionalTypeInconsistent /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscOptionalTypeInconsistent - implements - Built { +abstract class ComposedDiscOptionalTypeInconsistent implements Built { /// One Of [DiscOptionalTypeCorrect], [DiscOptionalTypeIncorrect] OneOf get oneOf; @@ -32,51 +29,41 @@ abstract class ComposedDiscOptionalTypeInconsistent ComposedDiscOptionalTypeInconsistent._(); - factory ComposedDiscOptionalTypeInconsistent( - [void updates(ComposedDiscOptionalTypeInconsistentBuilder b)]) = - _$ComposedDiscOptionalTypeInconsistent; + factory ComposedDiscOptionalTypeInconsistent([void updates(ComposedDiscOptionalTypeInconsistentBuilder b)]) = _$ComposedDiscOptionalTypeInconsistent; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscOptionalTypeInconsistentBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscOptionalTypeInconsistentSerializer(); + static Serializer get serializer => _$ComposedDiscOptionalTypeInconsistentSerializer(); } -extension ComposedDiscOptionalTypeInconsistentDiscriminatorExt - on ComposedDiscOptionalTypeInconsistent { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrect) { - return r'DiscOptionalTypeCorrect'; +extension ComposedDiscOptionalTypeInconsistentDiscriminatorExt on ComposedDiscOptionalTypeInconsistent { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + if (this is DiscOptionalTypeIncorrect) { + return r'DiscOptionalTypeIncorrect'; + } + return null; } - if (this is DiscOptionalTypeIncorrect) { - return r'DiscOptionalTypeIncorrect'; - } - return null; - } } - -extension ComposedDiscOptionalTypeInconsistentBuilderDiscriminatorExt - on ComposedDiscOptionalTypeInconsistentBuilder { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrectBuilder) { - return r'DiscOptionalTypeCorrect'; - } - if (this is DiscOptionalTypeIncorrectBuilder) { - return r'DiscOptionalTypeIncorrect'; +extension ComposedDiscOptionalTypeInconsistentBuilderDiscriminatorExt on ComposedDiscOptionalTypeInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + if (this is DiscOptionalTypeIncorrectBuilder) { + return r'DiscOptionalTypeIncorrect'; + } + return null; } - return null; - } } -class _$ComposedDiscOptionalTypeInconsistentSerializer - implements PrimitiveSerializer { +class _$ComposedDiscOptionalTypeInconsistentSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscOptionalTypeInconsistent, - _$ComposedDiscOptionalTypeInconsistent - ]; + final Iterable types = const [ComposedDiscOptionalTypeInconsistent, _$ComposedDiscOptionalTypeInconsistent]; @override final String wireName = r'ComposedDiscOptionalTypeInconsistent'; @@ -85,7 +72,8 @@ class _$ComposedDiscOptionalTypeInconsistentSerializer Serializers serializers, ComposedDiscOptionalTypeInconsistent object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -94,8 +82,7 @@ class _$ComposedDiscOptionalTypeInconsistentSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -107,16 +94,10 @@ class _$ComposedDiscOptionalTypeInconsistentSerializer final result = ComposedDiscOptionalTypeInconsistentBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf( - ComposedDiscOptionalTypeInconsistent.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscOptionalTypeInconsistent.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscOptionalTypeCorrect, - DiscOptionalTypeIncorrect, - ]; + final oneOfTypes = [DiscOptionalTypeCorrect, DiscOptionalTypeIncorrect, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -135,13 +116,11 @@ class _$ComposedDiscOptionalTypeInconsistentSerializer oneOfType = DiscOptionalTypeIncorrect; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart index 90485dd3d62b..677acaa61f00 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart @@ -13,12 +13,9 @@ part 'composed_disc_optional_type_incorrect.g.dart'; /// ComposedDiscOptionalTypeIncorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscOptionalTypeIncorrect - implements - Built { +abstract class ComposedDiscOptionalTypeIncorrect implements Built { /// One Of [DiscOptionalTypeIncorrect] OneOf get oneOf; @@ -30,45 +27,35 @@ abstract class ComposedDiscOptionalTypeIncorrect ComposedDiscOptionalTypeIncorrect._(); - factory ComposedDiscOptionalTypeIncorrect( - [void updates(ComposedDiscOptionalTypeIncorrectBuilder b)]) = - _$ComposedDiscOptionalTypeIncorrect; + factory ComposedDiscOptionalTypeIncorrect([void updates(ComposedDiscOptionalTypeIncorrectBuilder b)]) = _$ComposedDiscOptionalTypeIncorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscOptionalTypeIncorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscOptionalTypeIncorrectSerializer(); + static Serializer get serializer => _$ComposedDiscOptionalTypeIncorrectSerializer(); } -extension ComposedDiscOptionalTypeIncorrectDiscriminatorExt - on ComposedDiscOptionalTypeIncorrect { - String? get discriminatorValue { - if (this is DiscOptionalTypeIncorrect) { - return r'DiscOptionalTypeIncorrect'; +extension ComposedDiscOptionalTypeIncorrectDiscriminatorExt on ComposedDiscOptionalTypeIncorrect { + String? get discriminatorValue { + if (this is DiscOptionalTypeIncorrect) { + return r'DiscOptionalTypeIncorrect'; + } + return null; } - return null; - } } - -extension ComposedDiscOptionalTypeIncorrectBuilderDiscriminatorExt - on ComposedDiscOptionalTypeIncorrectBuilder { - String? get discriminatorValue { - if (this is DiscOptionalTypeIncorrectBuilder) { - return r'DiscOptionalTypeIncorrect'; +extension ComposedDiscOptionalTypeIncorrectBuilderDiscriminatorExt on ComposedDiscOptionalTypeIncorrectBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeIncorrectBuilder) { + return r'DiscOptionalTypeIncorrect'; + } + return null; } - return null; - } } -class _$ComposedDiscOptionalTypeIncorrectSerializer - implements PrimitiveSerializer { +class _$ComposedDiscOptionalTypeIncorrectSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscOptionalTypeIncorrect, - _$ComposedDiscOptionalTypeIncorrect - ]; + final Iterable types = const [ComposedDiscOptionalTypeIncorrect, _$ComposedDiscOptionalTypeIncorrect]; @override final String wireName = r'ComposedDiscOptionalTypeIncorrect'; @@ -77,7 +64,8 @@ class _$ComposedDiscOptionalTypeIncorrectSerializer Serializers serializers, ComposedDiscOptionalTypeIncorrect object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -86,8 +74,7 @@ class _$ComposedDiscOptionalTypeIncorrectSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -99,15 +86,10 @@ class _$ComposedDiscOptionalTypeIncorrectSerializer final result = ComposedDiscOptionalTypeIncorrectBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscOptionalTypeIncorrect.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscOptionalTypeIncorrect.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscOptionalTypeIncorrect, - ]; + final oneOfTypes = [DiscOptionalTypeIncorrect, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -119,13 +101,11 @@ class _$ComposedDiscOptionalTypeIncorrectSerializer oneOfType = DiscOptionalTypeIncorrect; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart index eb9a7999b103..8e78115eb210 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart @@ -14,12 +14,9 @@ part 'composed_disc_required_inconsistent.g.dart'; /// ComposedDiscRequiredInconsistent /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscRequiredInconsistent - implements - Built { +abstract class ComposedDiscRequiredInconsistent implements Built { /// One Of [DiscOptionalTypeCorrect], [FruitType] OneOf get oneOf; @@ -32,51 +29,41 @@ abstract class ComposedDiscRequiredInconsistent ComposedDiscRequiredInconsistent._(); - factory ComposedDiscRequiredInconsistent( - [void updates(ComposedDiscRequiredInconsistentBuilder b)]) = - _$ComposedDiscRequiredInconsistent; + factory ComposedDiscRequiredInconsistent([void updates(ComposedDiscRequiredInconsistentBuilder b)]) = _$ComposedDiscRequiredInconsistent; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscRequiredInconsistentBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscRequiredInconsistentSerializer(); + static Serializer get serializer => _$ComposedDiscRequiredInconsistentSerializer(); } -extension ComposedDiscRequiredInconsistentDiscriminatorExt - on ComposedDiscRequiredInconsistent { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrect) { - return r'DiscOptionalTypeCorrect'; +extension ComposedDiscRequiredInconsistentDiscriminatorExt on ComposedDiscRequiredInconsistent { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrect) { + return r'DiscOptionalTypeCorrect'; + } + if (this is FruitType) { + return r'FruitType'; + } + return null; } - if (this is FruitType) { - return r'FruitType'; - } - return null; - } } - -extension ComposedDiscRequiredInconsistentBuilderDiscriminatorExt - on ComposedDiscRequiredInconsistentBuilder { - String? get discriminatorValue { - if (this is DiscOptionalTypeCorrectBuilder) { - return r'DiscOptionalTypeCorrect'; - } - if (this is FruitTypeBuilder) { - return r'FruitType'; +extension ComposedDiscRequiredInconsistentBuilderDiscriminatorExt on ComposedDiscRequiredInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscOptionalTypeCorrectBuilder) { + return r'DiscOptionalTypeCorrect'; + } + if (this is FruitTypeBuilder) { + return r'FruitType'; + } + return null; } - return null; - } } -class _$ComposedDiscRequiredInconsistentSerializer - implements PrimitiveSerializer { +class _$ComposedDiscRequiredInconsistentSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscRequiredInconsistent, - _$ComposedDiscRequiredInconsistent - ]; + final Iterable types = const [ComposedDiscRequiredInconsistent, _$ComposedDiscRequiredInconsistent]; @override final String wireName = r'ComposedDiscRequiredInconsistent'; @@ -85,7 +72,8 @@ class _$ComposedDiscRequiredInconsistentSerializer Serializers serializers, ComposedDiscRequiredInconsistent object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -94,8 +82,7 @@ class _$ComposedDiscRequiredInconsistentSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -107,16 +94,10 @@ class _$ComposedDiscRequiredInconsistentSerializer final result = ComposedDiscRequiredInconsistentBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscRequiredInconsistent.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscRequiredInconsistent.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscOptionalTypeCorrect, - FruitType, - ]; + final oneOfTypes = [DiscOptionalTypeCorrect, FruitType, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -135,13 +116,11 @@ class _$ComposedDiscRequiredInconsistentSerializer oneOfType = FruitType; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart index 3d0a70bdd7d2..8840b659b8bf 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart @@ -14,12 +14,9 @@ part 'composed_disc_type_inconsistent.g.dart'; /// ComposedDiscTypeInconsistent /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscTypeInconsistent - implements - Built { +abstract class ComposedDiscTypeInconsistent implements Built { /// One Of [DiscTypeIncorrect], [FruitType] OneOf get oneOf; @@ -32,51 +29,41 @@ abstract class ComposedDiscTypeInconsistent ComposedDiscTypeInconsistent._(); - factory ComposedDiscTypeInconsistent( - [void updates(ComposedDiscTypeInconsistentBuilder b)]) = - _$ComposedDiscTypeInconsistent; + factory ComposedDiscTypeInconsistent([void updates(ComposedDiscTypeInconsistentBuilder b)]) = _$ComposedDiscTypeInconsistent; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscTypeInconsistentBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscTypeInconsistentSerializer(); + static Serializer get serializer => _$ComposedDiscTypeInconsistentSerializer(); } -extension ComposedDiscTypeInconsistentDiscriminatorExt - on ComposedDiscTypeInconsistent { - String? get discriminatorValue { - if (this is DiscTypeIncorrect) { - return r'DiscTypeIncorrect'; +extension ComposedDiscTypeInconsistentDiscriminatorExt on ComposedDiscTypeInconsistent { + String? get discriminatorValue { + if (this is DiscTypeIncorrect) { + return r'DiscTypeIncorrect'; + } + if (this is FruitType) { + return r'FruitType'; + } + return null; } - if (this is FruitType) { - return r'FruitType'; - } - return null; - } } - -extension ComposedDiscTypeInconsistentBuilderDiscriminatorExt - on ComposedDiscTypeInconsistentBuilder { - String? get discriminatorValue { - if (this is DiscTypeIncorrectBuilder) { - return r'DiscTypeIncorrect'; - } - if (this is FruitTypeBuilder) { - return r'FruitType'; +extension ComposedDiscTypeInconsistentBuilderDiscriminatorExt on ComposedDiscTypeInconsistentBuilder { + String? get discriminatorValue { + if (this is DiscTypeIncorrectBuilder) { + return r'DiscTypeIncorrect'; + } + if (this is FruitTypeBuilder) { + return r'FruitType'; + } + return null; } - return null; - } } -class _$ComposedDiscTypeInconsistentSerializer - implements PrimitiveSerializer { +class _$ComposedDiscTypeInconsistentSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscTypeInconsistent, - _$ComposedDiscTypeInconsistent - ]; + final Iterable types = const [ComposedDiscTypeInconsistent, _$ComposedDiscTypeInconsistent]; @override final String wireName = r'ComposedDiscTypeInconsistent'; @@ -85,7 +72,8 @@ class _$ComposedDiscTypeInconsistentSerializer Serializers serializers, ComposedDiscTypeInconsistent object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -94,8 +82,7 @@ class _$ComposedDiscTypeInconsistentSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -107,16 +94,10 @@ class _$ComposedDiscTypeInconsistentSerializer final result = ComposedDiscTypeInconsistentBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscTypeInconsistent.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscTypeInconsistent.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscTypeIncorrect, - FruitType, - ]; + final oneOfTypes = [DiscTypeIncorrect, FruitType, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -135,13 +116,11 @@ class _$ComposedDiscTypeInconsistentSerializer oneOfType = FruitType; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart index 8d9ddde74f60..537c8ac2af6b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart @@ -13,11 +13,9 @@ part 'composed_disc_type_incorrect.g.dart'; /// ComposedDiscTypeIncorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class ComposedDiscTypeIncorrect - implements - Built { +abstract class ComposedDiscTypeIncorrect implements Built { /// One Of [DiscTypeIncorrect] OneOf get oneOf; @@ -29,45 +27,35 @@ abstract class ComposedDiscTypeIncorrect ComposedDiscTypeIncorrect._(); - factory ComposedDiscTypeIncorrect( - [void updates(ComposedDiscTypeIncorrectBuilder b)]) = - _$ComposedDiscTypeIncorrect; + factory ComposedDiscTypeIncorrect([void updates(ComposedDiscTypeIncorrectBuilder b)]) = _$ComposedDiscTypeIncorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(ComposedDiscTypeIncorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ComposedDiscTypeIncorrectSerializer(); + static Serializer get serializer => _$ComposedDiscTypeIncorrectSerializer(); } -extension ComposedDiscTypeIncorrectDiscriminatorExt - on ComposedDiscTypeIncorrect { - String? get discriminatorValue { - if (this is DiscTypeIncorrect) { - return r'DiscTypeIncorrect'; +extension ComposedDiscTypeIncorrectDiscriminatorExt on ComposedDiscTypeIncorrect { + String? get discriminatorValue { + if (this is DiscTypeIncorrect) { + return r'DiscTypeIncorrect'; + } + return null; } - return null; - } } - -extension ComposedDiscTypeIncorrectBuilderDiscriminatorExt - on ComposedDiscTypeIncorrectBuilder { - String? get discriminatorValue { - if (this is DiscTypeIncorrectBuilder) { - return r'DiscTypeIncorrect'; +extension ComposedDiscTypeIncorrectBuilderDiscriminatorExt on ComposedDiscTypeIncorrectBuilder { + String? get discriminatorValue { + if (this is DiscTypeIncorrectBuilder) { + return r'DiscTypeIncorrect'; + } + return null; } - return null; - } } -class _$ComposedDiscTypeIncorrectSerializer - implements PrimitiveSerializer { +class _$ComposedDiscTypeIncorrectSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ComposedDiscTypeIncorrect, - _$ComposedDiscTypeIncorrect - ]; + final Iterable types = const [ComposedDiscTypeIncorrect, _$ComposedDiscTypeIncorrect]; @override final String wireName = r'ComposedDiscTypeIncorrect'; @@ -76,7 +64,8 @@ class _$ComposedDiscTypeIncorrectSerializer Serializers serializers, ComposedDiscTypeIncorrect object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -85,8 +74,7 @@ class _$ComposedDiscTypeIncorrectSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,15 +86,10 @@ class _$ComposedDiscTypeIncorrectSerializer final result = ComposedDiscTypeIncorrectBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList - .indexOf(ComposedDiscTypeIncorrect.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(ComposedDiscTypeIncorrect.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - DiscTypeIncorrect, - ]; + final oneOfTypes = [DiscTypeIncorrect, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -118,13 +101,11 @@ class _$ComposedDiscTypeIncorrectSerializer oneOfType = DiscTypeIncorrect; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart index 81ab5d242350..26316746daae 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart @@ -11,29 +11,25 @@ part 'deprecated_object.g.dart'; /// DeprecatedObject /// /// Properties: -/// * [name] +/// * [name] @Deprecated('DeprecatedObject has been deprecated') @BuiltValue() -abstract class DeprecatedObject - implements Built { +abstract class DeprecatedObject implements Built { @BuiltValueField(wireName: r'name') String? get name; DeprecatedObject._(); - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = - _$DeprecatedObject; + factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; @BuiltValueHook(initializeBuilder: true) static void _defaults(DeprecatedObjectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$DeprecatedObjectSerializer(); + static Serializer get serializer => _$DeprecatedObjectSerializer(); } -class _$DeprecatedObjectSerializer - implements PrimitiveSerializer { +class _$DeprecatedObjectSerializer implements PrimitiveSerializer { @override final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; @@ -60,9 +56,7 @@ class _$DeprecatedObjectSerializer DeprecatedObject object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -112,3 +106,5 @@ class _$DeprecatedObjectSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart index 41bbcaeb6912..7a87bdc60bc9 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart @@ -11,35 +11,26 @@ part 'disc_missing_from_properties.g.dart'; /// DiscMissingFromProperties /// /// Properties: -/// * [length] +/// * [length] @BuiltValue() -abstract class DiscMissingFromProperties - implements - Built { +abstract class DiscMissingFromProperties implements Built { @BuiltValueField(wireName: r'length') int? get length; DiscMissingFromProperties._(); - factory DiscMissingFromProperties( - [void updates(DiscMissingFromPropertiesBuilder b)]) = - _$DiscMissingFromProperties; + factory DiscMissingFromProperties([void updates(DiscMissingFromPropertiesBuilder b)]) = _$DiscMissingFromProperties; @BuiltValueHook(initializeBuilder: true) static void _defaults(DiscMissingFromPropertiesBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$DiscMissingFromPropertiesSerializer(); + static Serializer get serializer => _$DiscMissingFromPropertiesSerializer(); } -class _$DiscMissingFromPropertiesSerializer - implements PrimitiveSerializer { +class _$DiscMissingFromPropertiesSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - DiscMissingFromProperties, - _$DiscMissingFromProperties - ]; + final Iterable types = const [DiscMissingFromProperties, _$DiscMissingFromProperties]; @override final String wireName = r'DiscMissingFromProperties'; @@ -64,9 +55,7 @@ class _$DiscMissingFromPropertiesSerializer DiscMissingFromProperties object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -116,3 +105,5 @@ class _$DiscMissingFromPropertiesSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart index e8684ea767bc..aa7c73972a47 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart @@ -11,34 +11,26 @@ part 'disc_optional_type_correct.g.dart'; /// DiscOptionalTypeCorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class DiscOptionalTypeCorrect - implements Built { +abstract class DiscOptionalTypeCorrect implements Built { @BuiltValueField(wireName: r'fruitType') String? get fruitType; DiscOptionalTypeCorrect._(); - factory DiscOptionalTypeCorrect( - [void updates(DiscOptionalTypeCorrectBuilder b)]) = - _$DiscOptionalTypeCorrect; + factory DiscOptionalTypeCorrect([void updates(DiscOptionalTypeCorrectBuilder b)]) = _$DiscOptionalTypeCorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(DiscOptionalTypeCorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$DiscOptionalTypeCorrectSerializer(); + static Serializer get serializer => _$DiscOptionalTypeCorrectSerializer(); } -class _$DiscOptionalTypeCorrectSerializer - implements PrimitiveSerializer { +class _$DiscOptionalTypeCorrectSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - DiscOptionalTypeCorrect, - _$DiscOptionalTypeCorrect - ]; + final Iterable types = const [DiscOptionalTypeCorrect, _$DiscOptionalTypeCorrect]; @override final String wireName = r'DiscOptionalTypeCorrect'; @@ -63,9 +55,7 @@ class _$DiscOptionalTypeCorrectSerializer DiscOptionalTypeCorrect object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -115,3 +105,5 @@ class _$DiscOptionalTypeCorrectSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart index feab5c876672..9853fb88ebb8 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart @@ -11,35 +11,26 @@ part 'disc_optional_type_incorrect.g.dart'; /// DiscOptionalTypeIncorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class DiscOptionalTypeIncorrect - implements - Built { +abstract class DiscOptionalTypeIncorrect implements Built { @BuiltValueField(wireName: r'fruitType') int? get fruitType; DiscOptionalTypeIncorrect._(); - factory DiscOptionalTypeIncorrect( - [void updates(DiscOptionalTypeIncorrectBuilder b)]) = - _$DiscOptionalTypeIncorrect; + factory DiscOptionalTypeIncorrect([void updates(DiscOptionalTypeIncorrectBuilder b)]) = _$DiscOptionalTypeIncorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(DiscOptionalTypeIncorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$DiscOptionalTypeIncorrectSerializer(); + static Serializer get serializer => _$DiscOptionalTypeIncorrectSerializer(); } -class _$DiscOptionalTypeIncorrectSerializer - implements PrimitiveSerializer { +class _$DiscOptionalTypeIncorrectSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - DiscOptionalTypeIncorrect, - _$DiscOptionalTypeIncorrect - ]; + final Iterable types = const [DiscOptionalTypeIncorrect, _$DiscOptionalTypeIncorrect]; @override final String wireName = r'DiscOptionalTypeIncorrect'; @@ -64,9 +55,7 @@ class _$DiscOptionalTypeIncorrectSerializer DiscOptionalTypeIncorrect object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -116,3 +105,5 @@ class _$DiscOptionalTypeIncorrectSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart index 0a4d45595def..5662e401cc17 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart @@ -11,28 +11,24 @@ part 'disc_type_incorrect.g.dart'; /// DiscTypeIncorrect /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class DiscTypeIncorrect - implements Built { +abstract class DiscTypeIncorrect implements Built { @BuiltValueField(wireName: r'fruitType') int get fruitType; DiscTypeIncorrect._(); - factory DiscTypeIncorrect([void updates(DiscTypeIncorrectBuilder b)]) = - _$DiscTypeIncorrect; + factory DiscTypeIncorrect([void updates(DiscTypeIncorrectBuilder b)]) = _$DiscTypeIncorrect; @BuiltValueHook(initializeBuilder: true) static void _defaults(DiscTypeIncorrectBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$DiscTypeIncorrectSerializer(); + static Serializer get serializer => _$DiscTypeIncorrectSerializer(); } -class _$DiscTypeIncorrectSerializer - implements PrimitiveSerializer { +class _$DiscTypeIncorrectSerializer implements PrimitiveSerializer { @override final Iterable types = const [DiscTypeIncorrect, _$DiscTypeIncorrect]; @@ -57,9 +53,7 @@ class _$DiscTypeIncorrectSerializer DiscTypeIncorrect object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -109,3 +103,5 @@ class _$DiscTypeIncorrectSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart index cb6946709144..fb05604d6bd4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart @@ -12,9 +12,9 @@ part 'dog.g.dart'; /// Dog /// /// Properties: -/// * [className] -/// * [color] -/// * [breed] +/// * [className] +/// * [color] +/// * [breed] @BuiltValue() abstract class Dog implements Animal, Built { @BuiltValueField(wireName: r'breed') @@ -25,9 +25,8 @@ abstract class Dog implements Animal, Built { factory Dog([void updates(DogBuilder b)]) = _$Dog; @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b - ..className = b.discriminatorValue - ..color = 'red'; + static void _defaults(DogBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$DogSerializer(); @@ -72,9 +71,7 @@ class _$DogSerializer implements PrimitiveSerializer { Dog object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -138,3 +135,7 @@ class _$DogSerializer implements PrimitiveSerializer { return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart index 56cc04c50eb0..64252003bc51 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart @@ -42,51 +42,50 @@ abstract class Entity implements Addressable, Extensible { } extension EntityDiscriminatorExt on Entity { - String? get discriminatorValue { - if (this is Bar) { - return r'Bar'; + String? get discriminatorValue { + if (this is Bar) { + return r'Bar'; + } + if (this is BarCreate) { + return r'Bar_Create'; + } + if (this is Foo) { + return r'Foo'; + } + if (this is Pasta) { + return r'Pasta'; + } + if (this is Pizza) { + return r'Pizza'; + } + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; } - if (this is BarCreate) { - return r'Bar_Create'; - } - if (this is Foo) { - return r'Foo'; - } - if (this is Pasta) { - return r'Pasta'; - } - if (this is Pizza) { - return r'Pizza'; - } - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; - } - return null; - } } - extension EntityBuilderDiscriminatorExt on EntityBuilder { - String? get discriminatorValue { - if (this is BarBuilder) { - return r'Bar'; + String? get discriminatorValue { + if (this is BarBuilder) { + return r'Bar'; + } + if (this is BarCreateBuilder) { + return r'Bar_Create'; + } + if (this is FooBuilder) { + return r'Foo'; + } + if (this is PastaBuilder) { + return r'Pasta'; + } + if (this is PizzaBuilder) { + return r'Pizza'; + } + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; } - if (this is BarCreateBuilder) { - return r'Bar_Create'; - } - if (this is FooBuilder) { - return r'Foo'; - } - if (this is PastaBuilder) { - return r'Pasta'; - } - if (this is PizzaBuilder) { - return r'Pizza'; - } - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; - } - return null; - } } class _$EntitySerializer implements PrimitiveSerializer { @@ -158,12 +157,9 @@ class _$EntitySerializer implements PrimitiveSerializer { return serializers.serialize(object, specifiedType: FullType(Pizza))!; } if (object is PizzaSpeziale) { - return serializers.serialize(object, - specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -174,30 +170,22 @@ class _$EntitySerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Entity.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; switch (discValue) { case r'Bar': - return serializers.deserialize(serialized, specifiedType: FullType(Bar)) - as Bar; + return serializers.deserialize(serialized, specifiedType: FullType(Bar)) as Bar; case r'Bar_Create': - return serializers.deserialize(serialized, - specifiedType: FullType(BarCreate)) as BarCreate; + return serializers.deserialize(serialized, specifiedType: FullType(BarCreate)) as BarCreate; case r'Foo': - return serializers.deserialize(serialized, specifiedType: FullType(Foo)) - as Foo; + return serializers.deserialize(serialized, specifiedType: FullType(Foo)) as Foo; case r'Pasta': - return serializers.deserialize(serialized, - specifiedType: FullType(Pasta)) as Pasta; + return serializers.deserialize(serialized, specifiedType: FullType(Pasta)) as Pasta; case r'Pizza': - return serializers.deserialize(serialized, - specifiedType: FullType(Pizza)) as Pizza; + return serializers.deserialize(serialized, specifiedType: FullType(Pizza)) as Pizza; case r'PizzaSpeziale': - return serializers.deserialize(serialized, - specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, - specifiedType: FullType($Entity)) as $Entity; + return serializers.deserialize(serialized, specifiedType: FullType($Entity)) as $Entity; } } } @@ -307,3 +295,9 @@ class _$$EntitySerializer implements PrimitiveSerializer<$Entity> { return result.build(); } } + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart index 669bbc6293bf..114a7781a664 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart @@ -44,27 +44,26 @@ abstract class EntityRef implements Addressable, Extensible { } extension EntityRefDiscriminatorExt on EntityRef { - String? get discriminatorValue { - if (this is BarRef) { - return r'BarRef'; + String? get discriminatorValue { + if (this is BarRef) { + return r'BarRef'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; } - if (this is FooRef) { - return r'FooRef'; - } - return null; - } } - extension EntityRefBuilderDiscriminatorExt on EntityRefBuilder { - String? get discriminatorValue { - if (this is BarRefBuilder) { - return r'BarRef'; + String? get discriminatorValue { + if (this is BarRefBuilder) { + return r'BarRef'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; } - if (this is FooRefBuilder) { - return r'FooRef'; - } - return null; - } } class _$EntityRefSerializer implements PrimitiveSerializer { @@ -140,9 +139,7 @@ class _$EntityRefSerializer implements PrimitiveSerializer { if (object is FooRef) { return serializers.serialize(object, specifiedType: FullType(FooRef))!; } - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -152,32 +149,25 @@ class _$EntityRefSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(EntityRef.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; switch (discValue) { case r'BarRef': - return serializers.deserialize(serialized, - specifiedType: FullType(BarRef)) as BarRef; + return serializers.deserialize(serialized, specifiedType: FullType(BarRef)) as BarRef; case r'FooRef': - return serializers.deserialize(serialized, - specifiedType: FullType(FooRef)) as FooRef; + return serializers.deserialize(serialized, specifiedType: FullType(FooRef)) as FooRef; default: - return serializers.deserialize(serialized, - specifiedType: FullType($EntityRef)) as $EntityRef; + return serializers.deserialize(serialized, specifiedType: FullType($EntityRef)) as $EntityRef; } } } /// a concrete implementation of [EntityRef], since [EntityRef] is not instantiable @BuiltValue(instantiable: true) -abstract class $EntityRef - implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { +abstract class $EntityRef implements EntityRef, Built<$EntityRef, $EntityRefBuilder> { $EntityRef._(); - factory $EntityRef([void Function($EntityRefBuilder)? updates]) = - _$$EntityRef; + factory $EntityRef([void Function($EntityRefBuilder)? updates]) = _$$EntityRef; @BuiltValueHook(initializeBuilder: true) static void _defaults($EntityRefBuilder b) => b; @@ -291,3 +281,11 @@ class _$$EntityRefSerializer implements PrimitiveSerializer<$EntityRef> { return result.build(); } } + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart index 2c8e3e6e4bb8..643510da5bad 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart @@ -12,8 +12,8 @@ part 'enum_arrays.g.dart'; /// EnumArrays /// /// Properties: -/// * [justSymbol] -/// * [arrayEnum] +/// * [justSymbol] +/// * [arrayEnum] @BuiltValue() abstract class EnumArrays implements Built { @BuiltValueField(wireName: r'just_symbol') @@ -58,8 +58,7 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { yield r'array_enum'; yield serializers.serialize( object.arrayEnum, - specifiedType: - const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ); } } @@ -70,9 +69,7 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { EnumArrays object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -97,8 +94,7 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { case r'array_enum': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), + specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]), ) as BuiltList; result.arrayEnum.replace(valueDes); break; @@ -130,45 +126,39 @@ class _$EnumArraysSerializer implements PrimitiveSerializer { return result.build(); } } - class EnumArraysJustSymbolEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = - _$enumArraysJustSymbolEnum_greaterThanEqual; + static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = - _$enumArraysJustSymbolEnum_dollar; + static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = - _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; + static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumArraysJustSymbolEnumSerializer; + static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; - const EnumArraysJustSymbolEnum._(String name) : super(name); + const EnumArraysJustSymbolEnum._(String name): super(name); - static BuiltSet get values => - _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => - _$enumArraysJustSymbolEnumValueOf(name); + static BuiltSet get values => _$enumArraysJustSymbolEnumValues; + static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); } - + class EnumArraysArrayEnumEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'fish') static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; @BuiltValueEnumConst(wireName: r'crab') static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = - _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; + static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumArraysArrayEnumEnumSerializer; + static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; - const EnumArraysArrayEnumEnum._(String name) : super(name); + const EnumArraysArrayEnumEnum._(String name): super(name); - static BuiltSet get values => - _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => - _$enumArraysArrayEnumEnumValueOf(name); + static BuiltSet get values => _$enumArraysArrayEnumEnumValues; + static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart index effda132acdd..545f877da71b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart @@ -16,14 +16,14 @@ part 'enum_test.g.dart'; /// EnumTest /// /// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] +/// * [enumString] +/// * [enumStringRequired] +/// * [enumInteger] +/// * [enumNumber] +/// * [outerEnum] +/// * [outerEnumInteger] +/// * [outerEnumDefaultValue] +/// * [outerEnumIntegerDefaultValue] @BuiltValue() abstract class EnumTest implements Built { @BuiltValueField(wireName: r'enum_string') @@ -143,9 +143,7 @@ class _$EnumTestSerializer implements PrimitiveSerializer { EnumTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -245,8 +243,8 @@ class _$EnumTestSerializer implements PrimitiveSerializer { return result.build(); } } - class EnumTestEnumStringEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'UPPER') static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') @@ -254,85 +252,71 @@ class EnumTestEnumStringEnum extends EnumClass { @BuiltValueEnumConst(wireName: r'') static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringEnum unknownDefaultOpenApi = - _$enumTestEnumStringEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumTestEnumStringEnumSerializer; + static Serializer get serializer => _$enumTestEnumStringEnumSerializer; - const EnumTestEnumStringEnum._(String name) : super(name); + const EnumTestEnumStringEnum._(String name): super(name); - static BuiltSet get values => - _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => - _$enumTestEnumStringEnumValueOf(name); + static BuiltSet get values => _$enumTestEnumStringEnumValues; + static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); } - + class EnumTestEnumStringRequiredEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = - _$enumTestEnumStringRequiredEnum_UPPER; + static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = - _$enumTestEnumStringRequiredEnum_lower; + static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = - _$enumTestEnumStringRequiredEnum_empty; + static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = - _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; + static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumTestEnumStringRequiredEnumSerializer; + static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; - const EnumTestEnumStringRequiredEnum._(String name) : super(name); + const EnumTestEnumStringRequiredEnum._(String name): super(name); - static BuiltSet get values => - _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => - _$enumTestEnumStringRequiredEnumValueOf(name); + static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; + static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); } - + class EnumTestEnumIntegerEnum extends EnumClass { + @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = - _$enumTestEnumIntegerEnum_number1; + static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = - _$enumTestEnumIntegerEnum_numberNegative1; + static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = - _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; + static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumTestEnumIntegerEnumSerializer; + static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; - const EnumTestEnumIntegerEnum._(String name) : super(name); + const EnumTestEnumIntegerEnum._(String name): super(name); - static BuiltSet get values => - _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => - _$enumTestEnumIntegerEnumValueOf(name); + static BuiltSet get values => _$enumTestEnumIntegerEnumValues; + static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); } - + class EnumTestEnumNumberEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = - _$enumTestEnumNumberEnum_number1Period1; + static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = - _$enumTestEnumNumberEnum_numberNegative1Period2; + static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; @BuiltValueEnumConst(wireName: r'11184809', fallback: true) - static const EnumTestEnumNumberEnum unknownDefaultOpenApi = - _$enumTestEnumNumberEnum_unknownDefaultOpenApi; + static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$enumTestEnumNumberEnumSerializer; + static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; - const EnumTestEnumNumberEnum._(String name) : super(name); + const EnumTestEnumNumberEnum._(String name): super(name); - static BuiltSet get values => - _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => - _$enumTestEnumNumberEnumValueOf(name); + static BuiltSet get values => _$enumTestEnumNumberEnumValues; + static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); } + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart index 4751e487f2cd..f59fce5acc86 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart @@ -15,7 +15,7 @@ part 'extensible.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue(instantiable: false) -abstract class Extensible { +abstract class Extensible { /// A URI to a JSON-Schema file that defines additional attributes and relationships @BuiltValueField(wireName: r'@schemaLocation') String? get atSchemaLocation; @@ -71,9 +71,7 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Extensible object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -82,19 +80,16 @@ class _$ExtensibleSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, - specifiedType: FullType($Extensible)) as $Extensible; + return serializers.deserialize(serialized, specifiedType: FullType($Extensible)) as $Extensible; } } /// a concrete implementation of [Extensible], since [Extensible] is not instantiable @BuiltValue(instantiable: true) -abstract class $Extensible - implements Extensible, Built<$Extensible, $ExtensibleBuilder> { +abstract class $Extensible implements Extensible, Built<$Extensible, $ExtensibleBuilder> { $Extensible._(); - factory $Extensible([void Function($ExtensibleBuilder)? updates]) = - _$$Extensible; + factory $Extensible([void Function($ExtensibleBuilder)? updates]) = _$$Extensible; @BuiltValueHook(initializeBuilder: true) static void _defaults($ExtensibleBuilder b) => b; @@ -180,3 +175,7 @@ class _$$ExtensibleSerializer implements PrimitiveSerializer<$Extensible> { return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart index e28ed72311d5..407904d642dd 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart @@ -13,11 +13,10 @@ part 'file_schema_test_class.g.dart'; /// FileSchemaTestClass /// /// Properties: -/// * [file] -/// * [files] +/// * [file] +/// * [files] @BuiltValue() -abstract class FileSchemaTestClass - implements Built { +abstract class FileSchemaTestClass implements Built { @BuiltValueField(wireName: r'file') ModelFile? get file; @@ -26,24 +25,18 @@ abstract class FileSchemaTestClass FileSchemaTestClass._(); - factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = - _$FileSchemaTestClass; + factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; @BuiltValueHook(initializeBuilder: true) static void _defaults(FileSchemaTestClassBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FileSchemaTestClassSerializer(); + static Serializer get serializer => _$FileSchemaTestClassSerializer(); } -class _$FileSchemaTestClassSerializer - implements PrimitiveSerializer { +class _$FileSchemaTestClassSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FileSchemaTestClass, - _$FileSchemaTestClass - ]; + final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; @override final String wireName = r'FileSchemaTestClass'; @@ -75,9 +68,7 @@ class _$FileSchemaTestClassSerializer FileSchemaTestClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -134,3 +125,6 @@ class _$FileSchemaTestClassSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart index 79b1c7a7cda9..e8526dc76f6f 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart @@ -12,8 +12,8 @@ part 'foo.g.dart'; /// Foo /// /// Properties: -/// * [fooPropA] -/// * [fooPropB] +/// * [fooPropA] +/// * [fooPropB] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -32,7 +32,7 @@ abstract class Foo implements Entity, Built { factory Foo([void updates(FooBuilder b)]) = _$Foo; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(FooBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooSerializer(); @@ -105,9 +105,7 @@ class _$FooSerializer implements PrimitiveSerializer { Foo object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -199,3 +197,11 @@ class _$FooSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart index 30d1edd3b03d..3def44899a7a 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart @@ -12,35 +12,26 @@ part 'foo_basic_get_default_response.g.dart'; /// FooBasicGetDefaultResponse /// /// Properties: -/// * [string] +/// * [string] @BuiltValue() -abstract class FooBasicGetDefaultResponse - implements - Built { +abstract class FooBasicGetDefaultResponse implements Built { @BuiltValueField(wireName: r'string') Foo? get string; FooBasicGetDefaultResponse._(); - factory FooBasicGetDefaultResponse( - [void updates(FooBasicGetDefaultResponseBuilder b)]) = - _$FooBasicGetDefaultResponse; + factory FooBasicGetDefaultResponse([void updates(FooBasicGetDefaultResponseBuilder b)]) = _$FooBasicGetDefaultResponse; @BuiltValueHook(initializeBuilder: true) static void _defaults(FooBasicGetDefaultResponseBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FooBasicGetDefaultResponseSerializer(); + static Serializer get serializer => _$FooBasicGetDefaultResponseSerializer(); } -class _$FooBasicGetDefaultResponseSerializer - implements PrimitiveSerializer { +class _$FooBasicGetDefaultResponseSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FooBasicGetDefaultResponse, - _$FooBasicGetDefaultResponse - ]; + final Iterable types = const [FooBasicGetDefaultResponse, _$FooBasicGetDefaultResponse]; @override final String wireName = r'FooBasicGetDefaultResponse'; @@ -65,9 +56,7 @@ class _$FooBasicGetDefaultResponseSerializer FooBasicGetDefaultResponse object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -117,3 +106,5 @@ class _$FooBasicGetDefaultResponseSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart index e62d40ce6b2e..a745a070b3b6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart @@ -12,7 +12,7 @@ part 'foo_ref.g.dart'; /// FooRef /// /// Properties: -/// * [foorefPropA] +/// * [foorefPropA] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -28,7 +28,7 @@ abstract class FooRef implements EntityRef, Built { factory FooRef([void updates(FooRefBuilder b)]) = _$FooRef; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooRefBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(FooRefBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$FooRefSerializer(); @@ -108,9 +108,7 @@ class _$FooRefSerializer implements PrimitiveSerializer { FooRef object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -209,3 +207,10 @@ class _$FooRefSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart index 896800fb01f8..811b97904247 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart @@ -20,8 +20,7 @@ part 'foo_ref_or_value.g.dart'; /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class FooRefOrValue - implements Built { +abstract class FooRefOrValue implements Built { /// One Of [Foo], [FooRef] OneOf get oneOf; @@ -34,39 +33,36 @@ abstract class FooRefOrValue FooRefOrValue._(); - factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = - _$FooRefOrValue; + factory FooRefOrValue([void updates(FooRefOrValueBuilder b)]) = _$FooRefOrValue; @BuiltValueHook(initializeBuilder: true) static void _defaults(FooRefOrValueBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FooRefOrValueSerializer(); + static Serializer get serializer => _$FooRefOrValueSerializer(); } extension FooRefOrValueDiscriminatorExt on FooRefOrValue { - String? get discriminatorValue { - if (this is Foo) { - return r'Foo'; + String? get discriminatorValue { + if (this is Foo) { + return r'Foo'; + } + if (this is FooRef) { + return r'FooRef'; + } + return null; } - if (this is FooRef) { - return r'FooRef'; - } - return null; - } } - extension FooRefOrValueBuilderDiscriminatorExt on FooRefOrValueBuilder { - String? get discriminatorValue { - if (this is FooBuilder) { - return r'Foo'; - } - if (this is FooRefBuilder) { - return r'FooRef'; + String? get discriminatorValue { + if (this is FooBuilder) { + return r'Foo'; + } + if (this is FooRefBuilder) { + return r'FooRef'; + } + return null; } - return null; - } } class _$FooRefOrValueSerializer implements PrimitiveSerializer { @@ -80,7 +76,8 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { Serializers serializers, FooRefOrValue object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -89,8 +86,7 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -102,15 +98,10 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { final result = FooRefOrValueBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FooRefOrValue.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - Foo, - FooRef, - ]; + final oneOfTypes = [Foo, FooRef, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -129,13 +120,15 @@ class _$FooRefOrValueSerializer implements PrimitiveSerializer { oneOfType = FooRef; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart index 771056f35226..9d3aa3411749 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart @@ -13,20 +13,20 @@ part 'format_test.g.dart'; /// FormatTest /// /// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] +/// * [integer] +/// * [int32] +/// * [int64] +/// * [number] +/// * [float] +/// * [double_] +/// * [decimal] +/// * [string] +/// * [byte] +/// * [binary] +/// * [date] +/// * [dateTime] +/// * [uuid] +/// * [password] /// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. /// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. @BuiltValue() @@ -216,9 +216,7 @@ class _$FormatTestSerializer implements PrimitiveSerializer { FormatTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -373,3 +371,20 @@ class _$FormatTestSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart index 5c31531d9e55..1dbab1cda8c6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart @@ -14,9 +14,9 @@ part 'fruit.g.dart'; /// Fruit /// /// Properties: -/// * [color] -/// * [kind] -/// * [count] +/// * [color] +/// * [kind] +/// * [count] @BuiltValue() abstract class Fruit implements Built { @BuiltValueField(wireName: r'color') @@ -64,11 +64,8 @@ class _$FruitSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -107,10 +104,7 @@ class _$FruitSerializer implements PrimitiveSerializer { }) { final result = FruitBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(Apple), - FullType(Banana), - ]); + final targetType = const FullType(OneOf, [FullType(Apple), FullType(Banana), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -122,8 +116,11 @@ class _$FruitSerializer implements PrimitiveSerializer { result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart index c92bbee0bd0a..544c68d2d289 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart @@ -14,10 +14,9 @@ part 'fruit_all_of_disc.g.dart'; /// FruitAllOfDisc /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitAllOfDisc - implements Built { +abstract class FruitAllOfDisc implements Built { /// One Of [AppleAllOfDisc], [BananaAllOfDisc] OneOf get oneOf; @@ -30,43 +29,39 @@ abstract class FruitAllOfDisc FruitAllOfDisc._(); - factory FruitAllOfDisc([void updates(FruitAllOfDiscBuilder b)]) = - _$FruitAllOfDisc; + factory FruitAllOfDisc([void updates(FruitAllOfDiscBuilder b)]) = _$FruitAllOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitAllOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitAllOfDiscSerializer(); + static Serializer get serializer => _$FruitAllOfDiscSerializer(); } extension FruitAllOfDiscDiscriminatorExt on FruitAllOfDisc { - String? get discriminatorValue { - if (this is AppleAllOfDisc) { - return r'AppleAllOfDisc'; + String? get discriminatorValue { + if (this is AppleAllOfDisc) { + return r'AppleAllOfDisc'; + } + if (this is BananaAllOfDisc) { + return r'BananaAllOfDisc'; + } + return null; } - if (this is BananaAllOfDisc) { - return r'BananaAllOfDisc'; - } - return null; - } } - extension FruitAllOfDiscBuilderDiscriminatorExt on FruitAllOfDiscBuilder { - String? get discriminatorValue { - if (this is AppleAllOfDiscBuilder) { - return r'AppleAllOfDisc'; - } - if (this is BananaAllOfDiscBuilder) { - return r'BananaAllOfDisc'; + String? get discriminatorValue { + if (this is AppleAllOfDiscBuilder) { + return r'AppleAllOfDisc'; + } + if (this is BananaAllOfDiscBuilder) { + return r'BananaAllOfDisc'; + } + return null; } - return null; - } } -class _$FruitAllOfDiscSerializer - implements PrimitiveSerializer { +class _$FruitAllOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [FruitAllOfDisc, _$FruitAllOfDisc]; @@ -77,7 +72,8 @@ class _$FruitAllOfDiscSerializer Serializers serializers, FruitAllOfDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -86,8 +82,7 @@ class _$FruitAllOfDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -99,15 +94,10 @@ class _$FruitAllOfDiscSerializer final result = FruitAllOfDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitAllOfDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitAllOfDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - AppleAllOfDisc, - BananaAllOfDisc, - ]; + final oneOfTypes = [AppleAllOfDisc, BananaAllOfDisc, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -126,13 +116,11 @@ class _$FruitAllOfDiscSerializer oneOfType = BananaAllOfDisc; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart index 72b65b0c3808..7510a7493413 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart @@ -15,29 +15,24 @@ part 'fruit_any_of_disc.g.dart'; /// FruitAnyOfDisc /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitAnyOfDisc - implements Built { +abstract class FruitAnyOfDisc implements Built { /// Any Of [FruitType] AnyOf get anyOf; FruitAnyOfDisc._(); - factory FruitAnyOfDisc([void updates(FruitAnyOfDiscBuilder b)]) = - _$FruitAnyOfDisc; + factory FruitAnyOfDisc([void updates(FruitAnyOfDiscBuilder b)]) = _$FruitAnyOfDisc; @BuiltValueHook(initializeBuilder: true) - static void _defaults(FruitAnyOfDiscBuilder b) => - b..fruitType = b.discriminatorValue; + static void _defaults(FruitAnyOfDiscBuilder b) => b..fruitType=b.discriminatorValue; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitAnyOfDiscSerializer(); + static Serializer get serializer => _$FruitAnyOfDiscSerializer(); } -class _$FruitAnyOfDiscSerializer - implements PrimitiveSerializer { +class _$FruitAnyOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [FruitAnyOfDisc, _$FruitAnyOfDisc]; @@ -48,7 +43,8 @@ class _$FruitAnyOfDiscSerializer Serializers serializers, FruitAnyOfDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -57,9 +53,7 @@ class _$FruitAnyOfDiscSerializer FullType specifiedType = FullType.unspecified, }) { final anyOf = object.anyOf; - return serializers.serialize(anyOf, - specifiedType: FullType( - AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()))!; + return serializers.serialize(anyOf, specifiedType: FullType(AnyOf, anyOf.valueTypes.map((type) => FullType(type)).toList()))!; } @override @@ -73,3 +67,5 @@ class _$FruitAnyOfDiscSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart index a8b2a98adf0f..87c150bae757 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart @@ -14,10 +14,9 @@ part 'fruit_grandparent_disc.g.dart'; /// FruitGrandparentDisc /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitGrandparentDisc - implements Built { +abstract class FruitGrandparentDisc implements Built { /// One Of [AppleGrandparentDisc], [BananaGrandparentDisc] OneOf get oneOf; @@ -30,49 +29,41 @@ abstract class FruitGrandparentDisc FruitGrandparentDisc._(); - factory FruitGrandparentDisc([void updates(FruitGrandparentDiscBuilder b)]) = - _$FruitGrandparentDisc; + factory FruitGrandparentDisc([void updates(FruitGrandparentDiscBuilder b)]) = _$FruitGrandparentDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitGrandparentDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitGrandparentDiscSerializer(); + static Serializer get serializer => _$FruitGrandparentDiscSerializer(); } extension FruitGrandparentDiscDiscriminatorExt on FruitGrandparentDisc { - String? get discriminatorValue { - if (this is AppleGrandparentDisc) { - return r'AppleGrandparentDisc'; + String? get discriminatorValue { + if (this is AppleGrandparentDisc) { + return r'AppleGrandparentDisc'; + } + if (this is BananaGrandparentDisc) { + return r'BananaGrandparentDisc'; + } + return null; } - if (this is BananaGrandparentDisc) { - return r'BananaGrandparentDisc'; - } - return null; - } } - -extension FruitGrandparentDiscBuilderDiscriminatorExt - on FruitGrandparentDiscBuilder { - String? get discriminatorValue { - if (this is AppleGrandparentDiscBuilder) { - return r'AppleGrandparentDisc'; - } - if (this is BananaGrandparentDiscBuilder) { - return r'BananaGrandparentDisc'; +extension FruitGrandparentDiscBuilderDiscriminatorExt on FruitGrandparentDiscBuilder { + String? get discriminatorValue { + if (this is AppleGrandparentDiscBuilder) { + return r'AppleGrandparentDisc'; + } + if (this is BananaGrandparentDiscBuilder) { + return r'BananaGrandparentDisc'; + } + return null; } - return null; - } } -class _$FruitGrandparentDiscSerializer - implements PrimitiveSerializer { +class _$FruitGrandparentDiscSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitGrandparentDisc, - _$FruitGrandparentDisc - ]; + final Iterable types = const [FruitGrandparentDisc, _$FruitGrandparentDisc]; @override final String wireName = r'FruitGrandparentDisc'; @@ -81,7 +72,8 @@ class _$FruitGrandparentDiscSerializer Serializers serializers, FruitGrandparentDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -90,8 +82,7 @@ class _$FruitGrandparentDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -103,15 +94,10 @@ class _$FruitGrandparentDiscSerializer final result = FruitGrandparentDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitGrandparentDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitGrandparentDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - AppleGrandparentDisc, - BananaGrandparentDisc, - ]; + final oneOfTypes = [AppleGrandparentDisc, BananaGrandparentDisc, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -130,13 +116,11 @@ class _$FruitGrandparentDiscSerializer oneOfType = BananaGrandparentDisc; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart index 6d5d1ab657d6..b7828faadc07 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart @@ -14,12 +14,11 @@ part 'fruit_inline_disc.g.dart'; /// FruitInlineDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] -/// * [length] +/// * [seeds] +/// * [fruitType] +/// * [length] @BuiltValue() -abstract class FruitInlineDisc - implements Built { +abstract class FruitInlineDisc implements Built { /// One Of [FruitInlineDiscOneOf], [FruitInlineDiscOneOf1] OneOf get oneOf; @@ -32,43 +31,39 @@ abstract class FruitInlineDisc FruitInlineDisc._(); - factory FruitInlineDisc([void updates(FruitInlineDiscBuilder b)]) = - _$FruitInlineDisc; + factory FruitInlineDisc([void updates(FruitInlineDiscBuilder b)]) = _$FruitInlineDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineDiscSerializer(); + static Serializer get serializer => _$FruitInlineDiscSerializer(); } extension FruitInlineDiscDiscriminatorExt on FruitInlineDisc { - String? get discriminatorValue { - if (this is FruitInlineDiscOneOf) { - return r'FruitInlineDisc_oneOf'; + String? get discriminatorValue { + if (this is FruitInlineDiscOneOf) { + return r'FruitInlineDisc_oneOf'; + } + if (this is FruitInlineDiscOneOf1) { + return r'FruitInlineDisc_oneOf_1'; + } + return null; } - if (this is FruitInlineDiscOneOf1) { - return r'FruitInlineDisc_oneOf_1'; - } - return null; - } } - extension FruitInlineDiscBuilderDiscriminatorExt on FruitInlineDiscBuilder { - String? get discriminatorValue { - if (this is FruitInlineDiscOneOfBuilder) { - return r'FruitInlineDisc_oneOf'; - } - if (this is FruitInlineDiscOneOf1Builder) { - return r'FruitInlineDisc_oneOf_1'; + String? get discriminatorValue { + if (this is FruitInlineDiscOneOfBuilder) { + return r'FruitInlineDisc_oneOf'; + } + if (this is FruitInlineDiscOneOf1Builder) { + return r'FruitInlineDisc_oneOf_1'; + } + return null; } - return null; - } } -class _$FruitInlineDiscSerializer - implements PrimitiveSerializer { +class _$FruitInlineDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [FruitInlineDisc, _$FruitInlineDisc]; @@ -79,7 +74,8 @@ class _$FruitInlineDiscSerializer Serializers serializers, FruitInlineDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -88,8 +84,7 @@ class _$FruitInlineDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -101,15 +96,10 @@ class _$FruitInlineDiscSerializer final result = FruitInlineDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitInlineDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitInlineDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - FruitInlineDiscOneOf, - FruitInlineDiscOneOf1, - ]; + final oneOfTypes = [FruitInlineDiscOneOf, FruitInlineDiscOneOf1, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -128,13 +118,13 @@ class _$FruitInlineDiscSerializer oneOfType = FruitInlineDiscOneOf1; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart index 2c976acc688c..f0260fccbd7d 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart @@ -11,11 +11,10 @@ part 'fruit_inline_disc_one_of.g.dart'; /// FruitInlineDiscOneOf /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineDiscOneOf - implements Built { +abstract class FruitInlineDiscOneOf implements Built { @BuiltValueField(wireName: r'seeds') int get seeds; @@ -24,24 +23,18 @@ abstract class FruitInlineDiscOneOf FruitInlineDiscOneOf._(); - factory FruitInlineDiscOneOf([void updates(FruitInlineDiscOneOfBuilder b)]) = - _$FruitInlineDiscOneOf; + factory FruitInlineDiscOneOf([void updates(FruitInlineDiscOneOfBuilder b)]) = _$FruitInlineDiscOneOf; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineDiscOneOfBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineDiscOneOfSerializer(); + static Serializer get serializer => _$FruitInlineDiscOneOfSerializer(); } -class _$FruitInlineDiscOneOfSerializer - implements PrimitiveSerializer { +class _$FruitInlineDiscOneOfSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineDiscOneOf, - _$FruitInlineDiscOneOf - ]; + final Iterable types = const [FruitInlineDiscOneOf, _$FruitInlineDiscOneOf]; @override final String wireName = r'FruitInlineDiscOneOf'; @@ -69,9 +62,7 @@ class _$FruitInlineDiscOneOfSerializer FruitInlineDiscOneOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,3 +119,6 @@ class _$FruitInlineDiscOneOfSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart index 48a8c55588af..fee7ad8da946 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart @@ -11,11 +11,10 @@ part 'fruit_inline_disc_one_of1.g.dart'; /// FruitInlineDiscOneOf1 /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineDiscOneOf1 - implements Built { +abstract class FruitInlineDiscOneOf1 implements Built { @BuiltValueField(wireName: r'length') int get length; @@ -24,24 +23,18 @@ abstract class FruitInlineDiscOneOf1 FruitInlineDiscOneOf1._(); - factory FruitInlineDiscOneOf1( - [void updates(FruitInlineDiscOneOf1Builder b)]) = _$FruitInlineDiscOneOf1; + factory FruitInlineDiscOneOf1([void updates(FruitInlineDiscOneOf1Builder b)]) = _$FruitInlineDiscOneOf1; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineDiscOneOf1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineDiscOneOf1Serializer(); + static Serializer get serializer => _$FruitInlineDiscOneOf1Serializer(); } -class _$FruitInlineDiscOneOf1Serializer - implements PrimitiveSerializer { +class _$FruitInlineDiscOneOf1Serializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineDiscOneOf1, - _$FruitInlineDiscOneOf1 - ]; + final Iterable types = const [FruitInlineDiscOneOf1, _$FruitInlineDiscOneOf1]; @override final String wireName = r'FruitInlineDiscOneOf1'; @@ -69,9 +62,7 @@ class _$FruitInlineDiscOneOf1Serializer FruitInlineDiscOneOf1 object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,3 +119,6 @@ class _$FruitInlineDiscOneOf1Serializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart index 824c90e54e99..2f12ea520928 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart @@ -14,10 +14,9 @@ part 'fruit_inline_inline_disc.g.dart'; /// FruitInlineInlineDisc /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineInlineDisc - implements Built { +abstract class FruitInlineInlineDisc implements Built { /// One Of [FruitInlineInlineDiscOneOf], [FruitInlineInlineDiscOneOf1] OneOf get oneOf; @@ -30,49 +29,41 @@ abstract class FruitInlineInlineDisc FruitInlineInlineDisc._(); - factory FruitInlineInlineDisc( - [void updates(FruitInlineInlineDiscBuilder b)]) = _$FruitInlineInlineDisc; + factory FruitInlineInlineDisc([void updates(FruitInlineInlineDiscBuilder b)]) = _$FruitInlineInlineDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineInlineDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineInlineDiscSerializer(); + static Serializer get serializer => _$FruitInlineInlineDiscSerializer(); } extension FruitInlineInlineDiscDiscriminatorExt on FruitInlineInlineDisc { - String? get discriminatorValue { - if (this is FruitInlineInlineDiscOneOf) { - return r'FruitInlineInlineDisc_oneOf'; + String? get discriminatorValue { + if (this is FruitInlineInlineDiscOneOf) { + return r'FruitInlineInlineDisc_oneOf'; + } + if (this is FruitInlineInlineDiscOneOf1) { + return r'FruitInlineInlineDisc_oneOf_1'; + } + return null; } - if (this is FruitInlineInlineDiscOneOf1) { - return r'FruitInlineInlineDisc_oneOf_1'; - } - return null; - } } - -extension FruitInlineInlineDiscBuilderDiscriminatorExt - on FruitInlineInlineDiscBuilder { - String? get discriminatorValue { - if (this is FruitInlineInlineDiscOneOfBuilder) { - return r'FruitInlineInlineDisc_oneOf'; - } - if (this is FruitInlineInlineDiscOneOf1Builder) { - return r'FruitInlineInlineDisc_oneOf_1'; +extension FruitInlineInlineDiscBuilderDiscriminatorExt on FruitInlineInlineDiscBuilder { + String? get discriminatorValue { + if (this is FruitInlineInlineDiscOneOfBuilder) { + return r'FruitInlineInlineDisc_oneOf'; + } + if (this is FruitInlineInlineDiscOneOf1Builder) { + return r'FruitInlineInlineDisc_oneOf_1'; + } + return null; } - return null; - } } -class _$FruitInlineInlineDiscSerializer - implements PrimitiveSerializer { +class _$FruitInlineInlineDiscSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineInlineDisc, - _$FruitInlineInlineDisc - ]; + final Iterable types = const [FruitInlineInlineDisc, _$FruitInlineInlineDisc]; @override final String wireName = r'FruitInlineInlineDisc'; @@ -81,7 +72,8 @@ class _$FruitInlineInlineDiscSerializer Serializers serializers, FruitInlineInlineDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -90,8 +82,7 @@ class _$FruitInlineInlineDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -103,16 +94,10 @@ class _$FruitInlineInlineDiscSerializer final result = FruitInlineInlineDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitInlineInlineDisc.discriminatorFieldName) + - 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitInlineInlineDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - FruitInlineInlineDiscOneOf, - FruitInlineInlineDiscOneOf1, - ]; + final oneOfTypes = [FruitInlineInlineDiscOneOf, FruitInlineInlineDiscOneOf1, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -131,13 +116,11 @@ class _$FruitInlineInlineDiscSerializer oneOfType = FruitInlineInlineDiscOneOf1; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart index 3b33e7b47913..556c0b9e747c 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart @@ -13,12 +13,10 @@ part 'fruit_inline_inline_disc_one_of.g.dart'; /// FruitInlineInlineDiscOneOf /// /// Properties: -/// * [seeds] -/// * [fruitType] +/// * [seeds] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineInlineDiscOneOf - implements - Built { +abstract class FruitInlineInlineDiscOneOf implements Built { @BuiltValueField(wireName: r'seeds') int get seeds; @@ -27,25 +25,18 @@ abstract class FruitInlineInlineDiscOneOf FruitInlineInlineDiscOneOf._(); - factory FruitInlineInlineDiscOneOf( - [void updates(FruitInlineInlineDiscOneOfBuilder b)]) = - _$FruitInlineInlineDiscOneOf; + factory FruitInlineInlineDiscOneOf([void updates(FruitInlineInlineDiscOneOfBuilder b)]) = _$FruitInlineInlineDiscOneOf; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineInlineDiscOneOfBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineInlineDiscOneOfSerializer(); + static Serializer get serializer => _$FruitInlineInlineDiscOneOfSerializer(); } -class _$FruitInlineInlineDiscOneOfSerializer - implements PrimitiveSerializer { +class _$FruitInlineInlineDiscOneOfSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineInlineDiscOneOf, - _$FruitInlineInlineDiscOneOf - ]; + final Iterable types = const [FruitInlineInlineDiscOneOf, _$FruitInlineInlineDiscOneOf]; @override final String wireName = r'FruitInlineInlineDiscOneOf'; @@ -69,11 +60,8 @@ class _$FruitInlineInlineDiscOneOfSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -112,9 +100,7 @@ class _$FruitInlineInlineDiscOneOfSerializer }) { final result = FruitInlineInlineDiscOneOfBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(FruitInlineInlineDiscOneOfOneOf), - ]); + final targetType = const FullType(OneOf, [FullType(FruitInlineInlineDiscOneOfOneOf), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -126,8 +112,10 @@ class _$FruitInlineInlineDiscOneOfSerializer result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart index 3c0b9a9ddd00..5b82ccc5676b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart @@ -13,12 +13,10 @@ part 'fruit_inline_inline_disc_one_of1.g.dart'; /// FruitInlineInlineDiscOneOf1 /// /// Properties: -/// * [length] -/// * [fruitType] +/// * [length] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineInlineDiscOneOf1 - implements - Built { +abstract class FruitInlineInlineDiscOneOf1 implements Built { @BuiltValueField(wireName: r'length') int get length; @@ -27,25 +25,18 @@ abstract class FruitInlineInlineDiscOneOf1 FruitInlineInlineDiscOneOf1._(); - factory FruitInlineInlineDiscOneOf1( - [void updates(FruitInlineInlineDiscOneOf1Builder b)]) = - _$FruitInlineInlineDiscOneOf1; + factory FruitInlineInlineDiscOneOf1([void updates(FruitInlineInlineDiscOneOf1Builder b)]) = _$FruitInlineInlineDiscOneOf1; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineInlineDiscOneOf1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineInlineDiscOneOf1Serializer(); + static Serializer get serializer => _$FruitInlineInlineDiscOneOf1Serializer(); } -class _$FruitInlineInlineDiscOneOf1Serializer - implements PrimitiveSerializer { +class _$FruitInlineInlineDiscOneOf1Serializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineInlineDiscOneOf1, - _$FruitInlineInlineDiscOneOf1 - ]; + final Iterable types = const [FruitInlineInlineDiscOneOf1, _$FruitInlineInlineDiscOneOf1]; @override final String wireName = r'FruitInlineInlineDiscOneOf1'; @@ -69,11 +60,8 @@ class _$FruitInlineInlineDiscOneOf1Serializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -112,9 +100,7 @@ class _$FruitInlineInlineDiscOneOf1Serializer }) { final result = FruitInlineInlineDiscOneOf1Builder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(FruitInlineInlineDiscOneOfOneOf), - ]); + final targetType = const FullType(OneOf, [FullType(FruitInlineInlineDiscOneOfOneOf), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -126,8 +112,10 @@ class _$FruitInlineInlineDiscOneOf1Serializer result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart index cc5e05999c44..e5b074034ee1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart @@ -11,36 +11,26 @@ part 'fruit_inline_inline_disc_one_of_one_of.g.dart'; /// FruitInlineInlineDiscOneOfOneOf /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitInlineInlineDiscOneOfOneOf - implements - Built { +abstract class FruitInlineInlineDiscOneOfOneOf implements Built { @BuiltValueField(wireName: r'fruitType') String get fruitType; FruitInlineInlineDiscOneOfOneOf._(); - factory FruitInlineInlineDiscOneOfOneOf( - [void updates(FruitInlineInlineDiscOneOfOneOfBuilder b)]) = - _$FruitInlineInlineDiscOneOfOneOf; + factory FruitInlineInlineDiscOneOfOneOf([void updates(FruitInlineInlineDiscOneOfOneOfBuilder b)]) = _$FruitInlineInlineDiscOneOfOneOf; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitInlineInlineDiscOneOfOneOfBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitInlineInlineDiscOneOfOneOfSerializer(); + static Serializer get serializer => _$FruitInlineInlineDiscOneOfOneOfSerializer(); } -class _$FruitInlineInlineDiscOneOfOneOfSerializer - implements PrimitiveSerializer { +class _$FruitInlineInlineDiscOneOfOneOfSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - FruitInlineInlineDiscOneOfOneOf, - _$FruitInlineInlineDiscOneOfOneOf - ]; + final Iterable types = const [FruitInlineInlineDiscOneOfOneOf, _$FruitInlineInlineDiscOneOfOneOf]; @override final String wireName = r'FruitInlineInlineDiscOneOfOneOf'; @@ -63,9 +53,7 @@ class _$FruitInlineInlineDiscOneOfOneOfSerializer FruitInlineInlineDiscOneOfOneOf object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -115,3 +103,5 @@ class _$FruitInlineInlineDiscOneOfOneOfSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart index 075df4056894..38bb339f0ba7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart @@ -14,10 +14,9 @@ part 'fruit_one_of_disc.g.dart'; /// FruitOneOfDisc /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue() -abstract class FruitOneOfDisc - implements Built { +abstract class FruitOneOfDisc implements Built { /// One Of [AppleOneOfDisc], [BananaOneOfDisc] OneOf get oneOf; @@ -30,43 +29,39 @@ abstract class FruitOneOfDisc FruitOneOfDisc._(); - factory FruitOneOfDisc([void updates(FruitOneOfDiscBuilder b)]) = - _$FruitOneOfDisc; + factory FruitOneOfDisc([void updates(FruitOneOfDiscBuilder b)]) = _$FruitOneOfDisc; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitOneOfDiscBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitOneOfDiscSerializer(); + static Serializer get serializer => _$FruitOneOfDiscSerializer(); } extension FruitOneOfDiscDiscriminatorExt on FruitOneOfDisc { - String? get discriminatorValue { - if (this is AppleOneOfDisc) { - return r'AppleOneOfDisc'; + String? get discriminatorValue { + if (this is AppleOneOfDisc) { + return r'AppleOneOfDisc'; + } + if (this is BananaOneOfDisc) { + return r'BananaOneOfDisc'; + } + return null; } - if (this is BananaOneOfDisc) { - return r'BananaOneOfDisc'; - } - return null; - } } - extension FruitOneOfDiscBuilderDiscriminatorExt on FruitOneOfDiscBuilder { - String? get discriminatorValue { - if (this is AppleOneOfDiscBuilder) { - return r'AppleOneOfDisc'; - } - if (this is BananaOneOfDiscBuilder) { - return r'BananaOneOfDisc'; + String? get discriminatorValue { + if (this is AppleOneOfDiscBuilder) { + return r'AppleOneOfDisc'; + } + if (this is BananaOneOfDiscBuilder) { + return r'BananaOneOfDisc'; + } + return null; } - return null; - } } -class _$FruitOneOfDiscSerializer - implements PrimitiveSerializer { +class _$FruitOneOfDiscSerializer implements PrimitiveSerializer { @override final Iterable types = const [FruitOneOfDisc, _$FruitOneOfDisc]; @@ -77,7 +72,8 @@ class _$FruitOneOfDiscSerializer Serializers serializers, FruitOneOfDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -86,8 +82,7 @@ class _$FruitOneOfDiscSerializer FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -99,15 +94,10 @@ class _$FruitOneOfDiscSerializer final result = FruitOneOfDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitOneOfDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitOneOfDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - AppleOneOfDisc, - BananaOneOfDisc, - ]; + final oneOfTypes = [AppleOneOfDisc, BananaOneOfDisc, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -126,13 +116,11 @@ class _$FruitOneOfDiscSerializer oneOfType = BananaOneOfDisc; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart index 8bb855b0fb0d..2aaf0bda91c6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart @@ -14,12 +14,11 @@ part 'fruit_req_disc.g.dart'; /// FruitReqDisc /// /// Properties: -/// * [seeds] -/// * [fruitType] -/// * [length] +/// * [seeds] +/// * [fruitType] +/// * [length] @BuiltValue() -abstract class FruitReqDisc - implements Built { +abstract class FruitReqDisc implements Built { /// One Of [AppleReqDisc], [BananaReqDisc] OneOf get oneOf; @@ -42,27 +41,26 @@ abstract class FruitReqDisc } extension FruitReqDiscDiscriminatorExt on FruitReqDisc { - String? get discriminatorValue { - if (this is AppleReqDisc) { - return r'AppleReqDisc'; + String? get discriminatorValue { + if (this is AppleReqDisc) { + return r'AppleReqDisc'; + } + if (this is BananaReqDisc) { + return r'BananaReqDisc'; + } + return null; } - if (this is BananaReqDisc) { - return r'BananaReqDisc'; - } - return null; - } } - extension FruitReqDiscBuilderDiscriminatorExt on FruitReqDiscBuilder { - String? get discriminatorValue { - if (this is AppleReqDiscBuilder) { - return r'AppleReqDisc'; - } - if (this is BananaReqDiscBuilder) { - return r'BananaReqDisc'; + String? get discriminatorValue { + if (this is AppleReqDiscBuilder) { + return r'AppleReqDisc'; + } + if (this is BananaReqDiscBuilder) { + return r'BananaReqDisc'; + } + return null; } - return null; - } } class _$FruitReqDiscSerializer implements PrimitiveSerializer { @@ -76,7 +74,8 @@ class _$FruitReqDiscSerializer implements PrimitiveSerializer { Serializers serializers, FruitReqDisc object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -85,8 +84,7 @@ class _$FruitReqDiscSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -98,15 +96,10 @@ class _$FruitReqDiscSerializer implements PrimitiveSerializer { final result = FruitReqDiscBuilder(); Object? oneOfDataSrc; final serializedList = (serialized as Iterable).toList(); - final discIndex = - serializedList.indexOf(FruitReqDisc.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discIndex = serializedList.indexOf(FruitReqDisc.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; oneOfDataSrc = serialized; - final oneOfTypes = [ - AppleReqDisc, - BananaReqDisc, - ]; + final oneOfTypes = [AppleReqDisc, BananaReqDisc, ]; Object oneOfResult; Type oneOfType; switch (discValue) { @@ -125,13 +118,13 @@ class _$FruitReqDiscSerializer implements PrimitiveSerializer { oneOfType = BananaReqDisc; break; default: - throw UnsupportedError( - "Couldn't deserialize oneOf for the discriminator value: ${discValue}"); + throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}"); } - result.oneOf = OneOfDynamic( - typeIndex: oneOfTypes.indexOf(oneOfType), - types: oneOfTypes, - value: oneOfResult); + result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult); return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart index 7a32c5b9ccf4..5240009b81f0 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart @@ -11,9 +11,9 @@ part 'fruit_type.g.dart'; /// FruitType /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue(instantiable: false) -abstract class FruitType { +abstract class FruitType { @BuiltValueField(wireName: r'fruitType') String get fruitType; @@ -46,9 +46,7 @@ class _$FruitTypeSerializer implements PrimitiveSerializer { FruitType object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -57,19 +55,16 @@ class _$FruitTypeSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, - specifiedType: FullType($FruitType)) as $FruitType; + return serializers.deserialize(serialized, specifiedType: FullType($FruitType)) as $FruitType; } } /// a concrete implementation of [FruitType], since [FruitType] is not instantiable @BuiltValue(instantiable: true) -abstract class $FruitType - implements FruitType, Built<$FruitType, $FruitTypeBuilder> { +abstract class $FruitType implements FruitType, Built<$FruitType, $FruitTypeBuilder> { $FruitType._(); - factory $FruitType([void Function($FruitTypeBuilder)? updates]) = - _$$FruitType; + factory $FruitType([void Function($FruitTypeBuilder)? updates]) = _$$FruitType; @BuiltValueHook(initializeBuilder: true) static void _defaults($FruitTypeBuilder b) => b; @@ -141,3 +136,5 @@ class _$$FruitTypeSerializer implements PrimitiveSerializer<$FruitType> { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart index d7a7a813c2c3..a5058096b386 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart @@ -15,11 +15,10 @@ part 'fruit_variant1.g.dart'; /// FruitVariant1 /// /// Properties: -/// * [color] -/// * [kind] +/// * [color] +/// * [kind] @BuiltValue() -abstract class FruitVariant1 - implements Built { +abstract class FruitVariant1 implements Built { @BuiltValueField(wireName: r'color') String? get color; @@ -28,15 +27,13 @@ abstract class FruitVariant1 FruitVariant1._(); - factory FruitVariant1([void updates(FruitVariant1Builder b)]) = - _$FruitVariant1; + factory FruitVariant1([void updates(FruitVariant1Builder b)]) = _$FruitVariant1; @BuiltValueHook(initializeBuilder: true) static void _defaults(FruitVariant1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$FruitVariant1Serializer(); + static Serializer get serializer => _$FruitVariant1Serializer(); } class _$FruitVariant1Serializer implements PrimitiveSerializer { @@ -67,11 +64,8 @@ class _$FruitVariant1Serializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - final result = - _serializeProperties(serializers, object, specifiedType: specifiedType) - .toList(); - result.addAll(serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType)) as Iterable); + final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable); return result; } @@ -110,10 +104,7 @@ class _$FruitVariant1Serializer implements PrimitiveSerializer { }) { final result = FruitVariant1Builder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(AppleVariant1), - FullType(BuiltList, [FullType(GrapeVariant1)]), - ]); + final targetType = const FullType(OneOf, [FullType(AppleVariant1), FullType(BuiltList, [FullType(GrapeVariant1)]), ]); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( @@ -125,8 +116,10 @@ class _$FruitVariant1Serializer implements PrimitiveSerializer { result: result, ); oneOfDataSrc = unhandled; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart index edc39cc4ab7e..87ba38ca7c29 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart @@ -14,7 +14,7 @@ part 'giga_one_of.g.dart'; /// GigaOneOf /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() abstract class GigaOneOf implements Built { /// One Of [DateTime], [OneOfPrimitiveChild], [String], [int], [num] @@ -42,7 +42,8 @@ class _$GigaOneOfSerializer implements PrimitiveSerializer { Serializers serializers, GigaOneOf object, { FullType specifiedType = FullType.unspecified, - }) sync* {} + }) sync* { + } @override Object serialize( @@ -51,8 +52,7 @@ class _$GigaOneOfSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { final oneOf = object.oneOf; - return serializers.serialize(oneOf.value, - specifiedType: FullType(oneOf.valueType))!; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -63,17 +63,11 @@ class _$GigaOneOfSerializer implements PrimitiveSerializer { }) { final result = GigaOneOfBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [ - FullType(String), - FullType(DateTime), - FullType(int), - FullType(num), - FullType(OneOfPrimitiveChild), - FullType(int), - ]); + final targetType = const FullType(OneOf, [FullType(String), FullType(DateTime), FullType(int), FullType(num), FullType(OneOfPrimitiveChild), FullType(int), ]); oneOfDataSrc = serialized; - result.oneOf = serializers.deserialize(oneOfDataSrc, - specifiedType: targetType) as OneOf; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart index 85227f984333..e75a73572bc8 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart @@ -11,24 +11,21 @@ part 'grape_variant1.g.dart'; /// GrapeVariant1 /// /// Properties: -/// * [color] +/// * [color] @BuiltValue() -abstract class GrapeVariant1 - implements Built { +abstract class GrapeVariant1 implements Built { @BuiltValueField(wireName: r'color') String? get color; GrapeVariant1._(); - factory GrapeVariant1([void updates(GrapeVariant1Builder b)]) = - _$GrapeVariant1; + factory GrapeVariant1([void updates(GrapeVariant1Builder b)]) = _$GrapeVariant1; @BuiltValueHook(initializeBuilder: true) static void _defaults(GrapeVariant1Builder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$GrapeVariant1Serializer(); + static Serializer get serializer => _$GrapeVariant1Serializer(); } class _$GrapeVariant1Serializer implements PrimitiveSerializer { @@ -58,9 +55,7 @@ class _$GrapeVariant1Serializer implements PrimitiveSerializer { GrapeVariant1 object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -110,3 +105,5 @@ class _$GrapeVariant1Serializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart index 9d2538bab52a..c0b5d927bf78 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart @@ -11,11 +11,10 @@ part 'has_only_read_only.g.dart'; /// HasOnlyReadOnly /// /// Properties: -/// * [bar] -/// * [foo] +/// * [bar] +/// * [foo] @BuiltValue() -abstract class HasOnlyReadOnly - implements Built { +abstract class HasOnlyReadOnly implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -24,19 +23,16 @@ abstract class HasOnlyReadOnly HasOnlyReadOnly._(); - factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = - _$HasOnlyReadOnly; + factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; @BuiltValueHook(initializeBuilder: true) static void _defaults(HasOnlyReadOnlyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$HasOnlyReadOnlySerializer(); + static Serializer get serializer => _$HasOnlyReadOnlySerializer(); } -class _$HasOnlyReadOnlySerializer - implements PrimitiveSerializer { +class _$HasOnlyReadOnlySerializer implements PrimitiveSerializer { @override final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; @@ -70,9 +66,7 @@ class _$HasOnlyReadOnlySerializer HasOnlyReadOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -129,3 +123,6 @@ class _$HasOnlyReadOnlySerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart index 4756e8600c1c..0b21191e2416 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart @@ -11,28 +11,24 @@ part 'health_check_result.g.dart'; /// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. /// /// Properties: -/// * [nullableMessage] +/// * [nullableMessage] @BuiltValue() -abstract class HealthCheckResult - implements Built { +abstract class HealthCheckResult implements Built { @BuiltValueField(wireName: r'NullableMessage') String? get nullableMessage; HealthCheckResult._(); - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = - _$HealthCheckResult; + factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; @BuiltValueHook(initializeBuilder: true) static void _defaults(HealthCheckResultBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$HealthCheckResultSerializer(); + static Serializer get serializer => _$HealthCheckResultSerializer(); } -class _$HealthCheckResultSerializer - implements PrimitiveSerializer { +class _$HealthCheckResultSerializer implements PrimitiveSerializer { @override final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; @@ -59,9 +55,7 @@ class _$HealthCheckResultSerializer HealthCheckResult object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -112,3 +106,5 @@ class _$HealthCheckResultSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart index a31e79364fc5..307b5df2a205 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart @@ -12,10 +12,10 @@ part 'map_test.g.dart'; /// MapTest /// /// Properties: -/// * [mapMapOfString] -/// * [mapOfEnumString] -/// * [directMap] -/// * [indirectMap] +/// * [mapMapOfString] +/// * [mapOfEnumString] +/// * [directMap] +/// * [indirectMap] @BuiltValue() abstract class MapTest implements Built { @BuiltValueField(wireName: r'map_map_of_string') @@ -58,34 +58,28 @@ class _$MapTestSerializer implements PrimitiveSerializer { yield r'map_map_of_string'; yield serializers.serialize( object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [ - FullType(String), - FullType(BuiltMap, [FullType(String), FullType(String)]) - ]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), ); } if (object.mapOfEnumString != null) { yield r'map_of_enum_string'; yield serializers.serialize( object.mapOfEnumString, - specifiedType: const FullType( - BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ); } if (object.directMap != null) { yield r'direct_map'; yield serializers.serialize( object.directMap, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } if (object.indirectMap != null) { yield r'indirect_map'; yield serializers.serialize( object.indirectMap, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), ); } } @@ -96,9 +90,7 @@ class _$MapTestSerializer implements PrimitiveSerializer { MapTest object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -116,34 +108,28 @@ class _$MapTestSerializer implements PrimitiveSerializer { case r'map_map_of_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [ - FullType(String), - FullType(BuiltMap, [FullType(String), FullType(String)]) - ]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]), ) as BuiltMap>; result.mapMapOfString.replace(valueDes); break; case r'map_of_enum_string': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, - [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]), ) as BuiltMap; result.mapOfEnumString.replace(valueDes); break; case r'direct_map': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.directMap.replace(valueDes); break; case r'indirect_map': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(bool)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]), ) as BuiltMap; result.indirectMap.replace(valueDes); break; @@ -175,25 +161,25 @@ class _$MapTestSerializer implements PrimitiveSerializer { return result.build(); } } - + class MapTestMapOfEnumStringEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = - _$mapTestMapOfEnumStringEnum_UPPER; + static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = - _$mapTestMapOfEnumStringEnum_lower; + static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = - _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; + static const MapTestMapOfEnumStringEnum unknownDefaultOpenApi = _$mapTestMapOfEnumStringEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$mapTestMapOfEnumStringEnumSerializer; + static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; - const MapTestMapOfEnumStringEnum._(String name) : super(name); + const MapTestMapOfEnumStringEnum._(String name): super(name); - static BuiltSet get values => - _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => - _$mapTestMapOfEnumStringEnumValueOf(name); + static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; + static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); } + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart index 0d85f7d589aa..031907774ea1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -13,14 +13,11 @@ part 'mixed_properties_and_additional_properties_class.g.dart'; /// MixedPropertiesAndAdditionalPropertiesClass /// /// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] +/// * [uuid] +/// * [dateTime] +/// * [map] @BuiltValue() -abstract class MixedPropertiesAndAdditionalPropertiesClass - implements - Built { +abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -32,29 +29,18 @@ abstract class MixedPropertiesAndAdditionalPropertiesClass MixedPropertiesAndAdditionalPropertiesClass._(); - factory MixedPropertiesAndAdditionalPropertiesClass( - [void updates( - MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = - _$MixedPropertiesAndAdditionalPropertiesClass; + factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; @BuiltValueHook(initializeBuilder: true) - static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => - b; + static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer - get serializer => - _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); + static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); } -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer - implements - PrimitiveSerializer { +class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - MixedPropertiesAndAdditionalPropertiesClass, - _$MixedPropertiesAndAdditionalPropertiesClass - ]; + final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; @override final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; @@ -82,8 +68,7 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer yield r'map'; yield serializers.serialize( object.map, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ); } } @@ -94,9 +79,7 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer MixedPropertiesAndAdditionalPropertiesClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,8 +111,7 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer case r'map': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltMap, [FullType(String), FullType(Animal)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]), ) as BuiltMap; result.map.replace(valueDes); break; @@ -161,3 +143,7 @@ class _$MixedPropertiesAndAdditionalPropertiesClassSerializer return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart index b9f7146fd0e8..2dd4b3eb6de7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart @@ -11,11 +11,10 @@ part 'model200_response.g.dart'; /// Model for testing model name starting with number /// /// Properties: -/// * [name] -/// * [classField] +/// * [name] +/// * [classField] @BuiltValue() -abstract class Model200Response - implements Built { +abstract class Model200Response implements Built { @BuiltValueField(wireName: r'name') int? get name; @@ -24,19 +23,16 @@ abstract class Model200Response Model200Response._(); - factory Model200Response([void updates(Model200ResponseBuilder b)]) = - _$Model200Response; + factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; @BuiltValueHook(initializeBuilder: true) static void _defaults(Model200ResponseBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$Model200ResponseSerializer(); + static Serializer get serializer => _$Model200ResponseSerializer(); } -class _$Model200ResponseSerializer - implements PrimitiveSerializer { +class _$Model200ResponseSerializer implements PrimitiveSerializer { @override final Iterable types = const [Model200Response, _$Model200Response]; @@ -70,9 +66,7 @@ class _$Model200ResponseSerializer Model200Response object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -129,3 +123,6 @@ class _$Model200ResponseSerializer return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart index 63cba51c4be9..d8bde0d4efc7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart @@ -11,7 +11,7 @@ part 'model_client.g.dart'; /// ModelClient /// /// Properties: -/// * [client] +/// * [client] @BuiltValue() abstract class ModelClient implements Built { @BuiltValueField(wireName: r'client') @@ -55,9 +55,7 @@ class _$ModelClientSerializer implements PrimitiveSerializer { ModelClient object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$ModelClientSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart index d5ec2c7c00e7..b5aa8fa6450f 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart @@ -10,20 +10,19 @@ import 'package:built_value/serializer.dart'; part 'model_enum_class.g.dart'; class ModelEnumClass extends EnumClass { + @BuiltValueEnumConst(wireName: r'_abc') static const ModelEnumClass abc = _$abc; @BuiltValueEnumConst(wireName: r'-efg') static const ModelEnumClass efg = _$efg; @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = - _$leftParenthesisXyzRightParenthesis; + static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) static const ModelEnumClass unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => - _$modelEnumClassSerializer; + static Serializer get serializer => _$modelEnumClassSerializer; - const ModelEnumClass._(String name) : super(name); + const ModelEnumClass._(String name): super(name); static BuiltSet get values => _$values; static ModelEnumClass valueOf(String name) => _$valueOf(name); @@ -36,3 +35,4 @@ class ModelEnumClass extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef ModelEnumClassMixin = _$ModelEnumClassMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart index a74db4217b29..bd481392e48e 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart @@ -56,9 +56,7 @@ class _$ModelFileSerializer implements PrimitiveSerializer { ModelFile object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -108,3 +106,5 @@ class _$ModelFileSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart index fbea6fe8232c..e412aa5570e4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart @@ -11,7 +11,7 @@ part 'model_list.g.dart'; /// ModelList /// /// Properties: -/// * [n123list] +/// * [n123list] @BuiltValue() abstract class ModelList implements Built { @BuiltValueField(wireName: r'123-list') @@ -55,9 +55,7 @@ class _$ModelListSerializer implements PrimitiveSerializer { ModelList object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$ModelListSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart index 46770cac8e9e..8ef153e32ec5 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart @@ -11,7 +11,7 @@ part 'model_return.g.dart'; /// Model for testing reserved words /// /// Properties: -/// * [return_] +/// * [return_] @BuiltValue() abstract class ModelReturn implements Built { @BuiltValueField(wireName: r'return') @@ -55,9 +55,7 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { ModelReturn object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$ModelReturnSerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart index 12531dce5470..b17971910f2b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart @@ -11,10 +11,10 @@ part 'name.g.dart'; /// Model for testing model name same as property name /// /// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] +/// * [name] +/// * [snakeCase] +/// * [property] +/// * [n123number] @BuiltValue() abstract class Name implements Built { @BuiltValueField(wireName: r'name') @@ -86,9 +86,7 @@ class _$NameSerializer implements PrimitiveSerializer { Name object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -159,3 +157,8 @@ class _$NameSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart index ff124c21bf20..a92dbd749da4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart @@ -14,21 +14,20 @@ part 'nullable_class.g.dart'; /// NullableClass /// /// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] +/// * [integerProp] +/// * [numberProp] +/// * [booleanProp] +/// * [stringProp] +/// * [dateProp] +/// * [datetimeProp] +/// * [arrayNullableProp] +/// * [arrayAndItemsNullableProp] +/// * [arrayItemsNullable] +/// * [objectNullableProp] +/// * [objectAndItemsNullableProp] +/// * [objectItemsNullable] @BuiltValue() -abstract class NullableClass - implements Built { +abstract class NullableClass implements Built { @BuiltValueField(wireName: r'integer_prop') int? get integerProp; @@ -67,15 +66,13 @@ abstract class NullableClass NullableClass._(); - factory NullableClass([void updates(NullableClassBuilder b)]) = - _$NullableClass; + factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; @BuiltValueHook(initializeBuilder: true) static void _defaults(NullableClassBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$NullableClassSerializer(); + static Serializer get serializer => _$NullableClassSerializer(); } class _$NullableClassSerializer implements PrimitiveSerializer { @@ -136,48 +133,42 @@ class _$NullableClassSerializer implements PrimitiveSerializer { yield r'array_nullable_prop'; yield serializers.serialize( object.arrayNullableProp, - specifiedType: - const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), ); } if (object.arrayAndItemsNullableProp != null) { yield r'array_and_items_nullable_prop'; yield serializers.serialize( object.arrayAndItemsNullableProp, - specifiedType: - const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.arrayItemsNullable != null) { yield r'array_items_nullable'; yield serializers.serialize( object.arrayItemsNullable, - specifiedType: - const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), ); } if (object.objectNullableProp != null) { yield r'object_nullable_prop'; yield serializers.serialize( object.objectNullableProp, - specifiedType: const FullType.nullable( - BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), ); } if (object.objectAndItemsNullableProp != null) { yield r'object_and_items_nullable_prop'; yield serializers.serialize( object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable( - BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } if (object.objectItemsNullable != null) { yield r'object_items_nullable'; yield serializers.serialize( object.objectItemsNullable, - specifiedType: const FullType( - BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } } @@ -188,9 +179,7 @@ class _$NullableClassSerializer implements PrimitiveSerializer { NullableClass object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -256,8 +245,7 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType.nullable(BuiltList, [FullType(JsonObject)]), + specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayNullableProp.replace(valueDes); @@ -265,8 +253,7 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable( - BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList?; if (valueDes == null) continue; result.arrayAndItemsNullableProp.replace(valueDes); @@ -274,16 +261,14 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'array_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: - const FullType(BuiltList, [FullType.nullable(JsonObject)]), + specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]), ) as BuiltList; result.arrayItemsNullable.replace(valueDes); break; case r'object_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable( - BuiltMap, [FullType(String), FullType(JsonObject)]), + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectNullableProp.replace(valueDes); @@ -291,8 +276,7 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_and_items_nullable_prop': final valueDes = serializers.deserialize( value, - specifiedType: const FullType.nullable( - BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap?; if (valueDes == null) continue; result.objectAndItemsNullableProp.replace(valueDes); @@ -300,8 +284,7 @@ class _$NullableClassSerializer implements PrimitiveSerializer { case r'object_items_nullable': final valueDes = serializers.deserialize( value, - specifiedType: const FullType( - BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ) as BuiltMap; result.objectItemsNullable.replace(valueDes); break; @@ -333,3 +316,16 @@ class _$NullableClassSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart index bc854c85003b..c1f2ba2a2a95 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart @@ -11,7 +11,7 @@ part 'number_only.g.dart'; /// NumberOnly /// /// Properties: -/// * [justNumber] +/// * [justNumber] @BuiltValue() abstract class NumberOnly implements Built { @BuiltValueField(wireName: r'JustNumber') @@ -55,9 +55,7 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { NumberOnly object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -107,3 +105,5 @@ class _$NumberOnlySerializer implements PrimitiveSerializer { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart index 036818a6a98a..42730dee5c1b 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart @@ -14,14 +14,12 @@ part 'object_with_deprecated_fields.g.dart'; /// ObjectWithDeprecatedFields /// /// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] +/// * [uuid] +/// * [id] +/// * [deprecatedRef] +/// * [bars] @BuiltValue() -abstract class ObjectWithDeprecatedFields - implements - Built { +abstract class ObjectWithDeprecatedFields implements Built { @BuiltValueField(wireName: r'uuid') String? get uuid; @@ -39,25 +37,18 @@ abstract class ObjectWithDeprecatedFields ObjectWithDeprecatedFields._(); - factory ObjectWithDeprecatedFields( - [void updates(ObjectWithDeprecatedFieldsBuilder b)]) = - _$ObjectWithDeprecatedFields; + factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; @BuiltValueHook(initializeBuilder: true) static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ObjectWithDeprecatedFieldsSerializer(); + static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); } -class _$ObjectWithDeprecatedFieldsSerializer - implements PrimitiveSerializer { +class _$ObjectWithDeprecatedFieldsSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - ObjectWithDeprecatedFields, - _$ObjectWithDeprecatedFields - ]; + final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; @override final String wireName = r'ObjectWithDeprecatedFields'; @@ -103,9 +94,7 @@ class _$ObjectWithDeprecatedFieldsSerializer ObjectWithDeprecatedFields object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -176,3 +165,8 @@ class _$ObjectWithDeprecatedFieldsSerializer return result.build(); } } + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart index 7e3f9fb94942..b7ba74e0d081 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart @@ -11,33 +11,26 @@ part 'one_of_primitive_child.g.dart'; /// OneOfPrimitiveChild /// /// Properties: -/// * [name] +/// * [name] @BuiltValue() -abstract class OneOfPrimitiveChild - implements Built { +abstract class OneOfPrimitiveChild implements Built { @BuiltValueField(wireName: r'name') String? get name; OneOfPrimitiveChild._(); - factory OneOfPrimitiveChild([void updates(OneOfPrimitiveChildBuilder b)]) = - _$OneOfPrimitiveChild; + factory OneOfPrimitiveChild([void updates(OneOfPrimitiveChildBuilder b)]) = _$OneOfPrimitiveChild; @BuiltValueHook(initializeBuilder: true) static void _defaults(OneOfPrimitiveChildBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$OneOfPrimitiveChildSerializer(); + static Serializer get serializer => _$OneOfPrimitiveChildSerializer(); } -class _$OneOfPrimitiveChildSerializer - implements PrimitiveSerializer { +class _$OneOfPrimitiveChildSerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - OneOfPrimitiveChild, - _$OneOfPrimitiveChild - ]; + final Iterable types = const [OneOfPrimitiveChild, _$OneOfPrimitiveChild]; @override final String wireName = r'OneOfPrimitiveChild'; @@ -62,9 +55,7 @@ class _$OneOfPrimitiveChildSerializer OneOfPrimitiveChild object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -114,3 +105,5 @@ class _$OneOfPrimitiveChildSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart index 35b18409ec52..bdd5b3d51251 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart @@ -12,12 +12,12 @@ part 'order.g.dart'; /// Order /// /// Properties: -/// * [id] -/// * [petId] -/// * [quantity] -/// * [shipDate] +/// * [id] +/// * [petId] +/// * [quantity] +/// * [shipDate] /// * [status] - Order Status -/// * [complete] +/// * [complete] @BuiltValue() abstract class Order implements Built { @BuiltValueField(wireName: r'id') @@ -45,7 +45,8 @@ abstract class Order implements Built { factory Order([void updates(OrderBuilder b)]) = _$Order; @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b..complete = false; + static void _defaults(OrderBuilder b) => b + ..complete = false; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$OrderSerializer(); @@ -113,9 +114,7 @@ class _$OrderSerializer implements PrimitiveSerializer { Order object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -200,30 +199,32 @@ class _$OrderSerializer implements PrimitiveSerializer { return result.build(); } } - + + + + class OrderStatusEnum extends EnumClass { + /// Order Status @BuiltValueEnumConst(wireName: r'placed') static const OrderStatusEnum placed = _$orderStatusEnum_placed; - /// Order Status @BuiltValueEnumConst(wireName: r'approved') static const OrderStatusEnum approved = _$orderStatusEnum_approved; - /// Order Status @BuiltValueEnumConst(wireName: r'delivered') static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; - /// Order Status @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OrderStatusEnum unknownDefaultOpenApi = - _$orderStatusEnum_unknownDefaultOpenApi; + static const OrderStatusEnum unknownDefaultOpenApi = _$orderStatusEnum_unknownDefaultOpenApi; - static Serializer get serializer => - _$orderStatusEnumSerializer; + static Serializer get serializer => _$orderStatusEnumSerializer; - const OrderStatusEnum._(String name) : super(name); + const OrderStatusEnum._(String name): super(name); static BuiltSet get values => _$orderStatusEnumValues; static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart index 899262513eb7..4017ac055a11 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart @@ -11,12 +11,11 @@ part 'outer_composite.g.dart'; /// OuterComposite /// /// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] +/// * [myNumber] +/// * [myString] +/// * [myBoolean] @BuiltValue() -abstract class OuterComposite - implements Built { +abstract class OuterComposite implements Built { @BuiltValueField(wireName: r'my_number') num? get myNumber; @@ -28,19 +27,16 @@ abstract class OuterComposite OuterComposite._(); - factory OuterComposite([void updates(OuterCompositeBuilder b)]) = - _$OuterComposite; + factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; @BuiltValueHook(initializeBuilder: true) static void _defaults(OuterCompositeBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$OuterCompositeSerializer(); + static Serializer get serializer => _$OuterCompositeSerializer(); } -class _$OuterCompositeSerializer - implements PrimitiveSerializer { +class _$OuterCompositeSerializer implements PrimitiveSerializer { @override final Iterable types = const [OuterComposite, _$OuterComposite]; @@ -81,9 +77,7 @@ class _$OuterCompositeSerializer OuterComposite object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -147,3 +141,7 @@ class _$OuterCompositeSerializer return result.build(); } } + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart index 2d9e8e780333..dcec6f1a87f7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart @@ -10,6 +10,7 @@ import 'package:built_value/serializer.dart'; part 'outer_enum.g.dart'; class OuterEnum extends EnumClass { + @BuiltValueEnumConst(wireName: r'placed') static const OuterEnum placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -21,7 +22,7 @@ class OuterEnum extends EnumClass { static Serializer get serializer => _$outerEnumSerializer; - const OuterEnum._(String name) : super(name); + const OuterEnum._(String name): super(name); static BuiltSet get values => _$values; static OuterEnum valueOf(String name) => _$valueOf(name); @@ -34,3 +35,4 @@ class OuterEnum extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef OuterEnumMixin = _$OuterEnumMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart index 6e7a76ec0c2f..be6714943f80 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart @@ -10,6 +10,7 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_default_value.g.dart'; class OuterEnumDefaultValue extends EnumClass { + @BuiltValueEnumConst(wireName: r'placed') static const OuterEnumDefaultValue placed = _$placed; @BuiltValueEnumConst(wireName: r'approved') @@ -17,13 +18,11 @@ class OuterEnumDefaultValue extends EnumClass { @BuiltValueEnumConst(wireName: r'delivered') static const OuterEnumDefaultValue delivered = _$delivered; @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const OuterEnumDefaultValue unknownDefaultOpenApi = - _$unknownDefaultOpenApi; + static const OuterEnumDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => - _$outerEnumDefaultValueSerializer; + static Serializer get serializer => _$outerEnumDefaultValueSerializer; - const OuterEnumDefaultValue._(String name) : super(name); + const OuterEnumDefaultValue._(String name): super(name); static BuiltSet get values => _$values; static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); @@ -36,3 +35,4 @@ class OuterEnumDefaultValue extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef OuterEnumDefaultValueMixin = _$OuterEnumDefaultValueMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart index 7489f550e6f6..a248f0743663 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart @@ -10,6 +10,7 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer.g.dart'; class OuterEnumInteger extends EnumClass { + @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumInteger number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -19,10 +20,9 @@ class OuterEnumInteger extends EnumClass { @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) static const OuterEnumInteger unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => - _$outerEnumIntegerSerializer; + static Serializer get serializer => _$outerEnumIntegerSerializer; - const OuterEnumInteger._(String name) : super(name); + const OuterEnumInteger._(String name): super(name); static BuiltSet get values => _$values; static OuterEnumInteger valueOf(String name) => _$valueOf(name); @@ -35,3 +35,4 @@ class OuterEnumInteger extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef OuterEnumIntegerMixin = _$OuterEnumIntegerMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart index 01d7e5b9c806..edf4506d90d7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart @@ -10,6 +10,7 @@ import 'package:built_value/serializer.dart'; part 'outer_enum_integer_default_value.g.dart'; class OuterEnumIntegerDefaultValue extends EnumClass { + @BuiltValueEnumConst(wireNumber: 0) static const OuterEnumIntegerDefaultValue number0 = _$number0; @BuiltValueEnumConst(wireNumber: 1) @@ -17,13 +18,11 @@ class OuterEnumIntegerDefaultValue extends EnumClass { @BuiltValueEnumConst(wireNumber: 2) static const OuterEnumIntegerDefaultValue number2 = _$number2; @BuiltValueEnumConst(wireNumber: 11184809, fallback: true) - static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = - _$unknownDefaultOpenApi; + static const OuterEnumIntegerDefaultValue unknownDefaultOpenApi = _$unknownDefaultOpenApi; - static Serializer get serializer => - _$outerEnumIntegerDefaultValueSerializer; + static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; - const OuterEnumIntegerDefaultValue._(String name) : super(name); + const OuterEnumIntegerDefaultValue._(String name): super(name); static BuiltSet get values => _$values; static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); @@ -36,3 +35,4 @@ class OuterEnumIntegerDefaultValue extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef OuterEnumIntegerDefaultValueMixin = _$OuterEnumIntegerDefaultValueMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart index 43dddcba352f..d2438f77f167 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart @@ -12,36 +12,27 @@ part 'outer_object_with_enum_property.g.dart'; /// OuterObjectWithEnumProperty /// /// Properties: -/// * [value] +/// * [value] @BuiltValue() -abstract class OuterObjectWithEnumProperty - implements - Built { +abstract class OuterObjectWithEnumProperty implements Built { @BuiltValueField(wireName: r'value') OuterEnumInteger get value; // enum valueEnum { 0, 1, 2, }; OuterObjectWithEnumProperty._(); - factory OuterObjectWithEnumProperty( - [void updates(OuterObjectWithEnumPropertyBuilder b)]) = - _$OuterObjectWithEnumProperty; + factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; @BuiltValueHook(initializeBuilder: true) static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$OuterObjectWithEnumPropertySerializer(); + static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); } -class _$OuterObjectWithEnumPropertySerializer - implements PrimitiveSerializer { +class _$OuterObjectWithEnumPropertySerializer implements PrimitiveSerializer { @override - final Iterable types = const [ - OuterObjectWithEnumProperty, - _$OuterObjectWithEnumProperty - ]; + final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; @override final String wireName = r'OuterObjectWithEnumProperty'; @@ -64,9 +55,7 @@ class _$OuterObjectWithEnumPropertySerializer OuterObjectWithEnumProperty object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -116,3 +105,5 @@ class _$OuterObjectWithEnumPropertySerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart index 7d850c051e65..7f8684221419 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart @@ -12,7 +12,7 @@ part 'parent.g.dart'; /// Parent /// /// Properties: -/// * [fruitType] +/// * [fruitType] @BuiltValue(instantiable: false) abstract class Parent implements FruitType { @BuiltValueSerializer(custom: true) @@ -44,9 +44,7 @@ class _$ParentSerializer implements PrimitiveSerializer { Parent object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -55,8 +53,7 @@ class _$ParentSerializer implements PrimitiveSerializer { Object serialized, { FullType specifiedType = FullType.unspecified, }) { - return serializers.deserialize(serialized, specifiedType: FullType($Parent)) - as $Parent; + return serializers.deserialize(serialized, specifiedType: FullType($Parent)) as $Parent; } } @@ -137,3 +134,5 @@ class _$$ParentSerializer implements PrimitiveSerializer<$Parent> { return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart index a7e314f1ec0b..eadbe2a7c706 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart @@ -12,7 +12,7 @@ part 'pasta.g.dart'; /// Pasta /// /// Properties: -/// * [vendor] +/// * [vendor] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -28,7 +28,7 @@ abstract class Pasta implements Entity, Built { factory Pasta([void updates(PastaBuilder b)]) = _$Pasta; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PastaBuilder b) => b..atType = b.discriminatorValue; + static void _defaults(PastaBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$PastaSerializer(); @@ -94,9 +94,7 @@ class _$PastaSerializer implements PrimitiveSerializer { Pasta object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -181,3 +179,10 @@ class _$PastaSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart index 02aef0413a2f..c0bdacea72bb 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart @@ -14,11 +14,11 @@ part 'pet.g.dart'; /// Pet /// /// Properties: -/// * [id] -/// * [category] -/// * [name] -/// * [photoUrls] -/// * [tags] +/// * [id] +/// * [category] +/// * [name] +/// * [photoUrls] +/// * [tags] /// * [status] - pet status in the store @BuiltValue() abstract class Pet implements Built { @@ -111,9 +111,7 @@ class _$PetSerializer implements PrimitiveSerializer { Pet object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -198,29 +196,32 @@ class _$PetSerializer implements PrimitiveSerializer { return result.build(); } } - + + + + + class PetStatusEnum extends EnumClass { + /// pet status in the store @BuiltValueEnumConst(wireName: r'available') static const PetStatusEnum available = _$petStatusEnum_available; - /// pet status in the store @BuiltValueEnumConst(wireName: r'pending') static const PetStatusEnum pending = _$petStatusEnum_pending; - /// pet status in the store @BuiltValueEnumConst(wireName: r'sold') static const PetStatusEnum sold = _$petStatusEnum_sold; - /// pet status in the store @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const PetStatusEnum unknownDefaultOpenApi = - _$petStatusEnum_unknownDefaultOpenApi; + static const PetStatusEnum unknownDefaultOpenApi = _$petStatusEnum_unknownDefaultOpenApi; static Serializer get serializer => _$petStatusEnumSerializer; - const PetStatusEnum._(String name) : super(name); + const PetStatusEnum._(String name): super(name); static BuiltSet get values => _$petStatusEnumValues; static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart index ca079abe8549..1ef6be87a4a1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart @@ -13,7 +13,7 @@ part 'pizza.g.dart'; /// Pizza /// /// Properties: -/// * [pizzaSize] +/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships @@ -35,21 +35,20 @@ abstract class Pizza implements Entity { } extension PizzaDiscriminatorExt on Pizza { - String? get discriminatorValue { - if (this is PizzaSpeziale) { - return r'PizzaSpeziale'; + String? get discriminatorValue { + if (this is PizzaSpeziale) { + return r'PizzaSpeziale'; + } + return null; } - return null; - } } - extension PizzaBuilderDiscriminatorExt on PizzaBuilder { - String? get discriminatorValue { - if (this is PizzaSpezialeBuilder) { - return r'PizzaSpeziale'; + String? get discriminatorValue { + if (this is PizzaSpezialeBuilder) { + return r'PizzaSpeziale'; + } + return null; } - return null; - } } class _$PizzaSerializer implements PrimitiveSerializer { @@ -113,12 +112,9 @@ class _$PizzaSerializer implements PrimitiveSerializer { FullType specifiedType = FullType.unspecified, }) { if (object is PizzaSpeziale) { - return serializers.serialize(object, - specifiedType: FullType(PizzaSpeziale))!; + return serializers.serialize(object, specifiedType: FullType(PizzaSpeziale))!; } - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @override @@ -129,15 +125,12 @@ class _$PizzaSerializer implements PrimitiveSerializer { }) { final serializedList = (serialized as Iterable).toList(); final discIndex = serializedList.indexOf(Pizza.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], - specifiedType: FullType(String)) as String; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; switch (discValue) { case r'PizzaSpeziale': - return serializers.deserialize(serialized, - specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; + return serializers.deserialize(serialized, specifiedType: FullType(PizzaSpeziale)) as PizzaSpeziale; default: - return serializers.deserialize(serialized, - specifiedType: FullType($Pizza)) as $Pizza; + return serializers.deserialize(serialized, specifiedType: FullType($Pizza)) as $Pizza; } } } @@ -254,3 +247,10 @@ class _$$PizzaSerializer implements PrimitiveSerializer<$Pizza> { return result.build(); } } + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart index 4c6fd7f38c26..e09185593425 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart @@ -12,30 +12,26 @@ part 'pizza_speziale.g.dart'; /// PizzaSpeziale /// /// Properties: -/// * [toppings] +/// * [toppings] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name @BuiltValue() -abstract class PizzaSpeziale - implements Pizza, Built { +abstract class PizzaSpeziale implements Pizza, Built { @BuiltValueField(wireName: r'toppings') String? get toppings; PizzaSpeziale._(); - factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = - _$PizzaSpeziale; + factory PizzaSpeziale([void updates(PizzaSpezialeBuilder b)]) = _$PizzaSpeziale; @BuiltValueHook(initializeBuilder: true) - static void _defaults(PizzaSpezialeBuilder b) => - b..atType = b.discriminatorValue; + static void _defaults(PizzaSpezialeBuilder b) => b..atType=b.discriminatorValue; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$PizzaSpezialeSerializer(); + static Serializer get serializer => _$PizzaSpezialeSerializer(); } class _$PizzaSpezialeSerializer implements PrimitiveSerializer { @@ -105,9 +101,7 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { PizzaSpeziale object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -199,3 +193,10 @@ class _$PizzaSpezialeSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart index b2501901295f..ad34b7e028bc 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart @@ -11,11 +11,10 @@ part 'read_only_first.g.dart'; /// ReadOnlyFirst /// /// Properties: -/// * [bar] -/// * [baz] +/// * [bar] +/// * [baz] @BuiltValue() -abstract class ReadOnlyFirst - implements Built { +abstract class ReadOnlyFirst implements Built { @BuiltValueField(wireName: r'bar') String? get bar; @@ -24,15 +23,13 @@ abstract class ReadOnlyFirst ReadOnlyFirst._(); - factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = - _$ReadOnlyFirst; + factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; @BuiltValueHook(initializeBuilder: true) static void _defaults(ReadOnlyFirstBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$ReadOnlyFirstSerializer(); + static Serializer get serializer => _$ReadOnlyFirstSerializer(); } class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { @@ -69,9 +66,7 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { ReadOnlyFirst object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -128,3 +123,6 @@ class _$ReadOnlyFirstSerializer implements PrimitiveSerializer { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart index 832e08c24a75..a133275a06c2 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart @@ -10,6 +10,7 @@ import 'package:built_value/serializer.dart'; part 'single_ref_type.g.dart'; class SingleRefType extends EnumClass { + @BuiltValueEnumConst(wireName: r'admin') static const SingleRefType admin = _$admin; @BuiltValueEnumConst(wireName: r'user') @@ -19,7 +20,7 @@ class SingleRefType extends EnumClass { static Serializer get serializer => _$singleRefTypeSerializer; - const SingleRefType._(String name) : super(name); + const SingleRefType._(String name): super(name); static BuiltSet get values => _$values; static SingleRefType valueOf(String name) => _$valueOf(name); @@ -32,3 +33,4 @@ class SingleRefType extends EnumClass { /// /// Trigger mixin generation by writing a line like this one next to your enum. typedef SingleRefTypeMixin = _$SingleRefTypeMixin; + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart index c5a18443b89f..43a4d95c5a95 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart @@ -11,28 +11,24 @@ part 'special_model_name.g.dart'; /// SpecialModelName /// /// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] +/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] @BuiltValue() -abstract class SpecialModelName - implements Built { +abstract class SpecialModelName implements Built { @BuiltValueField(wireName: r'$special[property.name]') int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; SpecialModelName._(); - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = - _$SpecialModelName; + factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; @BuiltValueHook(initializeBuilder: true) static void _defaults(SpecialModelNameBuilder b) => b; @BuiltValueSerializer(custom: true) - static Serializer get serializer => - _$SpecialModelNameSerializer(); + static Serializer get serializer => _$SpecialModelNameSerializer(); } -class _$SpecialModelNameSerializer - implements PrimitiveSerializer { +class _$SpecialModelNameSerializer implements PrimitiveSerializer { @override final Iterable types = const [SpecialModelName, _$SpecialModelName]; @@ -44,13 +40,10 @@ class _$SpecialModelNameSerializer SpecialModelName object, { FullType specifiedType = FullType.unspecified, }) sync* { - if (object - .dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != - null) { + if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { yield r'$special[property.name]'; yield serializers.serialize( - object - .dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, + object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, specifiedType: const FullType(int), ); } @@ -62,9 +55,7 @@ class _$SpecialModelNameSerializer SpecialModelName object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -84,8 +75,7 @@ class _$SpecialModelNameSerializer value, specifiedType: const FullType(int), ) as int; - result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = - valueDes; + result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; break; default: unhandled.add(key); @@ -115,3 +105,5 @@ class _$SpecialModelNameSerializer return result.build(); } } + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart index 87f6428e39c2..a431de33e0f1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart @@ -11,8 +11,8 @@ part 'tag.g.dart'; /// Tag /// /// Properties: -/// * [id] -/// * [name] +/// * [id] +/// * [name] @BuiltValue() abstract class Tag implements Built { @BuiltValueField(wireName: r'id') @@ -66,9 +66,7 @@ class _$TagSerializer implements PrimitiveSerializer { Tag object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -125,3 +123,6 @@ class _$TagSerializer implements PrimitiveSerializer { return result.build(); } } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart index 5d10005382ff..dd2d58fee1b5 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart @@ -11,13 +11,13 @@ part 'user.g.dart'; /// User /// /// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] +/// * [id] +/// * [username] +/// * [firstName] +/// * [lastName] +/// * [email] +/// * [password] +/// * [phone] /// * [userStatus] - User Status @BuiltValue() abstract class User implements Built { @@ -133,9 +133,7 @@ class _$UserSerializer implements PrimitiveSerializer { User object, { FullType specifiedType = FullType.unspecified, }) { - return _serializeProperties(serializers, object, - specifiedType: specifiedType) - .toList(); + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } void _deserializeProperties( @@ -234,3 +232,12 @@ class _$UserSerializer implements PrimitiveSerializer { return result.build(); } } + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart index e9148e54da0d..c4c2def37aa6 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart @@ -4,65 +4,55 @@ /// Where json in this context means a dart primitive /// JSON = String | num | bool | null | Uint8List | List | Map abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - FutureOr serialize( - T src, - TypeInfo inputTypeInfo, { - Object? context, - }); - FutureOr deserialize( - Object? value, - TypeInfo targetTypeInfo, { - Object? context, - }); + const SerializationRepositoryBase(); + + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); } /// A modified version of `built_value`'s `FullType` class, found here /// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart /// It holds type information known by the spec (including generic type parameters) class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) - : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; } - return true; - } - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } - @override - String toString() => - (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; - String get _nullabilitySuffix => nullable ? '?' : ''; + String get _nullabilitySuffix => nullable ? '?' : ''; - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } } diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart index 41de1d5838e2..c92bf3371b72 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart @@ -2,6 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // + import 'dart:convert'; import 'dart:typed_data'; @@ -15,42 +16,36 @@ import 'serializers.dart'; FullType typeInfoToFullType(TypeInfo info) { if (info.nullable) { return FullType.nullable( - info.root, - info.parameters.map(typeInfoToFullType).toList(), - ); + info.root, info.parameters.map(typeInfoToFullType).toList(),); } else { return FullType( - info.root, - info.parameters.map(typeInfoToFullType).toList(), - ); + info.root, info.parameters.map(typeInfoToFullType).toList(),); } } class BuiltValueJsonRepository extends SerializationRepositoryBase { - final Serializers serializers; - const BuiltValueJsonRepository(this.serializers); + final Serializers serializers; + const BuiltValueJsonRepository(this.serializers); - @override - FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, - {Object? context}) { - if (value is T) { - return value; + @override + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { + if (value is T) { + return value; + } + return serializers.deserialize( + value, + specifiedType: typeInfoToFullType(targetTypeInfo), + ) as T; } - return serializers.deserialize( - value, - specifiedType: typeInfoToFullType(targetTypeInfo), - ) as T; - } - - @override - FutureOr serialize(T src, TypeInfo inputTypeInfo, - {Object? context}) { - if (src == null) { - return null; + + @override + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + if (src == null) { + return null; + } + return serializers.serialize( + src, + specifiedType: typeInfoToFullType(inputTypeInfo), + ) as Object; } - return serializers.serialize( - src, - specifiedType: typeInfoToFullType(inputTypeInfo), - ) as Object; - } } diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart index 5f25b025c11e..f93ac8d59cec 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart @@ -18,11 +18,9 @@ part 'serializers.g.dart'; @SerializersFor([ AdditionalPropertiesClass, - Addressable, - $Addressable, + Addressable,$Addressable, AllOfWithSingleRef, - Animal, - $Animal, + Animal,$Animal, ApiResponse, Apple, AppleAllOfDisc, @@ -59,14 +57,11 @@ part 'serializers.g.dart'; DiscOptionalTypeIncorrect, DiscTypeIncorrect, Dog, - Entity, - $Entity, - EntityRef, - $EntityRef, + Entity,$Entity, + EntityRef,$EntityRef, EnumArrays, EnumTest, - Extensible, - $Extensible, + Extensible,$Extensible, FileSchemaTestClass, Foo, FooBasicGetDefaultResponse, @@ -86,8 +81,7 @@ part 'serializers.g.dart'; FruitInlineInlineDiscOneOfOneOf, FruitOneOfDisc, FruitReqDisc, - FruitType, - $FruitType, + FruitType,$FruitType, FruitVariant1, GigaOneOf, GrapeVariant1, @@ -113,12 +107,10 @@ part 'serializers.g.dart'; OuterEnumInteger, OuterEnumIntegerDefaultValue, OuterObjectWithEnumProperty, - Parent, - $Parent, + Parent,$Parent, Pasta, Pet, - Pizza, - $Pizza, + Pizza,$Pizza, PizzaSpeziale, ReadOnlyFirst, SingleRefType, From 491d0bf481d3f4e527326a154447192e17dcf443 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 05:00:15 +0200 Subject: [PATCH 23/31] update docs --- docs/generators/dart-next.md | 1 + .../openapitools/codegen/languages/DartNextClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/generators/dart-next.md b/docs/generators/dart-next.md index 34a93fc164f7..8bb32b61555f 100644 --- a/docs/generators/dart-next.md +++ b/docs/generators/dart-next.md @@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|library|Specify networking library|
**dio**
[DEFAULT] dio
**http**
[BETA] http
|dio| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |Author| |pubAuthorEmail|Email address of the author in generated pubspec| |author@homepage| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java index 5d54a6a35655..52beefc22bf7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -208,7 +208,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a Dart Dio client library."; + return "Generates a Dart client library."; } @Override From 4948432e59fae8135ef780a4dc6a02febfeb36ea Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 05:15:24 +0200 Subject: [PATCH 24/31] update configs --- bin/configs/dart-next-dio-built_value-v3.yaml | 2 +- .../dart-next-dio-json_serializable-v3.yaml | 6 +- .../echo_api/dart/dio/built_value}/.gitignore | 0 .../built_value}/.openapi-generator-ignore | 0 .../dio/built_value/.openapi-generator/FILES | 0 .../built_value}/.openapi-generator/VERSION | 0 .../echo_api/dart}/dio/built_value/README.md | 0 .../dio/built_value/analysis_options.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../dart}/dio/built_value/doc/Addressable.md | 0 .../dio/built_value/doc/AllOfWithSingleRef.md | 0 .../dart}/dio/built_value/doc/Animal.md | 0 .../dio/built_value/doc/AnotherFakeApi.md | 0 .../dart}/dio/built_value/doc/ApiResponse.md | 0 .../dart}/dio/built_value/doc/Apple.md | 0 .../dio/built_value/doc/AppleAllOfDisc.md | 0 .../built_value/doc/AppleGrandparentDisc.md | 0 .../dio/built_value/doc/AppleOneOfDisc.md | 0 .../dart}/dio/built_value/doc/AppleReqDisc.md | 0 .../dio/built_value/doc/AppleVariant1.md | 0 .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../dio/built_value/doc/ArrayOfNumberOnly.md | 0 .../dart}/dio/built_value/doc/ArrayTest.md | 0 .../dart}/dio/built_value/doc/Banana.md | 0 .../dio/built_value/doc/BananaAllOfDisc.md | 0 .../built_value/doc/BananaGrandparentDisc.md | 0 .../dio/built_value/doc/BananaOneOfDisc.md | 0 .../dio/built_value/doc/BananaReqDisc.md | 0 .../echo_api/dart}/dio/built_value/doc/Bar.md | 0 .../dart}/dio/built_value/doc/BarApi.md | 0 .../dart}/dio/built_value/doc/BarCreate.md | 0 .../dart}/dio/built_value/doc/BarRef.md | 0 .../dio/built_value/doc/BarRefOrValue.md | 0 .../dio/built_value/doc/Capitalization.md | 0 .../echo_api/dart}/dio/built_value/doc/Cat.md | 0 .../dart}/dio/built_value/doc/Category.md | 0 .../dart}/dio/built_value/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 0 .../doc/ComposedDiscOptionalTypeCorrect.md | 0 .../ComposedDiscOptionalTypeInconsistent.md | 0 .../doc/ComposedDiscOptionalTypeIncorrect.md | 0 .../doc/ComposedDiscRequiredInconsistent.md | 0 .../doc/ComposedDiscTypeInconsistent.md | 0 .../doc/ComposedDiscTypeIncorrect.md | 0 .../dart}/dio/built_value/doc/DefaultApi.md | 0 .../dio/built_value/doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 0 .../doc/DiscOptionalTypeCorrect.md | 0 .../doc/DiscOptionalTypeIncorrect.md | 0 .../dio/built_value/doc/DiscTypeIncorrect.md | 0 .../echo_api/dart}/dio/built_value/doc/Dog.md | 0 .../dart}/dio/built_value/doc/Entity.md | 0 .../dart}/dio/built_value/doc/EntityRef.md | 0 .../dart}/dio/built_value/doc/EnumArrays.md | 0 .../dart}/dio/built_value/doc/EnumTest.md | 0 .../dart}/dio/built_value/doc/Extensible.md | 0 .../dart}/dio/built_value/doc/FakeApi.md | 0 .../doc/FakeClassnameTags123Api.md | 0 .../built_value/doc/FileSchemaTestClass.md | 0 .../echo_api/dart}/dio/built_value/doc/Foo.md | 0 .../dart}/dio/built_value/doc/FooApi.md | 0 .../doc/FooBasicGetDefaultResponse.md | 0 .../dart}/dio/built_value/doc/FooRef.md | 0 .../dio/built_value/doc/FooRefOrValue.md | 0 .../dart}/dio/built_value/doc/FormatTest.md | 0 .../dart}/dio/built_value/doc/Fruit.md | 0 .../dio/built_value/doc/FruitAllOfDisc.md | 0 .../dio/built_value/doc/FruitAnyOfDisc.md | 0 .../built_value/doc/FruitGrandparentDisc.md | 0 .../dio/built_value/doc/FruitInlineDisc.md | 0 .../built_value/doc/FruitInlineDiscOneOf.md | 0 .../built_value/doc/FruitInlineDiscOneOf1.md | 0 .../built_value/doc/FruitInlineInlineDisc.md | 0 .../doc/FruitInlineInlineDiscOneOf.md | 0 .../doc/FruitInlineInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDiscOneOfOneOf.md | 0 .../dio/built_value/doc/FruitOneOfDisc.md | 0 .../dart}/dio/built_value/doc/FruitReqDisc.md | 0 .../dart}/dio/built_value/doc/FruitType.md | 0 .../dio/built_value/doc/FruitVariant1.md | 0 .../dart}/dio/built_value/doc/GigaOneOf.md | 0 .../dio/built_value/doc/GrapeVariant1.md | 0 .../dio/built_value/doc/HasOnlyReadOnly.md | 0 .../dio/built_value/doc/HealthCheckResult.md | 0 .../dart}/dio/built_value/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../dio/built_value/doc/Model200Response.md | 0 .../dart}/dio/built_value/doc/ModelClient.md | 0 .../dio/built_value/doc/ModelEnumClass.md | 0 .../dart}/dio/built_value/doc/ModelFile.md | 0 .../dart}/dio/built_value/doc/ModelList.md | 0 .../dart}/dio/built_value/doc/ModelReturn.md | 0 .../dart}/dio/built_value/doc/Name.md | 0 .../dio/built_value/doc/NullableClass.md | 0 .../dart}/dio/built_value/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 0 .../built_value/doc/OneOfPrimitiveChild.md | 0 .../dart}/dio/built_value/doc/Order.md | 0 .../dio/built_value/doc/OuterComposite.md | 0 .../dart}/dio/built_value/doc/OuterEnum.md | 0 .../built_value/doc/OuterEnumDefaultValue.md | 0 .../dio/built_value/doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dart}/dio/built_value/doc/Parent.md | 0 .../dart}/dio/built_value/doc/Pasta.md | 0 .../echo_api/dart}/dio/built_value/doc/Pet.md | 0 .../dart}/dio/built_value/doc/PetApi.md | 0 .../dart}/dio/built_value/doc/Pizza.md | 0 .../dio/built_value/doc/PizzaSpeziale.md | 0 .../dio/built_value/doc/ReadOnlyFirst.md | 0 .../dio/built_value/doc/SingleRefType.md | 0 .../dio/built_value/doc/SpecialModelName.md | 0 .../dart}/dio/built_value/doc/StoreApi.md | 0 .../echo_api/dart}/dio/built_value/doc/Tag.md | 0 .../dart}/dio/built_value/doc/User.md | 0 .../dart}/dio/built_value/doc/UserApi.md | 0 .../dart}/dio/built_value/lib/apis.dart | 0 .../dart}/dio/built_value/lib/models.dart | 0 .../dart}/dio/built_value/lib/openapi.dart | 0 .../lib/src/api/another_fake_api.dart | 0 .../dio/built_value/lib/src/api/bar_api.dart | 0 .../built_value/lib/src/api/default_api.dart | 0 .../dio/built_value/lib/src/api/fake_api.dart | 0 .../src/api/fake_classname_tags123_api.dart | 0 .../dio/built_value/lib/src/api/foo_api.dart | 0 .../dio/built_value/lib/src/api/pet_api.dart | 0 .../built_value/lib/src/api/store_api.dart | 0 .../dio/built_value/lib/src/api/user_api.dart | 0 .../dio/built_value/lib/src/api_client.dart | 0 .../dio/built_value/lib/src/api_util.dart | 0 .../built_value/lib/src/auth/_exports.dart | 0 .../lib/src/auth/api_key_auth.dart | 0 .../dio/built_value}/lib/src/auth/auth.dart | 0 .../built_value}/lib/src/auth/basic_auth.dart | 0 .../lib/src/auth/bearer_auth.dart | 0 .../dio/built_value}/lib/src/auth/oauth.dart | 0 .../built_value/lib/src/date_serializer.dart | 0 .../model/additional_properties_class.dart | 0 .../lib/src/model/addressable.dart | 0 .../lib/src/model/all_of_with_single_ref.dart | 0 .../dio/built_value/lib/src/model/animal.dart | 0 .../lib/src/model/api_response.dart | 0 .../dio/built_value/lib/src/model/apple.dart | 0 .../lib/src/model/apple_all_of_disc.dart | 0 .../lib/src/model/apple_grandparent_disc.dart | 0 .../lib/src/model/apple_one_of_disc.dart | 0 .../lib/src/model/apple_req_disc.dart | 0 .../lib/src/model/apple_variant1.dart | 0 .../model/array_of_array_of_number_only.dart | 0 .../lib/src/model/array_of_number_only.dart | 0 .../built_value/lib/src/model/array_test.dart | 0 .../dio/built_value/lib/src/model/banana.dart | 0 .../lib/src/model/banana_all_of_disc.dart | 0 .../src/model/banana_grandparent_disc.dart | 0 .../lib/src/model/banana_one_of_disc.dart | 0 .../lib/src/model/banana_req_disc.dart | 0 .../dio/built_value/lib/src/model/bar.dart | 0 .../built_value/lib/src/model/bar_create.dart | 0 .../built_value/lib/src/model/bar_ref.dart | 0 .../lib/src/model/bar_ref_or_value.dart | 0 .../lib/src/model/capitalization.dart | 0 .../dio/built_value/lib/src/model/cat.dart | 0 .../built_value/lib/src/model/category.dart | 0 .../lib/src/model/class_model.dart | 0 ...composed_disc_missing_from_properties.dart | 0 .../composed_disc_optional_type_correct.dart | 0 ...posed_disc_optional_type_inconsistent.dart | 0 ...composed_disc_optional_type_incorrect.dart | 0 .../composed_disc_required_inconsistent.dart | 0 .../composed_disc_type_inconsistent.dart | 0 .../model/composed_disc_type_incorrect.dart | 0 .../dio/built_value/lib/src/model/date.dart | 0 .../lib/src/model/deprecated_object.dart | 0 .../model/disc_missing_from_properties.dart | 0 .../src/model/disc_optional_type_correct.dart | 0 .../model/disc_optional_type_incorrect.dart | 0 .../lib/src/model/disc_type_incorrect.dart | 0 .../dio/built_value/lib/src/model/dog.dart | 0 .../dio/built_value/lib/src/model/entity.dart | 0 .../built_value/lib/src/model/entity_ref.dart | 0 .../lib/src/model/enum_arrays.dart | 0 .../built_value/lib/src/model/enum_test.dart | 0 .../built_value/lib/src/model/extensible.dart | 0 .../lib/src/model/file_schema_test_class.dart | 0 .../dio/built_value/lib/src/model/foo.dart | 0 .../model/foo_basic_get_default_response.dart | 0 .../built_value/lib/src/model/foo_ref.dart | 0 .../lib/src/model/foo_ref_or_value.dart | 0 .../lib/src/model/format_test.dart | 0 .../dio/built_value/lib/src/model/fruit.dart | 0 .../lib/src/model/fruit_all_of_disc.dart | 0 .../lib/src/model/fruit_any_of_disc.dart | 0 .../lib/src/model/fruit_grandparent_disc.dart | 0 .../lib/src/model/fruit_inline_disc.dart | 0 .../src/model/fruit_inline_disc_one_of.dart | 0 .../src/model/fruit_inline_disc_one_of1.dart | 0 .../src/model/fruit_inline_inline_disc.dart | 0 .../fruit_inline_inline_disc_one_of.dart | 0 .../fruit_inline_inline_disc_one_of1.dart | 0 ...ruit_inline_inline_disc_one_of_one_of.dart | 0 .../lib/src/model/fruit_one_of_disc.dart | 0 .../lib/src/model/fruit_req_disc.dart | 0 .../built_value/lib/src/model/fruit_type.dart | 0 .../lib/src/model/fruit_variant1.dart | 0 .../lib/src/model/giga_one_of.dart | 0 .../lib/src/model/grape_variant1.dart | 0 .../lib/src/model/has_only_read_only.dart | 0 .../lib/src/model/health_check_result.dart | 0 .../built_value/lib/src/model/map_test.dart | 0 ...rties_and_additional_properties_class.dart | 0 .../lib/src/model/model200_response.dart | 0 .../lib/src/model/model_client.dart | 0 .../lib/src/model/model_enum_class.dart | 0 .../built_value/lib/src/model/model_file.dart | 0 .../built_value/lib/src/model/model_list.dart | 0 .../lib/src/model/model_return.dart | 0 .../dio/built_value/lib/src/model/name.dart | 0 .../lib/src/model/nullable_class.dart | 0 .../lib/src/model/number_only.dart | 0 .../model/object_with_deprecated_fields.dart | 0 .../lib/src/model/one_of_primitive_child.dart | 0 .../dio/built_value/lib/src/model/order.dart | 0 .../lib/src/model/outer_composite.dart | 0 .../built_value/lib/src/model/outer_enum.dart | 0 .../src/model/outer_enum_default_value.dart | 0 .../lib/src/model/outer_enum_integer.dart | 0 .../outer_enum_integer_default_value.dart | 0 .../outer_object_with_enum_property.dart | 0 .../dio/built_value/lib/src/model/parent.dart | 0 .../dio/built_value/lib/src/model/pasta.dart | 0 .../dio/built_value/lib/src/model/pet.dart | 0 .../dio/built_value/lib/src/model/pizza.dart | 0 .../lib/src/model/pizza_speziale.dart | 0 .../lib/src/model/read_only_first.dart | 0 .../lib/src/model/single_ref_type.dart | 0 .../lib/src/model/special_model_name.dart | 0 .../dio/built_value/lib/src/model/tag.dart | 0 .../dio/built_value/lib/src/model/user.dart | 0 .../built_value/lib/src/repository_base.dart | 0 .../built_value/lib/src/repository_impl.dart | 0 .../dio/built_value/lib/src/serializers.dart | 0 .../echo_api/dart}/dio/built_value/pom.xml | 0 .../dart}/dio/built_value/pubspec.yaml | 0 .../additional_properties_class_test.dart | 0 .../built_value/test/addressable_test.dart | 0 .../test/all_of_with_single_ref_test.dart | 0 .../dio/built_value/test/animal_test.dart | 0 .../test/another_fake_api_test.dart | 0 .../built_value/test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 0 .../test/apple_grandparent_disc_test.dart | 0 .../test/apple_one_of_disc_test.dart | 0 .../built_value/test/apple_req_disc_test.dart | 0 .../dio/built_value/test/apple_test.dart | 0 .../built_value/test/apple_variant1_test.dart | 0 .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../dio/built_value/test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 0 .../test/banana_grandparent_disc_test.dart | 0 .../test/banana_one_of_disc_test.dart | 0 .../test/banana_req_disc_test.dart | 0 .../dio/built_value/test/banana_test.dart | 0 .../dio/built_value/test/bar_api_test.dart | 0 .../dio/built_value/test/bar_create_test.dart | 0 .../test/bar_ref_or_value_test.dart | 0 .../dio/built_value/test/bar_ref_test.dart | 0 .../dart}/dio/built_value/test/bar_test.dart | 0 .../built_value/test/capitalization_test.dart | 0 .../dart}/dio/built_value/test/cat_test.dart | 0 .../dio/built_value/test/category_test.dart | 0 .../built_value/test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 0 ...posed_disc_optional_type_correct_test.dart | 0 ..._disc_optional_type_inconsistent_test.dart | 0 ...sed_disc_optional_type_incorrect_test.dart | 0 ...posed_disc_required_inconsistent_test.dart | 0 .../composed_disc_type_inconsistent_test.dart | 0 .../composed_disc_type_incorrect_test.dart | 0 .../built_value/test/default_api_test.dart | 0 .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 0 .../test/disc_optional_type_correct_test.dart | 0 .../disc_optional_type_incorrect_test.dart | 0 .../test/disc_type_incorrect_test.dart | 0 .../dart}/dio/built_value/test/dog_test.dart | 0 .../dio/built_value/test/entity_ref_test.dart | 0 .../dio/built_value/test/entity_test.dart | 0 .../built_value/test/enum_arrays_test.dart | 0 .../dio/built_value/test/enum_test_test.dart | 0 .../dio/built_value/test/extensible_test.dart | 0 .../dio/built_value/test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../dio/built_value/test/foo_api_test.dart | 0 .../foo_basic_get_default_response_test.dart | 0 .../test/foo_ref_or_value_test.dart | 0 .../dio/built_value/test/foo_ref_test.dart | 0 .../dart}/dio/built_value/test/foo_test.dart | 0 .../built_value/test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 0 .../test/fruit_any_of_disc_test.dart | 0 .../test/fruit_grandparent_disc_test.dart | 0 .../test/fruit_inline_disc_one_of1_test.dart | 0 .../test/fruit_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_disc_test.dart | 0 ...fruit_inline_inline_disc_one_of1_test.dart | 0 ...inline_inline_disc_one_of_one_of_test.dart | 0 .../fruit_inline_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_inline_disc_test.dart | 0 .../test/fruit_one_of_disc_test.dart | 0 .../built_value/test/fruit_req_disc_test.dart | 0 .../dio/built_value/test/fruit_test.dart | 0 .../dio/built_value/test/fruit_type_test.dart | 0 .../built_value/test/fruit_variant1_test.dart | 0 .../built_value/test/giga_one_of_test.dart | 0 .../built_value/test/grape_variant1_test.dart | 0 .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../dio/built_value/test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../built_value/test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../dio/built_value/test/model_file_test.dart | 0 .../dio/built_value/test/model_list_test.dart | 0 .../built_value/test/model_return_test.dart | 0 .../dart}/dio/built_value/test/name_test.dart | 0 .../built_value/test/nullable_class_test.dart | 0 .../built_value/test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 0 .../test/one_of_primitive_child_test.dart | 0 .../dio/built_value/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../dio/built_value/test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../dio/built_value/test/parent_test.dart | 0 .../dio/built_value/test/pasta_test.dart | 0 .../dio/built_value/test/pet_api_test.dart | 0 .../dart}/dio/built_value/test/pet_test.dart | 0 .../built_value/test/pizza_speziale_test.dart | 0 .../dio/built_value/test/pizza_test.dart | 0 .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../dio/built_value/test/store_api_test.dart | 0 .../dart}/dio/built_value/test/tag_test.dart | 0 .../dio/built_value/test/user_api_test.dart | 0 .../dart}/dio/built_value/test/user_test.dart | 0 .../dart}/dio/built_value_tests/.gitignore | 0 .../dart}/dio/built_value_tests/README.md | 0 .../built_value_tests/analysis_options.yaml | 0 .../dart}/dio/built_value_tests/pubspec.yaml | 0 .../dart}/dio/built_value_tests/puby.yaml | 0 .../test/api/authentication_test.dart | 0 .../test/api/fake_api_test.dart | 0 .../test/api/pet_api_test.dart | 0 .../test/api/store_api_test.dart | 0 .../built_value_tests/test/api_util_test.dart | 0 .../test/model/date_serializer_test.dart | 0 .../test/model/date_test.dart | 0 .../dart/dio/json_serializable}/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/FILES | 109 -- .../.openapi-generator/VERSION | 0 .../dart}/dio/json_serializable/README.md | 2 +- .../json_serializable/analysis_options.yaml | 0 .../dart}/dio/json_serializable/build.yaml | 0 .../doc/AdditionalPropertiesClass.md | 0 .../dio/json_serializable/doc/Addressable.md | 0 .../doc/AllOfWithSingleRef.md | 0 .../dart}/dio/json_serializable/doc/Animal.md | 2 +- .../json_serializable/doc/AnotherFakeApi.md | 0 .../dio/json_serializable/doc/ApiResponse.md | 0 .../dart}/dio/json_serializable/doc/Apple.md | 0 .../json_serializable/doc/AppleAllOfDisc.md | 0 .../doc/AppleGrandparentDisc.md | 0 .../json_serializable/doc/AppleOneOfDisc.md | 0 .../dio/json_serializable/doc/AppleReqDisc.md | 0 .../json_serializable/doc/AppleVariant1.md | 0 .../doc/ArrayOfArrayOfNumberOnly.md | 0 .../doc/ArrayOfNumberOnly.md | 0 .../dio/json_serializable/doc/ArrayTest.md | 0 .../dart}/dio/json_serializable/doc/Banana.md | 0 .../json_serializable/doc/BananaAllOfDisc.md | 0 .../doc/BananaGrandparentDisc.md | 0 .../json_serializable/doc/BananaOneOfDisc.md | 0 .../json_serializable/doc/BananaReqDisc.md | 0 .../dart}/dio/json_serializable/doc/Bar.md | 0 .../dart}/dio/json_serializable/doc/BarApi.md | 0 .../dio/json_serializable/doc/BarCreate.md | 0 .../dart}/dio/json_serializable/doc/BarRef.md | 0 .../json_serializable/doc/BarRefOrValue.md | 0 .../json_serializable/doc/Capitalization.md | 0 .../dart}/dio/json_serializable/doc/Cat.md | 2 +- .../dio/json_serializable/doc/Category.md | 2 +- .../dio/json_serializable/doc/ClassModel.md | 0 .../doc/ComposedDiscMissingFromProperties.md | 0 .../doc/ComposedDiscOptionalTypeCorrect.md | 0 .../ComposedDiscOptionalTypeInconsistent.md | 0 .../doc/ComposedDiscOptionalTypeIncorrect.md | 0 .../doc/ComposedDiscRequiredInconsistent.md | 0 .../doc/ComposedDiscTypeInconsistent.md | 0 .../doc/ComposedDiscTypeIncorrect.md | 0 .../dio/json_serializable/doc/DefaultApi.md | 0 .../json_serializable/doc/DeprecatedObject.md | 0 .../doc/DiscMissingFromProperties.md | 0 .../doc/DiscOptionalTypeCorrect.md | 0 .../doc/DiscOptionalTypeIncorrect.md | 0 .../doc/DiscTypeIncorrect.md | 0 .../dart}/dio/json_serializable/doc/Dog.md | 2 +- .../dart}/dio/json_serializable/doc/Entity.md | 0 .../dio/json_serializable/doc/EntityRef.md | 0 .../dio/json_serializable/doc/EnumArrays.md | 0 .../dio/json_serializable/doc/EnumTest.md | 0 .../dio/json_serializable/doc/Extensible.md | 0 .../dio/json_serializable/doc/FakeApi.md | 0 .../doc/FakeClassnameTags123Api.md | 0 .../doc/FileSchemaTestClass.md | 0 .../dart}/dio/json_serializable/doc/Foo.md | 0 .../dart}/dio/json_serializable/doc/FooApi.md | 0 .../doc/FooBasicGetDefaultResponse.md | 0 .../dart}/dio/json_serializable/doc/FooRef.md | 0 .../json_serializable/doc/FooRefOrValue.md | 0 .../dio/json_serializable/doc/FormatTest.md | 0 .../dart}/dio/json_serializable/doc/Fruit.md | 0 .../json_serializable/doc/FruitAllOfDisc.md | 0 .../json_serializable/doc/FruitAnyOfDisc.md | 0 .../doc/FruitGrandparentDisc.md | 0 .../json_serializable/doc/FruitInlineDisc.md | 0 .../doc/FruitInlineDiscOneOf.md | 0 .../doc/FruitInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDisc.md | 0 .../doc/FruitInlineInlineDiscOneOf.md | 0 .../doc/FruitInlineInlineDiscOneOf1.md | 0 .../doc/FruitInlineInlineDiscOneOfOneOf.md | 0 .../json_serializable/doc/FruitOneOfDisc.md | 0 .../dio/json_serializable/doc/FruitReqDisc.md | 0 .../dio/json_serializable/doc/FruitType.md | 0 .../json_serializable/doc/FruitVariant1.md | 0 .../dio/json_serializable/doc/GigaOneOf.md | 0 .../json_serializable/doc/GrapeVariant1.md | 0 .../json_serializable/doc/HasOnlyReadOnly.md | 0 .../doc/HealthCheckResult.md | 0 .../dio/json_serializable/doc/MapTest.md | 0 ...dPropertiesAndAdditionalPropertiesClass.md | 0 .../json_serializable/doc/Model200Response.md | 0 .../dio/json_serializable/doc/ModelClient.md | 0 .../json_serializable/doc/ModelEnumClass.md | 0 .../dio/json_serializable/doc/ModelFile.md | 0 .../dio/json_serializable/doc/ModelList.md | 0 .../dio/json_serializable/doc/ModelReturn.md | 0 .../dart}/dio/json_serializable/doc/Name.md | 0 .../json_serializable/doc/NullableClass.md | 0 .../dio/json_serializable/doc/NumberOnly.md | 0 .../doc/ObjectWithDeprecatedFields.md | 0 .../doc/OneOfPrimitiveChild.md | 0 .../dart}/dio/json_serializable/doc/Order.md | 0 .../json_serializable/doc/OuterComposite.md | 0 .../dio/json_serializable/doc/OuterEnum.md | 0 .../doc/OuterEnumDefaultValue.md | 0 .../json_serializable/doc/OuterEnumInteger.md | 0 .../doc/OuterEnumIntegerDefaultValue.md | 0 .../doc/OuterObjectWithEnumProperty.md | 0 .../dart}/dio/json_serializable/doc/Parent.md | 0 .../dart}/dio/json_serializable/doc/Pasta.md | 0 .../dart}/dio/json_serializable/doc/Pet.md | 0 .../dart}/dio/json_serializable/doc/PetApi.md | 0 .../dart}/dio/json_serializable/doc/Pizza.md | 0 .../json_serializable/doc/PizzaSpeziale.md | 0 .../json_serializable/doc/ReadOnlyFirst.md | 0 .../json_serializable/doc/SingleRefType.md | 0 .../json_serializable/doc/SpecialModelName.md | 0 .../dio/json_serializable/doc/StoreApi.md | 0 .../dart}/dio/json_serializable/doc/Tag.md | 0 .../dart}/dio/json_serializable/doc/User.md | 0 .../dio/json_serializable/doc/UserApi.md | 0 .../dart}/dio/json_serializable/lib/apis.dart | 0 .../dio/json_serializable/lib/models.dart | 1 + .../dio/json_serializable/lib/openapi.dart | 1 + .../dio/json_serializable/lib/src/api.dart | 0 .../lib/src/api/another_fake_api.dart | 37 +- .../lib/src/api/bar_api.dart | 44 +- .../lib/src/api/default_api.dart | 164 +- .../lib/src/api/fake_api.dart | 43 +- .../src/api/fake_classname_tags123_api.dart | 37 +- .../lib/src/api/foo_api.dart | 76 +- .../lib/src/api/pet_api.dart | 404 +++-- .../lib/src/api/store_api.dart | 129 +- .../lib/src/api/user_api.dart | 250 ++- .../json_serializable/lib/src/api_client.dart | 27 +- .../json_serializable/lib/src/api_util.dart | 88 ++ .../lib/src/auth/_exports.dart | 2 +- .../lib/src/auth/api_key_auth.dart | 0 .../json_serializable}/lib/src/auth/auth.dart | 0 .../lib/src/auth/basic_auth.dart | 0 .../lib/src/auth/bearer_auth.dart | 0 .../lib/src/auth/oauth.dart | 0 .../lib/src/deserialize.dart | 0 .../model/additional_properties_class.dart | 0 .../lib/src/model/addressable.dart | 0 .../lib/src/model/all_of_with_single_ref.dart | 0 .../lib/src/model/animal.dart | 0 .../lib/src/model/api_response.dart | 0 .../lib/src/model/apple.dart | 0 .../lib/src/model/apple_all_of_disc.dart | 0 .../lib/src/model/apple_grandparent_disc.dart | 0 .../lib/src/model/apple_one_of_disc.dart | 0 .../lib/src/model/apple_req_disc.dart | 0 .../lib/src/model/apple_variant1.dart | 0 .../model/array_of_array_of_number_only.dart | 0 .../lib/src/model/array_of_number_only.dart | 0 .../lib/src/model/array_test.dart | 0 .../lib/src/model/banana.dart | 0 .../lib/src/model/banana_all_of_disc.dart | 0 .../src/model/banana_grandparent_disc.dart | 0 .../lib/src/model/banana_one_of_disc.dart | 0 .../lib/src/model/banana_req_disc.dart | 0 .../json_serializable/lib/src/model/bar.dart | 0 .../lib/src/model/bar_create.dart | 0 .../lib/src/model/bar_ref.dart | 0 .../lib/src/model/bar_ref_or_value.dart | 0 .../lib/src/model/capitalization.dart | 0 .../json_serializable/lib/src/model/cat.dart | 0 .../lib/src/model/category.dart | 0 .../lib/src/model/class_model.dart | 0 ...composed_disc_missing_from_properties.dart | 0 .../composed_disc_optional_type_correct.dart | 0 ...posed_disc_optional_type_inconsistent.dart | 0 ...composed_disc_optional_type_incorrect.dart | 0 .../composed_disc_required_inconsistent.dart | 0 .../composed_disc_type_inconsistent.dart | 0 .../model/composed_disc_type_incorrect.dart | 0 .../lib/src/model/deprecated_object.dart | 0 .../model/disc_missing_from_properties.dart | 0 .../src/model/disc_optional_type_correct.dart | 0 .../model/disc_optional_type_incorrect.dart | 0 .../lib/src/model/disc_type_incorrect.dart | 0 .../json_serializable/lib/src/model/dog.dart | 0 .../lib/src/model/entity.dart | 0 .../lib/src/model/entity_ref.dart | 0 .../lib/src/model/enum_arrays.dart | 12 +- .../lib/src/model/enum_test.dart | 22 +- .../lib/src/model/extensible.dart | 0 .../lib/src/model/file_schema_test_class.dart | 0 .../json_serializable/lib/src/model/foo.dart | 0 .../model/foo_basic_get_default_response.dart | 0 .../lib/src/model/foo_ref.dart | 0 .../lib/src/model/foo_ref_or_value.dart | 0 .../lib/src/model/format_test.dart | 0 .../lib/src/model/fruit.dart | 0 .../lib/src/model/fruit_all_of_disc.dart | 0 .../lib/src/model/fruit_any_of_disc.dart | 0 .../lib/src/model/fruit_grandparent_disc.dart | 0 .../lib/src/model/fruit_inline_disc.dart | 0 .../src/model/fruit_inline_disc_one_of.dart | 0 .../src/model/fruit_inline_disc_one_of1.dart | 0 .../src/model/fruit_inline_inline_disc.dart | 0 .../fruit_inline_inline_disc_one_of.dart | 0 .../fruit_inline_inline_disc_one_of1.dart | 0 ...ruit_inline_inline_disc_one_of_one_of.dart | 0 .../lib/src/model/fruit_one_of_disc.dart | 0 .../lib/src/model/fruit_req_disc.dart | 0 .../lib/src/model/fruit_type.dart | 0 .../lib/src/model/fruit_variant1.dart | 0 .../lib/src/model/giga_one_of.dart | 0 .../lib/src/model/grape_variant1.dart | 0 .../lib/src/model/has_only_read_only.dart | 0 .../lib/src/model/health_check_result.dart | 0 .../lib/src/model/map_test.dart | 6 +- ...rties_and_additional_properties_class.dart | 0 .../lib/src/model/model200_response.dart | 0 .../lib/src/model/model_client.dart | 0 .../lib/src/model/model_enum_class.dart | 8 +- .../lib/src/model/model_file.dart | 0 .../lib/src/model/model_list.dart | 0 .../lib/src/model/model_return.dart | 0 .../json_serializable/lib/src/model/name.dart | 0 .../lib/src/model/nullable_class.dart | 0 .../lib/src/model/number_only.dart | 0 .../model/object_with_deprecated_fields.dart | 0 .../lib/src/model/one_of_primitive_child.dart | 0 .../lib/src/model/order.dart | 8 +- .../lib/src/model/outer_composite.dart | 0 .../lib/src/model/outer_enum.dart | 8 +- .../src/model/outer_enum_default_value.dart | 8 +- .../lib/src/model/outer_enum_integer.dart | 0 .../outer_enum_integer_default_value.dart | 0 .../outer_object_with_enum_property.dart | 0 .../lib/src/model/parent.dart | 0 .../lib/src/model/pasta.dart | 0 .../json_serializable/lib/src/model/pet.dart | 8 +- .../lib/src/model/pizza.dart | 0 .../lib/src/model/pizza_speziale.dart | 0 .../lib/src/model/read_only_first.dart | 0 .../lib/src/model/single_ref_type.dart | 6 +- .../lib/src/model/special_model_name.dart | 0 .../json_serializable/lib/src/model/tag.dart | 0 .../json_serializable/lib/src/model/user.dart | 0 .../lib/src/repository_base.dart | 58 + .../lib/src/repository_impl.dart | 315 ++++ .../dart}/dio/json_serializable/pom.xml | 0 .../dart}/dio/json_serializable/pubspec.yaml | 0 .../additional_properties_class_test.dart | 0 .../test/addressable_test.dart | 0 .../test/all_of_with_single_ref_test.dart | 0 .../json_serializable/test/animal_test.dart | 0 .../test/another_fake_api_test.dart | 0 .../test/api_response_test.dart | 0 .../test/apple_all_of_disc_test.dart | 0 .../test/apple_grandparent_disc_test.dart | 0 .../test/apple_one_of_disc_test.dart | 0 .../test/apple_req_disc_test.dart | 0 .../json_serializable/test/apple_test.dart | 0 .../test/apple_variant1_test.dart | 0 .../array_of_array_of_number_only_test.dart | 0 .../test/array_of_number_only_test.dart | 0 .../test/array_test_test.dart | 0 .../test/banana_all_of_disc_test.dart | 0 .../test/banana_grandparent_disc_test.dart | 0 .../test/banana_one_of_disc_test.dart | 0 .../test/banana_req_disc_test.dart | 0 .../json_serializable/test/banana_test.dart | 0 .../json_serializable/test/bar_api_test.dart | 0 .../test/bar_create_test.dart | 0 .../test/bar_ref_or_value_test.dart | 0 .../json_serializable/test/bar_ref_test.dart | 0 .../dio/json_serializable/test/bar_test.dart | 0 .../test/capitalization_test.dart | 0 .../dio/json_serializable/test/cat_test.dart | 0 .../json_serializable/test/category_test.dart | 0 .../test/class_model_test.dart | 0 ...sed_disc_missing_from_properties_test.dart | 0 ...posed_disc_optional_type_correct_test.dart | 0 ..._disc_optional_type_inconsistent_test.dart | 0 ...sed_disc_optional_type_incorrect_test.dart | 0 ...posed_disc_required_inconsistent_test.dart | 0 .../composed_disc_type_inconsistent_test.dart | 0 .../composed_disc_type_incorrect_test.dart | 0 .../test/default_api_test.dart | 0 .../test/deprecated_object_test.dart | 0 .../disc_missing_from_properties_test.dart | 0 .../test/disc_optional_type_correct_test.dart | 0 .../disc_optional_type_incorrect_test.dart | 0 .../test/disc_type_incorrect_test.dart | 0 .../dio/json_serializable/test/dog_test.dart | 0 .../test/entity_ref_test.dart | 0 .../json_serializable/test/entity_test.dart | 0 .../test/enum_arrays_test.dart | 0 .../test/enum_test_test.dart | 0 .../test/extensible_test.dart | 0 .../json_serializable/test/fake_api_test.dart | 0 .../test/fake_classname_tags123_api_test.dart | 0 .../test/file_schema_test_class_test.dart | 0 .../json_serializable/test/foo_api_test.dart | 0 .../foo_basic_get_default_response_test.dart | 0 .../test/foo_ref_or_value_test.dart | 0 .../json_serializable/test/foo_ref_test.dart | 0 .../dio/json_serializable/test/foo_test.dart | 0 .../test/format_test_test.dart | 0 .../test/fruit_all_of_disc_test.dart | 0 .../test/fruit_any_of_disc_test.dart | 0 .../test/fruit_grandparent_disc_test.dart | 0 .../test/fruit_inline_disc_one_of1_test.dart | 0 .../test/fruit_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_disc_test.dart | 0 ...fruit_inline_inline_disc_one_of1_test.dart | 0 ...inline_inline_disc_one_of_one_of_test.dart | 0 .../fruit_inline_inline_disc_one_of_test.dart | 0 .../test/fruit_inline_inline_disc_test.dart | 0 .../test/fruit_one_of_disc_test.dart | 0 .../test/fruit_req_disc_test.dart | 0 .../json_serializable/test/fruit_test.dart | 0 .../test/fruit_type_test.dart | 0 .../test/fruit_variant1_test.dart | 0 .../test/giga_one_of_test.dart | 0 .../test/grape_variant1_test.dart | 0 .../test/has_only_read_only_test.dart | 0 .../test/health_check_result_test.dart | 0 .../json_serializable/test/map_test_test.dart | 0 ..._and_additional_properties_class_test.dart | 0 .../test/model200_response_test.dart | 0 .../test/model_client_test.dart | 0 .../test/model_enum_class_test.dart | 0 .../test/model_file_test.dart | 0 .../test/model_list_test.dart | 0 .../test/model_return_test.dart | 0 .../dio/json_serializable/test/name_test.dart | 0 .../test/nullable_class_test.dart | 0 .../test/number_only_test.dart | 0 .../object_with_deprecated_fields_test.dart | 0 .../test/one_of_primitive_child_test.dart | 0 .../json_serializable/test/order_test.dart | 0 .../test/outer_composite_test.dart | 0 .../test/outer_enum_default_value_test.dart | 0 ...outer_enum_integer_default_value_test.dart | 0 .../test/outer_enum_integer_test.dart | 0 .../test/outer_enum_test.dart | 0 .../outer_object_with_enum_property_test.dart | 0 .../json_serializable/test/parent_test.dart | 0 .../json_serializable/test/pasta_test.dart | 0 .../json_serializable/test/pet_api_test.dart | 0 .../dio/json_serializable/test/pet_test.dart | 0 .../test/pizza_speziale_test.dart | 0 .../json_serializable/test/pizza_test.dart | 0 .../test/read_only_first_test.dart | 0 .../test/single_ref_type_test.dart | 0 .../test/special_model_name_test.dart | 0 .../test/store_api_test.dart | 0 .../dio/json_serializable/test/tag_test.dart | 0 .../json_serializable/test/user_api_test.dart | 0 .../dio/json_serializable/test/user_test.dart | 0 .../.openapi-generator/FILES | 341 ---- .../json_serializable/analysis_options.yaml | 12 - .../doc/AdditionalPropertiesClass.md | 16 - .../dio/json_serializable/doc/Addressable.md | 16 - .../doc/AllOfWithSingleRef.md | 16 - .../json_serializable/doc/AnotherFakeApi.md | 57 - .../dio/json_serializable/doc/ApiResponse.md | 17 - .../dio/json_serializable/doc/Apple.md | 15 - .../json_serializable/doc/AppleAllOfDisc.md | 16 - .../doc/AppleGrandparentDisc.md | 16 - .../json_serializable/doc/AppleOneOfDisc.md | 16 - .../dio/json_serializable/doc/AppleReqDisc.md | 16 - .../json_serializable/doc/AppleVariant1.md | 15 - .../doc/ArrayOfArrayOfNumberOnly.md | 15 - .../doc/ArrayOfNumberOnly.md | 15 - .../dio/json_serializable/doc/ArrayTest.md | 17 - .../dio/json_serializable/doc/Banana.md | 15 - .../json_serializable/doc/BananaAllOfDisc.md | 16 - .../doc/BananaGrandparentDisc.md | 16 - .../json_serializable/doc/BananaOneOfDisc.md | 16 - .../json_serializable/doc/BananaReqDisc.md | 16 - .../dart-dio/dio/json_serializable/doc/Bar.md | 22 - .../dio/json_serializable/doc/BarApi.md | 55 - .../dio/json_serializable/doc/BarCreate.md | 22 - .../dio/json_serializable/doc/BarRef.md | 19 - .../json_serializable/doc/BarRefOrValue.md | 19 - .../json_serializable/doc/Capitalization.md | 20 - .../dio/json_serializable/doc/ClassModel.md | 15 - .../doc/ComposedDiscMissingFromProperties.md | 15 - .../doc/ComposedDiscOptionalTypeCorrect.md | 15 - .../ComposedDiscOptionalTypeInconsistent.md | 15 - .../doc/ComposedDiscOptionalTypeIncorrect.md | 15 - .../doc/ComposedDiscRequiredInconsistent.md | 15 - .../doc/ComposedDiscTypeInconsistent.md | 15 - .../doc/ComposedDiscTypeIncorrect.md | 15 - .../dio/json_serializable/doc/DefaultApi.md | 244 --- .../json_serializable/doc/DeprecatedObject.md | 15 - .../doc/DiscMissingFromProperties.md | 15 - .../doc/DiscOptionalTypeCorrect.md | 15 - .../doc/DiscOptionalTypeIncorrect.md | 15 - .../doc/DiscTypeIncorrect.md | 15 - .../dio/json_serializable/doc/Entity.md | 19 - .../dio/json_serializable/doc/EntityRef.md | 21 - .../dio/json_serializable/doc/EnumArrays.md | 16 - .../dio/json_serializable/doc/EnumTest.md | 22 - .../dio/json_serializable/doc/Extensible.md | 17 - .../dio/json_serializable/doc/FakeApi.md | 816 ---------- .../doc/FakeClassnameTags123Api.md | 61 - .../doc/FileSchemaTestClass.md | 16 - .../dart-dio/dio/json_serializable/doc/Foo.md | 21 - .../dio/json_serializable/doc/FooApi.md | 93 -- .../doc/FooBasicGetDefaultResponse.md | 15 - .../dio/json_serializable/doc/FooRef.md | 20 - .../json_serializable/doc/FooRefOrValue.md | 19 - .../dio/json_serializable/doc/FormatTest.md | 30 - .../dio/json_serializable/doc/Fruit.md | 17 - .../json_serializable/doc/FruitAllOfDisc.md | 15 - .../json_serializable/doc/FruitAnyOfDisc.md | 15 - .../doc/FruitGrandparentDisc.md | 15 - .../json_serializable/doc/FruitInlineDisc.md | 17 - .../doc/FruitInlineDiscOneOf.md | 16 - .../doc/FruitInlineDiscOneOf1.md | 16 - .../doc/FruitInlineInlineDisc.md | 15 - .../doc/FruitInlineInlineDiscOneOf.md | 16 - .../doc/FruitInlineInlineDiscOneOf1.md | 16 - .../doc/FruitInlineInlineDiscOneOfOneOf.md | 15 - .../json_serializable/doc/FruitOneOfDisc.md | 15 - .../dio/json_serializable/doc/FruitReqDisc.md | 17 - .../dio/json_serializable/doc/FruitType.md | 15 - .../json_serializable/doc/FruitVariant1.md | 16 - .../dio/json_serializable/doc/GigaOneOf.md | 15 - .../json_serializable/doc/GrapeVariant1.md | 15 - .../json_serializable/doc/HasOnlyReadOnly.md | 16 - .../doc/HealthCheckResult.md | 15 - .../dio/json_serializable/doc/MapTest.md | 18 - ...dPropertiesAndAdditionalPropertiesClass.md | 17 - .../json_serializable/doc/Model200Response.md | 16 - .../dio/json_serializable/doc/ModelClient.md | 15 - .../json_serializable/doc/ModelEnumClass.md | 14 - .../dio/json_serializable/doc/ModelFile.md | 15 - .../dio/json_serializable/doc/ModelList.md | 15 - .../dio/json_serializable/doc/ModelReturn.md | 15 - .../dio/json_serializable/doc/Name.md | 18 - .../json_serializable/doc/NullableClass.md | 26 - .../dio/json_serializable/doc/NumberOnly.md | 15 - .../doc/ObjectWithDeprecatedFields.md | 18 - .../doc/OneOfPrimitiveChild.md | 15 - .../dio/json_serializable/doc/Order.md | 20 - .../json_serializable/doc/OuterComposite.md | 17 - .../dio/json_serializable/doc/OuterEnum.md | 14 - .../doc/OuterEnumDefaultValue.md | 14 - .../json_serializable/doc/OuterEnumInteger.md | 14 - .../doc/OuterEnumIntegerDefaultValue.md | 14 - .../doc/OuterObjectWithEnumProperty.md | 15 - .../dio/json_serializable/doc/Parent.md | 15 - .../dio/json_serializable/doc/Pasta.md | 20 - .../dart-dio/dio/json_serializable/doc/Pet.md | 20 - .../dio/json_serializable/doc/PetApi.md | 439 ------ .../dio/json_serializable/doc/Pizza.md | 20 - .../json_serializable/doc/PizzaSpeziale.md | 20 - .../json_serializable/doc/ReadOnlyFirst.md | 16 - .../json_serializable/doc/SingleRefType.md | 14 - .../json_serializable/doc/SpecialModelName.md | 15 - .../dio/json_serializable/doc/StoreApi.md | 188 --- .../dart-dio/dio/json_serializable/doc/Tag.md | 16 - .../dio/json_serializable/doc/User.md | 22 - .../dio/json_serializable/doc/UserApi.md | 359 ----- .../dio/json_serializable/lib/openapi.dart | 120 -- .../lib/src/api/another_fake_api.dart | 109 -- .../lib/src/api/bar_api.dart | 110 -- .../lib/src/api/default_api.dart | 434 ------ .../lib/src/api/fake_api.dart | 1380 ----------------- .../src/api/fake_classname_tags123_api.dart | 116 -- .../lib/src/api/foo_api.dart | 179 --- .../lib/src/api/pet_api.dart | 727 --------- .../lib/src/api/store_api.dart | 303 ---- .../lib/src/api/user_api.dart | 524 ------- .../dio/json_serializable/pubspec.yaml | 16 - .../additional_properties_class_test.dart | 21 - .../test/addressable_test.dart | 23 - .../test/all_of_with_single_ref_test.dart | 21 - .../json_serializable/test/animal_test.dart | 21 - .../test/another_fake_api_test.dart | 20 - .../test/api_response_test.dart | 26 - .../test/apple_all_of_disc_test.dart | 21 - .../test/apple_grandparent_disc_test.dart | 21 - .../test/apple_one_of_disc_test.dart | 21 - .../test/apple_req_disc_test.dart | 21 - .../json_serializable/test/apple_test.dart | 16 - .../test/apple_variant1_test.dart | 16 - .../array_of_array_of_number_only_test.dart | 16 - .../test/array_of_number_only_test.dart | 16 - .../test/array_test_test.dart | 26 - .../test/banana_all_of_disc_test.dart | 21 - .../test/banana_grandparent_disc_test.dart | 21 - .../test/banana_one_of_disc_test.dart | 21 - .../test/banana_req_disc_test.dart | 21 - .../json_serializable/test/banana_test.dart | 16 - .../json_serializable/test/bar_api_test.dart | 18 - .../test/bar_create_test.dart | 56 - .../test/bar_ref_or_value_test.dart | 41 - .../json_serializable/test/bar_ref_test.dart | 41 - .../dio/json_serializable/test/bar_test.dart | 55 - .../test/capitalization_test.dart | 42 - .../dio/json_serializable/test/cat_test.dart | 26 - .../json_serializable/test/category_test.dart | 21 - .../test/class_model_test.dart | 16 - ...sed_disc_missing_from_properties_test.dart | 16 - ...posed_disc_optional_type_correct_test.dart | 16 - ..._disc_optional_type_inconsistent_test.dart | 16 - ...sed_disc_optional_type_incorrect_test.dart | 16 - ...posed_disc_required_inconsistent_test.dart | 16 - .../composed_disc_type_inconsistent_test.dart | 16 - .../composed_disc_type_incorrect_test.dart | 16 - .../test/default_api_test.dart | 41 - .../test/deprecated_object_test.dart | 16 - .../disc_missing_from_properties_test.dart | 16 - .../test/disc_optional_type_correct_test.dart | 16 - .../disc_optional_type_incorrect_test.dart | 16 - .../test/disc_type_incorrect_test.dart | 16 - .../dio/json_serializable/test/dog_test.dart | 26 - .../test/entity_ref_test.dart | 53 - .../json_serializable/test/entity_test.dart | 41 - .../test/enum_arrays_test.dart | 21 - .../test/enum_test_test.dart | 51 - .../test/extensible_test.dart | 29 - .../json_serializable/test/fake_api_test.dart | 140 -- .../test/fake_classname_tags123_api_test.dart | 20 - .../test/file_schema_test_class_test.dart | 21 - .../json_serializable/test/foo_api_test.dart | 25 - .../foo_basic_get_default_response_test.dart | 16 - .../test/foo_ref_or_value_test.dart | 41 - .../json_serializable/test/foo_ref_test.dart | 46 - .../dio/json_serializable/test/foo_test.dart | 51 - .../test/format_test_test.dart | 93 -- .../test/fruit_all_of_disc_test.dart | 16 - .../test/fruit_any_of_disc_test.dart | 16 - .../test/fruit_grandparent_disc_test.dart | 16 - .../test/fruit_inline_disc_one_of1_test.dart | 21 - .../test/fruit_inline_disc_one_of_test.dart | 21 - .../test/fruit_inline_disc_test.dart | 26 - ...fruit_inline_inline_disc_one_of1_test.dart | 21 - ...inline_inline_disc_one_of_one_of_test.dart | 16 - .../fruit_inline_inline_disc_one_of_test.dart | 21 - .../test/fruit_inline_inline_disc_test.dart | 16 - .../test/fruit_one_of_disc_test.dart | 16 - .../test/fruit_req_disc_test.dart | 26 - .../json_serializable/test/fruit_test.dart | 26 - .../test/fruit_type_test.dart | 16 - .../test/fruit_variant1_test.dart | 21 - .../test/giga_one_of_test.dart | 16 - .../test/grape_variant1_test.dart | 16 - .../test/has_only_read_only_test.dart | 21 - .../test/health_check_result_test.dart | 16 - .../json_serializable/test/map_test_test.dart | 31 - ..._and_additional_properties_class_test.dart | 26 - .../test/model200_response_test.dart | 21 - .../test/model_client_test.dart | 16 - .../test/model_enum_class_test.dart | 9 - .../test/model_file_test.dart | 17 - .../test/model_list_test.dart | 16 - .../test/model_return_test.dart | 16 - .../dio/json_serializable/test/name_test.dart | 31 - .../test/nullable_class_test.dart | 71 - .../test/number_only_test.dart | 16 - .../object_with_deprecated_fields_test.dart | 31 - .../test/one_of_primitive_child_test.dart | 16 - .../json_serializable/test/order_test.dart | 42 - .../test/outer_composite_test.dart | 26 - .../test/outer_enum_default_value_test.dart | 9 - ...outer_enum_integer_default_value_test.dart | 9 - .../test/outer_enum_integer_test.dart | 9 - .../test/outer_enum_test.dart | 9 - .../outer_object_with_enum_property_test.dart | 16 - .../json_serializable/test/parent_test.dart | 16 - .../json_serializable/test/pasta_test.dart | 46 - .../json_serializable/test/pet_api_test.dart | 92 -- .../dio/json_serializable/test/pet_test.dart | 42 - .../test/pizza_speziale_test.dart | 46 - .../json_serializable/test/pizza_test.dart | 46 - .../test/read_only_first_test.dart | 21 - .../test/single_ref_type_test.dart | 9 - .../test/special_model_name_test.dart | 16 - .../test/store_api_test.dart | 47 - .../dio/json_serializable/test/tag_test.dart | 21 - .../json_serializable/test/user_api_test.dart | 83 - .../dio/json_serializable/test/user_test.dart | 52 - .../doc/FooRefOrValueWithProperties.md | 19 - .../doc/CatAllOf.md | 15 - .../doc/DogAllOf.md | 15 - .../doc/InlineResponseDefault.md | 15 - .../lib/src/model/cat_all_of.dart | 54 - .../lib/src/model/dog_all_of.dart | 54 - .../src/model/inline_response_default.dart | 54 - .../test/fake_api_test.dart | 7 + .../petstore_client_lib_fake/doc/CatAllOf.md | 15 - .../petstore_client_lib_fake/doc/DogAllOf.md | 15 - .../doc/InlineResponseDefault.md | 15 - .../lib/src/model/cat_all_of.dart | 141 -- .../lib/src/model/dog_all_of.dart | 141 -- .../src/model/inline_response_default.dart | 91 -- .../test/fake_api_test.dart | 7 + .../dio/json_serializable/.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/VERSION | 1 - .../dart-next/dio/json_serializable/README.md | 264 ---- .../dio/json_serializable/build.yaml | 18 - .../dio/json_serializable/doc/Animal.md | 16 - .../dio/json_serializable/doc/Cat.md | 17 - .../dio/json_serializable/doc/Category.md | 16 - .../dio/json_serializable/doc/Dog.md | 17 - .../json_serializable/lib/src/api_util.dart | 89 -- .../lib/src/auth/api_key_auth.dart | 30 - .../json_serializable/lib/src/auth/auth.dart | 19 - .../lib/src/auth/basic_auth.dart | 42 - .../lib/src/auth/bearer_auth.dart | 27 - .../json_serializable/lib/src/auth/oauth.dart | 27 - .../model/additional_properties_class.dart | 48 - .../lib/src/model/addressable.dart | 48 - .../lib/src/model/all_of_with_single_ref.dart | 49 - .../lib/src/model/animal.dart | 49 - .../lib/src/model/api_response.dart | 53 - .../lib/src/model/apple.dart | 40 - .../lib/src/model/apple_all_of_disc.dart | 48 - .../lib/src/model/apple_grandparent_disc.dart | 48 - .../lib/src/model/apple_one_of_disc.dart | 49 - .../lib/src/model/apple_req_disc.dart | 48 - .../lib/src/model/apple_variant1.dart | 41 - .../model/array_of_array_of_number_only.dart | 43 - .../lib/src/model/array_of_number_only.dart | 42 - .../lib/src/model/array_test.dart | 58 - .../lib/src/model/banana.dart | 40 - .../lib/src/model/banana_all_of_disc.dart | 48 - .../src/model/banana_grandparent_disc.dart | 48 - .../lib/src/model/banana_one_of_disc.dart | 49 - .../lib/src/model/banana_req_disc.dart | 48 - .../json_serializable/lib/src/model/bar.dart | 93 -- .../lib/src/model/bar_create.dart | 95 -- .../lib/src/model/bar_ref.dart | 75 - .../lib/src/model/bar_ref_or_value.dart | 75 - .../lib/src/model/capitalization.dart | 75 - .../json_serializable/lib/src/model/cat.dart | 59 - .../lib/src/model/category.dart | 50 - .../lib/src/model/class_model.dart | 41 - ...composed_disc_missing_from_properties.dart | 45 - .../composed_disc_optional_type_correct.dart | 44 - ...posed_disc_optional_type_inconsistent.dart | 47 - ...composed_disc_optional_type_incorrect.dart | 46 - .../composed_disc_required_inconsistent.dart | 46 - .../composed_disc_type_inconsistent.dart | 44 - .../model/composed_disc_type_incorrect.dart | 43 - .../lib/src/model/deprecated_object.dart | 42 - .../model/disc_missing_from_properties.dart | 42 - .../src/model/disc_optional_type_correct.dart | 42 - .../model/disc_optional_type_incorrect.dart | 42 - .../lib/src/model/disc_type_incorrect.dart | 42 - .../json_serializable/lib/src/model/dog.dart | 59 - .../lib/src/model/entity.dart | 72 - .../lib/src/model/entity_ref.dart | 87 -- .../lib/src/model/enum_arrays.dart | 66 - .../lib/src/model/enum_test.dart | 134 -- .../lib/src/model/extensible.dart | 57 - .../lib/src/model/file_schema_test_class.dart | 49 - .../json_serializable/lib/src/model/foo.dart | 87 -- .../model/foo_basic_get_default_response.dart | 43 - .../lib/src/model/foo_ref.dart | 81 - .../lib/src/model/foo_ref_or_value.dart | 75 - .../lib/src/model/format_test.dart | 150 -- .../lib/src/model/fruit.dart | 54 - .../lib/src/model/fruit_all_of_disc.dart | 44 - .../lib/src/model/fruit_any_of_disc.dart | 43 - .../lib/src/model/fruit_grandparent_disc.dart | 44 - .../lib/src/model/fruit_inline_disc.dart | 55 - .../src/model/fruit_inline_disc_one_of.dart | 48 - .../src/model/fruit_inline_disc_one_of1.dart | 48 - .../src/model/fruit_inline_inline_disc.dart | 44 - .../fruit_inline_inline_disc_one_of.dart | 49 - .../fruit_inline_inline_disc_one_of1.dart | 49 - ...ruit_inline_inline_disc_one_of_one_of.dart | 43 - .../lib/src/model/fruit_one_of_disc.dart | 44 - .../lib/src/model/fruit_req_disc.dart | 55 - .../lib/src/model/fruit_type.dart | 42 - .../lib/src/model/fruit_variant1.dart | 48 - .../lib/src/model/giga_one_of.dart | 42 - .../lib/src/model/grape_variant1.dart | 41 - .../lib/src/model/has_only_read_only.dart | 46 - .../lib/src/model/health_check_result.dart | 42 - .../lib/src/model/map_test.dart | 71 - ...rties_and_additional_properties_class.dart | 56 - .../lib/src/model/model200_response.dart | 46 - .../lib/src/model/model_client.dart | 41 - .../lib/src/model/model_enum_class.dart | 17 - .../lib/src/model/model_file.dart | 43 - .../lib/src/model/model_list.dart | 42 - .../lib/src/model/model_return.dart | 42 - .../json_serializable/lib/src/model/name.dart | 61 - .../lib/src/model/nullable_class.dart | 121 -- .../lib/src/model/number_only.dart | 42 - .../model/object_with_deprecated_fields.dart | 64 - .../lib/src/model/one_of_primitive_child.dart | 42 - .../lib/src/model/order.dart | 90 -- .../lib/src/model/outer_composite.dart | 54 - .../lib/src/model/outer_enum.dart | 17 - .../src/model/outer_enum_default_value.dart | 17 - .../lib/src/model/outer_enum_integer.dart | 17 - .../outer_enum_integer_default_value.dart | 17 - .../outer_object_with_enum_property.dart | 43 - .../lib/src/model/parent.dart | 40 - .../lib/src/model/pasta.dart | 81 - .../json_serializable/lib/src/model/pet.dart | 88 -- .../lib/src/model/pizza.dart | 81 - .../lib/src/model/pizza_speziale.dart | 82 - .../lib/src/model/read_only_first.dart | 46 - .../lib/src/model/single_ref_type.dart | 15 - .../lib/src/model/special_model_name.dart | 47 - .../json_serializable/lib/src/model/tag.dart | 45 - .../json_serializable/lib/src/model/user.dart | 86 - .../lib/src/repository_base.dart | 68 - .../lib/src/repository_impl.dart | 350 ----- 1075 files changed, 1317 insertions(+), 18923 deletions(-) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/.gitignore (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/.openapi-generator-ignore (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/.openapi-generator/FILES (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/.openapi-generator/VERSION (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/README.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/analysis_options.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AdditionalPropertiesClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Addressable.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AllOfWithSingleRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Animal.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AnotherFakeApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ApiResponse.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Apple.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AppleAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AppleGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AppleOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AppleReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/AppleVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ArrayOfNumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ArrayTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Banana.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BananaAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BananaGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BananaOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BananaReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Bar.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BarApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BarCreate.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BarRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/BarRefOrValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Capitalization.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Cat.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Category.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ClassModel.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscMissingFromProperties.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscRequiredInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscTypeInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ComposedDiscTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DefaultApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DeprecatedObject.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DiscMissingFromProperties.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DiscOptionalTypeCorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DiscOptionalTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/DiscTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Dog.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Entity.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/EntityRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/EnumArrays.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/EnumTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Extensible.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FakeApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FakeClassnameTags123Api.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FileSchemaTestClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Foo.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FooApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FooBasicGetDefaultResponse.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FooRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FooRefOrValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FormatTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Fruit.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitAnyOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineDiscOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineDiscOneOf1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineInlineDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineInlineDiscOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitType.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/FruitVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/GigaOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/GrapeVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/HasOnlyReadOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/HealthCheckResult.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/MapTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Model200Response.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ModelClient.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ModelEnumClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ModelFile.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ModelList.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ModelReturn.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Name.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/NullableClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/NumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ObjectWithDeprecatedFields.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OneOfPrimitiveChild.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Order.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterComposite.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterEnum.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterEnumDefaultValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterEnumInteger.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/OuterObjectWithEnumProperty.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Parent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Pasta.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Pet.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/PetApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Pizza.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/PizzaSpeziale.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/ReadOnlyFirst.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/SingleRefType.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/SpecialModelName.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/StoreApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/Tag.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/User.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/doc/UserApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/apis.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/models.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/openapi.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/another_fake_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/bar_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/default_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/fake_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/fake_classname_tags123_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/foo_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/pet_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/store_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api/user_api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api_client.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/api_util.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/auth/_exports.dart (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/lib/src/auth/api_key_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/lib/src/auth/auth.dart (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/lib/src/auth/basic_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/lib/src/auth/bearer_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-dio/dio/json_serializable => client/echo_api/dart/dio/built_value}/lib/src/auth/oauth.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/date_serializer.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/additional_properties_class.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/addressable.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/all_of_with_single_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/animal.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/api_response.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/apple_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/array_of_array_of_number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/array_of_number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/array_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/banana.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/banana_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/banana_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/banana_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/banana_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/bar.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/bar_create.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/bar_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/bar_ref_or_value.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/capitalization.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/cat.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/category.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/class_model.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/date.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/deprecated_object.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/disc_missing_from_properties.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/disc_optional_type_correct.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/disc_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/dog.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/entity.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/entity_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/enum_arrays.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/enum_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/extensible.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/file_schema_test_class.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/foo.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/foo_basic_get_default_response.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/foo_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/foo_ref_or_value.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/format_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_any_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_type.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/fruit_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/giga_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/grape_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/has_only_read_only.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/health_check_result.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/map_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model200_response.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model_client.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model_enum_class.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model_file.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model_list.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/model_return.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/name.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/nullable_class.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/object_with_deprecated_fields.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/one_of_primitive_child.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/order.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_composite.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_enum.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_enum_default_value.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_enum_integer.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/outer_object_with_enum_property.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/parent.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/pasta.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/pet.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/pizza.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/pizza_speziale.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/read_only_first.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/single_ref_type.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/special_model_name.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/tag.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/model/user.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/repository_base.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/repository_impl.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/lib/src/serializers.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/pom.xml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/pubspec.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/additional_properties_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/addressable_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/all_of_with_single_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/animal_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/another_fake_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/api_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/apple_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/array_of_array_of_number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/array_of_number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/array_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/banana_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/banana_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/banana_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/banana_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/banana_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/bar_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/bar_create_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/bar_ref_or_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/bar_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/bar_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/capitalization_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/cat_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/category_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/class_model_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_missing_from_properties_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_optional_type_correct_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_required_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_type_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/composed_disc_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/default_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/deprecated_object_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/disc_missing_from_properties_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/disc_optional_type_correct_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/disc_optional_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/disc_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/dog_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/entity_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/entity_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/enum_arrays_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/enum_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/extensible_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fake_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fake_classname_tags123_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/file_schema_test_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/foo_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/foo_basic_get_default_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/foo_ref_or_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/foo_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/foo_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/format_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_any_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_disc_one_of1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_disc_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_inline_inline_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_type_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/fruit_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/giga_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/grape_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/has_only_read_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/health_check_result_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/map_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model200_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model_client_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model_enum_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model_file_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model_list_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/model_return_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/name_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/nullable_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/object_with_deprecated_fields_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/one_of_primitive_child_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/order_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_composite_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_enum_default_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_enum_integer_default_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_enum_integer_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_enum_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/outer_object_with_enum_property_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/parent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/pasta_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/pet_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/pet_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/pizza_speziale_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/pizza_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/read_only_first_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/single_ref_type_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/special_model_name_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/store_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/tag_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/user_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value/test/user_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/.gitignore (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/README.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/analysis_options.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/pubspec.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/puby.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/api/authentication_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/api/fake_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/api/pet_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/api/store_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/api_util_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/model/date_serializer_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/built_value_tests/test/model/date_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/.gitignore (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/.openapi-generator-ignore (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/.openapi-generator/FILES (65%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/.openapi-generator/VERSION (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/README.md (99%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/analysis_options.yaml (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/build.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AdditionalPropertiesClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Addressable.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AllOfWithSingleRef.md (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/doc/Animal.md (91%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AnotherFakeApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ApiResponse.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Apple.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AppleAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AppleGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AppleOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AppleReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/AppleVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ArrayOfNumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ArrayTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Banana.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BananaAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BananaGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BananaOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BananaReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Bar.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BarApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BarCreate.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BarRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/BarRefOrValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Capitalization.md (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/doc/Cat.md (92%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/doc/Category.md (91%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ClassModel.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DefaultApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DeprecatedObject.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DiscMissingFromProperties.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DiscOptionalTypeCorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/DiscTypeIncorrect.md (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/doc/Dog.md (92%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Entity.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/EntityRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/EnumArrays.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/EnumTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Extensible.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FakeApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FakeClassnameTags123Api.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FileSchemaTestClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Foo.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FooApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FooBasicGetDefaultResponse.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FooRef.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FooRefOrValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FormatTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Fruit.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitAllOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitAnyOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitGrandparentDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineDiscOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineDiscOneOf1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineInlineDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitOneOfDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitReqDisc.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitType.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/FruitVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/GigaOneOf.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/GrapeVariant1.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/HasOnlyReadOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/HealthCheckResult.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/MapTest.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Model200Response.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ModelClient.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ModelEnumClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ModelFile.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ModelList.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ModelReturn.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Name.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/NullableClass.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/NumberOnly.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ObjectWithDeprecatedFields.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OneOfPrimitiveChild.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Order.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterComposite.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterEnum.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterEnumDefaultValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterEnumInteger.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/OuterObjectWithEnumProperty.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Parent.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Pasta.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Pet.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/PetApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Pizza.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/PizzaSpeziale.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/ReadOnlyFirst.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/SingleRefType.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/SpecialModelName.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/StoreApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/Tag.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/User.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/doc/UserApi.md (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/apis.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/models.dart (99%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/openapi.dart (99%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/api.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/another_fake_api.dart (91%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/bar_api.dart (90%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/default_api.dart (92%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/fake_api.dart (99%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart (92%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/foo_api.dart (92%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/pet_api.dart (89%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/store_api.dart (91%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api/user_api.dart (91%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/api_client.dart (85%) create mode 100644 samples/client/echo_api/dart/dio/json_serializable/lib/src/api_util.dart rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/lib/src/auth/_exports.dart (83%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/lib/src/auth/api_key_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/lib/src/auth/auth.dart (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/lib/src/auth/basic_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/lib/src/auth/bearer_auth.dart (100%) rename samples/{openapi3/client/petstore/dart-next/dio/built_value => client/echo_api/dart/dio/json_serializable}/lib/src/auth/oauth.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/deserialize.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/additional_properties_class.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/addressable.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/animal.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/api_response.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/apple_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/array_of_number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/array_test.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/banana.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/banana_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/banana_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/banana_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/bar.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/bar_create.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/bar_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/bar_ref_or_value.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/capitalization.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/cat.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/category.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/class_model.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/deprecated_object.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/disc_type_incorrect.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/dog.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/entity.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/entity_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/enum_arrays.dart (88%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/enum_test.dart (92%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/extensible.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/file_schema_test_class.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/foo.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/foo_ref.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/foo_ref_or_value.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/format_test.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_req_disc.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_type.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/fruit_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/giga_one_of.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/grape_variant1.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/has_only_read_only.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/health_check_result.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/map_test.dart (95%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model200_response.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model_client.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model_enum_class.dart (67%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model_file.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model_list.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/model_return.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/name.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/nullable_class.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/number_only.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/one_of_primitive_child.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/order.dart (94%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_composite.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_enum.dart (63%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_enum_default_value.dart (65%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_enum_integer.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/parent.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/pasta.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/pet.dart (94%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/pizza.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/pizza_speziale.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/read_only_first.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/single_ref_type.dart (69%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/special_model_name.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/tag.dart (100%) rename samples/{openapi3/client/petstore/dart-dio => client/echo_api/dart}/dio/json_serializable/lib/src/model/user.dart (100%) create mode 100644 samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_base.dart create mode 100644 samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_impl.dart rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/pom.xml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/pubspec.yaml (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/additional_properties_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/addressable_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/all_of_with_single_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/animal_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/another_fake_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/api_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/apple_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/array_of_array_of_number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/array_of_number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/array_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/banana_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/banana_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/banana_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/banana_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/banana_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/bar_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/bar_create_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/bar_ref_or_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/bar_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/bar_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/capitalization_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/cat_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/category_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/class_model_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/composed_disc_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/default_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/deprecated_object_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/disc_missing_from_properties_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/disc_optional_type_correct_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/disc_optional_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/disc_type_incorrect_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/dog_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/entity_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/entity_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/enum_arrays_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/enum_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/extensible_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fake_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fake_classname_tags123_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/file_schema_test_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/foo_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/foo_basic_get_default_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/foo_ref_or_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/foo_ref_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/foo_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/format_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_all_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_any_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_grandparent_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_inline_inline_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_one_of_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_req_disc_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_type_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/fruit_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/giga_one_of_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/grape_variant1_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/has_only_read_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/health_check_result_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/map_test_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model200_response_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model_client_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model_enum_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model_file_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model_list_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/model_return_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/name_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/nullable_class_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/number_only_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/object_with_deprecated_fields_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/one_of_primitive_child_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/order_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_composite_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_enum_default_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_enum_integer_default_value_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_enum_integer_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_enum_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/outer_object_with_enum_property_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/parent_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/pasta_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/pet_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/pet_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/pizza_speziale_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/pizza_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/read_only_first_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/single_ref_type_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/special_model_name_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/store_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/tag_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/user_api_test.dart (100%) rename samples/{openapi3/client/petstore/dart-next => client/echo_api/dart}/dio/json_serializable/test/user_test.dart (100%) delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart delete mode 100644 samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart diff --git a/bin/configs/dart-next-dio-built_value-v3.yaml b/bin/configs/dart-next-dio-built_value-v3.yaml index 6b7a8bbc6755..aa5d08d10267 100644 --- a/bin/configs/dart-next-dio-built_value-v3.yaml +++ b/bin/configs/dart-next-dio-built_value-v3.yaml @@ -1,5 +1,5 @@ generatorName: dart-next -outputDir: samples/openapi3/client/petstore/dart-next/dio/built_value +outputDir: samples/client/echo_api/dart/dio/built_value inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml templateDir: modules/openapi-generator/src/main/resources/dart-next typeMappings: diff --git a/bin/configs/dart-next-dio-json_serializable-v3.yaml b/bin/configs/dart-next-dio-json_serializable-v3.yaml index c9435a24e001..dd6ecf828822 100644 --- a/bin/configs/dart-next-dio-json_serializable-v3.yaml +++ b/bin/configs/dart-next-dio-json_serializable-v3.yaml @@ -1,7 +1,7 @@ -generatorName: dart-dio -outputDir: samples/openapi3/client/petstore/dart-dio/dio/json_serializable +generatorName: dart-next +outputDir: samples/client/echo_api/dart/dio/json_serializable inputSpec: modules/openapi-generator/src/test/resources/3_0/dart/v3.0.0.yaml -templateDir: modules/openapi-generator/src/main/resources/dart +templateDir: modules/openapi-generator/src/main/resources/dart-next typeMappings: Client: "ModelClient" File: "ModelFile" diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore b/samples/client/echo_api/dart/dio/built_value/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.gitignore rename to samples/client/echo_api/dart/dio/built_value/.gitignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore b/samples/client/echo_api/dart/dio/built_value/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator-ignore rename to samples/client/echo_api/dart/dio/built_value/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/FILES rename to samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/VERSION rename to samples/client/echo_api/dart/dio/built_value/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/README.md b/samples/client/echo_api/dart/dio/built_value/README.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/README.md rename to samples/client/echo_api/dart/dio/built_value/README.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/analysis_options.yaml b/samples/client/echo_api/dart/dio/built_value/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/analysis_options.yaml rename to samples/client/echo_api/dart/dio/built_value/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/built_value/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AdditionalPropertiesClass.md rename to samples/client/echo_api/dart/dio/built_value/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Addressable.md b/samples/client/echo_api/dart/dio/built_value/doc/Addressable.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Addressable.md rename to samples/client/echo_api/dart/dio/built_value/doc/Addressable.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dio/built_value/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AllOfWithSingleRef.md rename to samples/client/echo_api/dart/dio/built_value/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Animal.md b/samples/client/echo_api/dart/dio/built_value/doc/Animal.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Animal.md rename to samples/client/echo_api/dart/dio/built_value/doc/Animal.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AnotherFakeApi.md b/samples/client/echo_api/dart/dio/built_value/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AnotherFakeApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ApiResponse.md b/samples/client/echo_api/dart/dio/built_value/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ApiResponse.md rename to samples/client/echo_api/dart/dio/built_value/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Apple.md b/samples/client/echo_api/dart/dio/built_value/doc/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Apple.md rename to samples/client/echo_api/dart/dio/built_value/doc/Apple.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleAllOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/AppleAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleGrandparentDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/AppleGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleOneOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/AppleOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleReqDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/AppleReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/AppleVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/AppleVariant1.md rename to samples/client/echo_api/dart/dio/built_value/doc/AppleVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md rename to samples/client/echo_api/dart/dio/built_value/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayOfNumberOnly.md rename to samples/client/echo_api/dart/dio/built_value/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayTest.md b/samples/client/echo_api/dart/dio/built_value/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ArrayTest.md rename to samples/client/echo_api/dart/dio/built_value/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Banana.md b/samples/client/echo_api/dart/dio/built_value/doc/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Banana.md rename to samples/client/echo_api/dart/dio/built_value/doc/Banana.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaAllOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/BananaAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaGrandparentDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/BananaGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaOneOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/BananaOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/BananaReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BananaReqDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/BananaReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Bar.md b/samples/client/echo_api/dart/dio/built_value/doc/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Bar.md rename to samples/client/echo_api/dart/dio/built_value/doc/Bar.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarApi.md b/samples/client/echo_api/dart/dio/built_value/doc/BarApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/BarApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarCreate.md b/samples/client/echo_api/dart/dio/built_value/doc/BarCreate.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarCreate.md rename to samples/client/echo_api/dart/dio/built_value/doc/BarCreate.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRef.md b/samples/client/echo_api/dart/dio/built_value/doc/BarRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRef.md rename to samples/client/echo_api/dart/dio/built_value/doc/BarRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dio/built_value/doc/BarRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/BarRefOrValue.md rename to samples/client/echo_api/dart/dio/built_value/doc/BarRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Capitalization.md b/samples/client/echo_api/dart/dio/built_value/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Capitalization.md rename to samples/client/echo_api/dart/dio/built_value/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Cat.md b/samples/client/echo_api/dart/dio/built_value/doc/Cat.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Cat.md rename to samples/client/echo_api/dart/dio/built_value/doc/Cat.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Category.md b/samples/client/echo_api/dart/dio/built_value/doc/Category.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Category.md rename to samples/client/echo_api/dart/dio/built_value/doc/Category.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ClassModel.md b/samples/client/echo_api/dart/dio/built_value/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ClassModel.md rename to samples/client/echo_api/dart/dio/built_value/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscMissingFromProperties.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscRequiredInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscRequiredInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscRequiredInconsistent.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscRequiredInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeInconsistent.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeInconsistent.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ComposedDiscTypeIncorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/ComposedDiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DefaultApi.md b/samples/client/echo_api/dart/dio/built_value/doc/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DefaultApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/DefaultApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dio/built_value/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DeprecatedObject.md rename to samples/client/echo_api/dart/dio/built_value/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscMissingFromProperties.md rename to samples/client/echo_api/dart/dio/built_value/doc/DiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeCorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscOptionalTypeIncorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/DiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/built_value/doc/DiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/DiscTypeIncorrect.md rename to samples/client/echo_api/dart/dio/built_value/doc/DiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Dog.md b/samples/client/echo_api/dart/dio/built_value/doc/Dog.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Dog.md rename to samples/client/echo_api/dart/dio/built_value/doc/Dog.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Entity.md b/samples/client/echo_api/dart/dio/built_value/doc/Entity.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Entity.md rename to samples/client/echo_api/dart/dio/built_value/doc/Entity.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EntityRef.md b/samples/client/echo_api/dart/dio/built_value/doc/EntityRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EntityRef.md rename to samples/client/echo_api/dart/dio/built_value/doc/EntityRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumArrays.md b/samples/client/echo_api/dart/dio/built_value/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumArrays.md rename to samples/client/echo_api/dart/dio/built_value/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumTest.md b/samples/client/echo_api/dart/dio/built_value/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/EnumTest.md rename to samples/client/echo_api/dart/dio/built_value/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Extensible.md b/samples/client/echo_api/dart/dio/built_value/doc/Extensible.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Extensible.md rename to samples/client/echo_api/dart/dio/built_value/doc/Extensible.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeApi.md b/samples/client/echo_api/dart/dio/built_value/doc/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/FakeApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeClassnameTags123Api.md b/samples/client/echo_api/dart/dio/built_value/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FakeClassnameTags123Api.md rename to samples/client/echo_api/dart/dio/built_value/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dio/built_value/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FileSchemaTestClass.md rename to samples/client/echo_api/dart/dio/built_value/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Foo.md b/samples/client/echo_api/dart/dio/built_value/doc/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Foo.md rename to samples/client/echo_api/dart/dio/built_value/doc/Foo.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooApi.md b/samples/client/echo_api/dart/dio/built_value/doc/FooApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/FooApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooBasicGetDefaultResponse.md b/samples/client/echo_api/dart/dio/built_value/doc/FooBasicGetDefaultResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooBasicGetDefaultResponse.md rename to samples/client/echo_api/dart/dio/built_value/doc/FooBasicGetDefaultResponse.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRef.md b/samples/client/echo_api/dart/dio/built_value/doc/FooRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRef.md rename to samples/client/echo_api/dart/dio/built_value/doc/FooRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dio/built_value/doc/FooRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FooRefOrValue.md rename to samples/client/echo_api/dart/dio/built_value/doc/FooRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FormatTest.md b/samples/client/echo_api/dart/dio/built_value/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FormatTest.md rename to samples/client/echo_api/dart/dio/built_value/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Fruit.md b/samples/client/echo_api/dart/dio/built_value/doc/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Fruit.md rename to samples/client/echo_api/dart/dio/built_value/doc/Fruit.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAllOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAllOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAnyOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitAnyOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitAnyOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitAnyOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitGrandparentDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitGrandparentDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineDiscOneOf1.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitInlineInlineDiscOneOfOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitOneOfDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitOneOfDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitReqDisc.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitReqDisc.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitType.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitType.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitType.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/FruitVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/FruitVariant1.md rename to samples/client/echo_api/dart/dio/built_value/doc/FruitVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GigaOneOf.md b/samples/client/echo_api/dart/dio/built_value/doc/GigaOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GigaOneOf.md rename to samples/client/echo_api/dart/dio/built_value/doc/GigaOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GrapeVariant1.md b/samples/client/echo_api/dart/dio/built_value/doc/GrapeVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/GrapeVariant1.md rename to samples/client/echo_api/dart/dio/built_value/doc/GrapeVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HasOnlyReadOnly.md rename to samples/client/echo_api/dart/dio/built_value/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dio/built_value/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/HealthCheckResult.md rename to samples/client/echo_api/dart/dio/built_value/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MapTest.md b/samples/client/echo_api/dart/dio/built_value/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MapTest.md rename to samples/client/echo_api/dart/dio/built_value/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/echo_api/dart/dio/built_value/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Model200Response.md b/samples/client/echo_api/dart/dio/built_value/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Model200Response.md rename to samples/client/echo_api/dart/dio/built_value/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelClient.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelClient.md rename to samples/client/echo_api/dart/dio/built_value/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelEnumClass.md rename to samples/client/echo_api/dart/dio/built_value/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelFile.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelFile.md rename to samples/client/echo_api/dart/dio/built_value/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelList.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelList.md rename to samples/client/echo_api/dart/dio/built_value/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelReturn.md b/samples/client/echo_api/dart/dio/built_value/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ModelReturn.md rename to samples/client/echo_api/dart/dio/built_value/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Name.md b/samples/client/echo_api/dart/dio/built_value/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Name.md rename to samples/client/echo_api/dart/dio/built_value/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NullableClass.md b/samples/client/echo_api/dart/dio/built_value/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NullableClass.md rename to samples/client/echo_api/dart/dio/built_value/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NumberOnly.md b/samples/client/echo_api/dart/dio/built_value/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/NumberOnly.md rename to samples/client/echo_api/dart/dio/built_value/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dio/built_value/doc/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ObjectWithDeprecatedFields.md rename to samples/client/echo_api/dart/dio/built_value/doc/ObjectWithDeprecatedFields.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OneOfPrimitiveChild.md b/samples/client/echo_api/dart/dio/built_value/doc/OneOfPrimitiveChild.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OneOfPrimitiveChild.md rename to samples/client/echo_api/dart/dio/built_value/doc/OneOfPrimitiveChild.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Order.md b/samples/client/echo_api/dart/dio/built_value/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Order.md rename to samples/client/echo_api/dart/dio/built_value/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterComposite.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterComposite.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnum.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnum.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumDefaultValue.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumInteger.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterEnumIntegerDefaultValue.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dio/built_value/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/OuterObjectWithEnumProperty.md rename to samples/client/echo_api/dart/dio/built_value/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Parent.md b/samples/client/echo_api/dart/dio/built_value/doc/Parent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Parent.md rename to samples/client/echo_api/dart/dio/built_value/doc/Parent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pasta.md b/samples/client/echo_api/dart/dio/built_value/doc/Pasta.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pasta.md rename to samples/client/echo_api/dart/dio/built_value/doc/Pasta.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pet.md b/samples/client/echo_api/dart/dio/built_value/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pet.md rename to samples/client/echo_api/dart/dio/built_value/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PetApi.md b/samples/client/echo_api/dart/dio/built_value/doc/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PetApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/PetApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pizza.md b/samples/client/echo_api/dart/dio/built_value/doc/Pizza.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Pizza.md rename to samples/client/echo_api/dart/dio/built_value/doc/Pizza.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dio/built_value/doc/PizzaSpeziale.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/PizzaSpeziale.md rename to samples/client/echo_api/dart/dio/built_value/doc/PizzaSpeziale.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dio/built_value/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/ReadOnlyFirst.md rename to samples/client/echo_api/dart/dio/built_value/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SingleRefType.md b/samples/client/echo_api/dart/dio/built_value/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SingleRefType.md rename to samples/client/echo_api/dart/dio/built_value/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SpecialModelName.md b/samples/client/echo_api/dart/dio/built_value/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/SpecialModelName.md rename to samples/client/echo_api/dart/dio/built_value/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/StoreApi.md b/samples/client/echo_api/dart/dio/built_value/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/StoreApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Tag.md b/samples/client/echo_api/dart/dio/built_value/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/Tag.md rename to samples/client/echo_api/dart/dio/built_value/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/User.md b/samples/client/echo_api/dart/dio/built_value/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/User.md rename to samples/client/echo_api/dart/dio/built_value/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/doc/UserApi.md b/samples/client/echo_api/dart/dio/built_value/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/doc/UserApi.md rename to samples/client/echo_api/dart/dio/built_value/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/apis.dart b/samples/client/echo_api/dart/dio/built_value/lib/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/apis.dart rename to samples/client/echo_api/dart/dio/built_value/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/models.dart b/samples/client/echo_api/dart/dio/built_value/lib/models.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/models.dart rename to samples/client/echo_api/dart/dio/built_value/lib/models.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart b/samples/client/echo_api/dart/dio/built_value/lib/openapi.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/openapi.dart rename to samples/client/echo_api/dart/dio/built_value/lib/openapi.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/another_fake_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/bar_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/default_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/fake_classname_tags123_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/foo_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/pet_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/store_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api/user_api.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_client.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api_client.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/api_util.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/_exports.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/_exports.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/_exports.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/api_key_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/api_key_auth.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/api_key_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/auth.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/basic_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/basic_auth.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/basic_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/bearer_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/bearer_auth.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/bearer_auth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/auth/oauth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/auth/oauth.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/auth/oauth.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/date_serializer.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/date_serializer.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/date_serializer.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/additional_properties_class.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/addressable.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/addressable.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/addressable.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/all_of_with_single_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/all_of_with_single_ref.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/all_of_with_single_ref.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/animal.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/animal.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/animal.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/api_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/api_response.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/api_response.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_all_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_one_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_req_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/apple_variant1.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/apple_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/array_of_array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_array_of_number_only.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/array_of_array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_of_number_only.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/array_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/array_test.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/array_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/banana.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/banana.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_all_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_one_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/banana_req_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/banana_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/bar.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/bar.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_create.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_create.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_create.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_ref.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/bar_ref_or_value.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/bar_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/capitalization.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/capitalization.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/capitalization.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/cat.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/cat.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/cat.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/category.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/category.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/category.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/class_model.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/class_model.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/class_model.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_required_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/composed_disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/date.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/date.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/date.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/date.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/deprecated_object.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/deprecated_object.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/deprecated_object.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_missing_from_properties.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_correct.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/disc_type_incorrect.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/dog.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/dog.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/dog.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/entity.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/entity.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/entity_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/entity_ref.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/entity_ref.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/enum_arrays.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_arrays.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/enum_arrays.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/enum_test.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/extensible.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/extensible.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/extensible.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/file_schema_test_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/file_schema_test_class.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/file_schema_test_class.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/foo.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/foo.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_basic_get_default_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_basic_get_default_response.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_basic_get_default_response.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_ref.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/foo_ref_or_value.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/foo_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/format_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/format_test.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/format_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_all_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_any_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_any_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_any_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_one_of_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_req_disc.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_type.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_type.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/fruit_variant1.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/fruit_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/giga_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/giga_one_of.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/giga_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/grape_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/grape_variant1.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/grape_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/has_only_read_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/has_only_read_only.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/has_only_read_only.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/health_check_result.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/health_check_result.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/health_check_result.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/map_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/map_test.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/map_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/mixed_properties_and_additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model200_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model200_response.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model200_response.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_client.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model_client.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model_enum_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_enum_class.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model_enum_class.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model_file.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_file.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model_file.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model_list.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_list.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model_list.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/model_return.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/model_return.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/model_return.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/name.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/name.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/nullable_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/nullable_class.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/nullable_class.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/number_only.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/number_only.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/object_with_deprecated_fields.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/object_with_deprecated_fields.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/object_with_deprecated_fields.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/one_of_primitive_child.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/one_of_primitive_child.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/one_of_primitive_child.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/order.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/order.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/order.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_composite.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_composite.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_composite.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_default_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_default_value.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_default_value.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_integer.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_integer.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_enum_integer_default_value.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_object_with_enum_property.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/outer_object_with_enum_property.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/outer_object_with_enum_property.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/parent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/parent.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/parent.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/pasta.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pasta.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/pasta.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/pet.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pet.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/pet.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/pizza.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/pizza.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/pizza_speziale.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/pizza_speziale.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/pizza_speziale.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/read_only_first.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/read_only_first.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/read_only_first.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/single_ref_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/single_ref_type.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/single_ref_type.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/special_model_name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/special_model_name.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/tag.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/tag.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/tag.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/model/user.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/model/user.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_base.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/repository_impl.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/serializers.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/serializers.dart rename to samples/client/echo_api/dart/dio/built_value/lib/src/serializers.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml b/samples/client/echo_api/dart/dio/built_value/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/pom.xml rename to samples/client/echo_api/dart/dio/built_value/pom.xml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/pubspec.yaml b/samples/client/echo_api/dart/dio/built_value/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/pubspec.yaml rename to samples/client/echo_api/dart/dio/built_value/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/additional_properties_class_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/addressable_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/all_of_with_single_ref_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/animal_test.dart b/samples/client/echo_api/dart/dio/built_value/test/animal_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/animal_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/animal_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/another_fake_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/another_fake_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/api_response_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_req_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/apple_variant1_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_array_of_number_only_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_of_number_only_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/array_test_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_req_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/banana_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/banana_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_create_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_or_value_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_ref_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/bar_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/bar_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/capitalization_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/cat_test.dart b/samples/client/echo_api/dart/dio/built_value/test/cat_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/cat_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/cat_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/category_test.dart b/samples/client/echo_api/dart/dio/built_value/test/category_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/category_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/category_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/class_model_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_missing_from_properties_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_correct_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_required_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_required_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/composed_disc_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/default_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/default_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/deprecated_object_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_missing_from_properties_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_correct_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_optional_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/disc_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/dog_test.dart b/samples/client/echo_api/dart/dio/built_value/test/dog_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/dog_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_ref_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_test.dart b/samples/client/echo_api/dart/dio/built_value/test/entity_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/entity_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/entity_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_arrays_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/enum_test_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/extensible_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_classname_tags123_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fake_classname_tags123_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/file_schema_test_class_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_basic_get_default_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_basic_get_default_response_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_or_value_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_ref_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/foo_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/foo_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/format_test_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_any_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_any_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of1_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_one_of_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_inline_inline_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_req_disc_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_type_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_type_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/fruit_variant1_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/giga_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/giga_one_of_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/grape_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/grape_variant1_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/has_only_read_only_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/health_check_result_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/map_test_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model200_response_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_client_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_enum_class_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_file_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_list_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/model_return_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/name_test.dart b/samples/client/echo_api/dart/dio/built_value/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/name_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/nullable_class_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/number_only_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/object_with_deprecated_fields_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/one_of_primitive_child_test.dart b/samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/one_of_primitive_child_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/order_test.dart b/samples/client/echo_api/dart/dio/built_value/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/order_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_composite_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_default_value_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_default_value_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_integer_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_enum_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/outer_object_with_enum_property_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/parent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/parent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/parent_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/parent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/pasta_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/pet_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_speziale_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/pizza_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/read_only_first_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/single_ref_type_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/special_model_name_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/store_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/store_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/tag_test.dart b/samples/client/echo_api/dart/dio/built_value/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/tag_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_api_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_test.dart b/samples/client/echo_api/dart/dio/built_value/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/test/user_test.dart rename to samples/client/echo_api/dart/dio/built_value/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/.gitignore b/samples/client/echo_api/dart/dio/built_value_tests/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/.gitignore rename to samples/client/echo_api/dart/dio/built_value_tests/.gitignore diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/README.md b/samples/client/echo_api/dart/dio/built_value_tests/README.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/README.md rename to samples/client/echo_api/dart/dio/built_value_tests/README.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/analysis_options.yaml b/samples/client/echo_api/dart/dio/built_value_tests/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/analysis_options.yaml rename to samples/client/echo_api/dart/dio/built_value_tests/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/pubspec.yaml b/samples/client/echo_api/dart/dio/built_value_tests/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/pubspec.yaml rename to samples/client/echo_api/dart/dio/built_value_tests/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/puby.yaml b/samples/client/echo_api/dart/dio/built_value_tests/puby.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/puby.yaml rename to samples/client/echo_api/dart/dio/built_value_tests/puby.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/authentication_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/api/authentication_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/authentication_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/api/authentication_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/fake_api_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/api/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/fake_api_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/api/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/pet_api_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/api/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/pet_api_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/api/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/store_api_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/api/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api/store_api_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/api/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api_util_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/api_util_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/api_util_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/api_util_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_serializer_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/model/date_serializer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_serializer_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/model/date_serializer_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_test.dart b/samples/client/echo_api/dart/dio/built_value_tests/test/model/date_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value_tests/test/model/date_test.dart rename to samples/client/echo_api/dart/dio/built_value_tests/test/model/date_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/.gitignore b/samples/client/echo_api/dart/dio/json_serializable/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/.gitignore rename to samples/client/echo_api/dart/dio/json_serializable/.gitignore diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator-ignore b/samples/client/echo_api/dart/dio/json_serializable/.openapi-generator-ignore similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator-ignore rename to samples/client/echo_api/dart/dio/json_serializable/.openapi-generator-ignore diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES b/samples/client/echo_api/dart/dio/json_serializable/.openapi-generator/FILES similarity index 65% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES rename to samples/client/echo_api/dart/dio/json_serializable/.openapi-generator/FILES index f578c31b9270..dc5ad8e27cc4 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/FILES +++ b/samples/client/echo_api/dart/dio/json_serializable/.openapi-generator/FILES @@ -234,112 +234,3 @@ lib/src/model/user.dart lib/src/repository_base.dart lib/src/repository_impl.dart pubspec.yaml -test/additional_properties_class_test.dart -test/addressable_test.dart -test/all_of_with_single_ref_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/apple_all_of_disc_test.dart -test/apple_grandparent_disc_test.dart -test/apple_one_of_disc_test.dart -test/apple_req_disc_test.dart -test/apple_test.dart -test/apple_variant1_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/banana_all_of_disc_test.dart -test/banana_grandparent_disc_test.dart -test/banana_one_of_disc_test.dart -test/banana_req_disc_test.dart -test/banana_test.dart -test/bar_api_test.dart -test/bar_create_test.dart -test/bar_ref_or_value_test.dart -test/bar_ref_test.dart -test/bar_test.dart -test/capitalization_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/composed_disc_missing_from_properties_test.dart -test/composed_disc_optional_type_correct_test.dart -test/composed_disc_optional_type_inconsistent_test.dart -test/composed_disc_optional_type_incorrect_test.dart -test/composed_disc_required_inconsistent_test.dart -test/composed_disc_type_inconsistent_test.dart -test/composed_disc_type_incorrect_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/disc_missing_from_properties_test.dart -test/disc_optional_type_correct_test.dart -test/disc_optional_type_incorrect_test.dart -test/disc_type_incorrect_test.dart -test/dog_test.dart -test/entity_ref_test.dart -test/entity_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/extensible_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_api_test.dart -test/foo_basic_get_default_response_test.dart -test/foo_ref_or_value_test.dart -test/foo_ref_test.dart -test/foo_test.dart -test/format_test_test.dart -test/fruit_all_of_disc_test.dart -test/fruit_any_of_disc_test.dart -test/fruit_grandparent_disc_test.dart -test/fruit_inline_disc_one_of1_test.dart -test/fruit_inline_disc_one_of_test.dart -test/fruit_inline_disc_test.dart -test/fruit_inline_inline_disc_one_of1_test.dart -test/fruit_inline_inline_disc_one_of_one_of_test.dart -test/fruit_inline_inline_disc_one_of_test.dart -test/fruit_inline_inline_disc_test.dart -test/fruit_one_of_disc_test.dart -test/fruit_req_disc_test.dart -test/fruit_test.dart -test/fruit_type_test.dart -test/fruit_variant1_test.dart -test/giga_one_of_test.dart -test/grape_variant1_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/one_of_primitive_child_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/parent_test.dart -test/pasta_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/pizza_speziale_test.dart -test/pizza_test.dart -test/read_only_first_test.dart -test/single_ref_type_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/VERSION b/samples/client/echo_api/dart/dio/json_serializable/.openapi-generator/VERSION similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/.openapi-generator/VERSION rename to samples/client/echo_api/dart/dio/json_serializable/.openapi-generator/VERSION diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md b/samples/client/echo_api/dart/dio/json_serializable/README.md similarity index 99% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md rename to samples/client/echo_api/dart/dio/json_serializable/README.md index 31acd6e9f132..9abc84c0be6f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/README.md +++ b/samples/client/echo_api/dart/dio/json_serializable/README.md @@ -4,7 +4,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen +- Build package: org.openapitools.codegen.languages.DartNextClientCodegen ## Requirements diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/analysis_options.yaml b/samples/client/echo_api/dart/dio/json_serializable/analysis_options.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/analysis_options.yaml rename to samples/client/echo_api/dart/dio/json_serializable/analysis_options.yaml diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml b/samples/client/echo_api/dart/dio/json_serializable/build.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/build.yaml rename to samples/client/echo_api/dart/dio/json_serializable/build.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AdditionalPropertiesClass.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Addressable.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Addressable.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Addressable.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Addressable.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AllOfWithSingleRef.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AllOfWithSingleRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AllOfWithSingleRef.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AllOfWithSingleRef.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Animal.md similarity index 91% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Animal.md index 415b56e9bc2e..df78e9937613 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Animal.md +++ b/samples/client/echo_api/dart/dio/json_serializable/doc/Animal.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AnotherFakeApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AnotherFakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AnotherFakeApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AnotherFakeApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ApiResponse.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ApiResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ApiResponse.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ApiResponse.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Apple.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Apple.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Apple.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleAllOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AppleAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleAllOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AppleAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleGrandparentDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AppleGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleGrandparentDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AppleGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleOneOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AppleOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleOneOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AppleOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleReqDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AppleReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleReqDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AppleReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleVariant1.md b/samples/client/echo_api/dart/dio/json_serializable/doc/AppleVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/AppleVariant1.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/AppleVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfNumberOnly.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ArrayOfNumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayOfNumberOnly.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ArrayOfNumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayTest.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ArrayTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ArrayTest.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ArrayTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Banana.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Banana.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Banana.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaAllOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BananaAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaAllOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BananaAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaGrandparentDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BananaGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaGrandparentDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BananaGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaOneOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BananaOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaOneOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BananaOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaReqDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BananaReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BananaReqDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BananaReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Bar.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Bar.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Bar.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Bar.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BarApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BarApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarCreate.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BarCreate.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarCreate.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BarCreate.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRef.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BarRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRef.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BarRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRefOrValue.md b/samples/client/echo_api/dart/dio/json_serializable/doc/BarRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/BarRefOrValue.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/BarRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Capitalization.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Capitalization.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Capitalization.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Capitalization.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Cat.md similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Cat.md index 6552eea4b435..b7998f19f95f 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Cat.md +++ b/samples/client/echo_api/dart/dio/json_serializable/doc/Cat.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Category.md similarity index 91% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Category.md index ae6bc52e89d8..5e51f5aa35bc 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Category.md +++ b/samples/client/echo_api/dart/dio/json_serializable/doc/Category.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ClassModel.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ClassModel.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ClassModel.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ClassModel.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DefaultApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DefaultApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DefaultApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DefaultApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DeprecatedObject.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DeprecatedObject.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DeprecatedObject.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DeprecatedObject.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscMissingFromProperties.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DiscMissingFromProperties.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscMissingFromProperties.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DiscMissingFromProperties.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeCorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DiscOptionalTypeCorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeCorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DiscOptionalTypeCorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscTypeIncorrect.md b/samples/client/echo_api/dart/dio/json_serializable/doc/DiscTypeIncorrect.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/DiscTypeIncorrect.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/DiscTypeIncorrect.md diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Dog.md similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Dog.md index d36439b767bb..712ed082eb91 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Dog.md +++ b/samples/client/echo_api/dart/dio/json_serializable/doc/Dog.md @@ -2,7 +2,7 @@ ## Load the model package ```dart -import 'package:openapi/api.dart'; +import 'package:openapi/openapi.dart'; ``` ## Properties diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Entity.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Entity.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Entity.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Entity.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EntityRef.md b/samples/client/echo_api/dart/dio/json_serializable/doc/EntityRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EntityRef.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/EntityRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumArrays.md b/samples/client/echo_api/dart/dio/json_serializable/doc/EnumArrays.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumArrays.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/EnumArrays.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumTest.md b/samples/client/echo_api/dart/dio/json_serializable/doc/EnumTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/EnumTest.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/EnumTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Extensible.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Extensible.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Extensible.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Extensible.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FakeApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FakeApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeClassnameTags123Api.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FakeClassnameTags123Api.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FakeClassnameTags123Api.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FakeClassnameTags123Api.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FileSchemaTestClass.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FileSchemaTestClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FileSchemaTestClass.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FileSchemaTestClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Foo.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Foo.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Foo.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Foo.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FooApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FooApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooBasicGetDefaultResponse.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FooBasicGetDefaultResponse.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooBasicGetDefaultResponse.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FooBasicGetDefaultResponse.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRef.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FooRef.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRef.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FooRef.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRefOrValue.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FooRefOrValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FooRefOrValue.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FooRefOrValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FormatTest.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FormatTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FormatTest.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FormatTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Fruit.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Fruit.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Fruit.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAllOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitAllOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAllOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitAllOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAnyOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitAnyOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitAnyOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitAnyOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitGrandparentDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitGrandparentDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitGrandparentDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitGrandparentDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineDiscOneOf1.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitOneOfDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitOneOfDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitOneOfDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitOneOfDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitReqDisc.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitReqDisc.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitReqDisc.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitReqDisc.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitType.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitType.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitType.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitVariant1.md b/samples/client/echo_api/dart/dio/json_serializable/doc/FruitVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/FruitVariant1.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/FruitVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GigaOneOf.md b/samples/client/echo_api/dart/dio/json_serializable/doc/GigaOneOf.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GigaOneOf.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/GigaOneOf.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GrapeVariant1.md b/samples/client/echo_api/dart/dio/json_serializable/doc/GrapeVariant1.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/GrapeVariant1.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/GrapeVariant1.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HasOnlyReadOnly.md b/samples/client/echo_api/dart/dio/json_serializable/doc/HasOnlyReadOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HasOnlyReadOnly.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/HasOnlyReadOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HealthCheckResult.md b/samples/client/echo_api/dart/dio/json_serializable/doc/HealthCheckResult.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/HealthCheckResult.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/HealthCheckResult.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MapTest.md b/samples/client/echo_api/dart/dio/json_serializable/doc/MapTest.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MapTest.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/MapTest.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/echo_api/dart/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Model200Response.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Model200Response.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Model200Response.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Model200Response.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelClient.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ModelClient.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelClient.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ModelClient.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelEnumClass.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ModelEnumClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelEnumClass.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ModelEnumClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelFile.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ModelFile.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelFile.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ModelFile.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelList.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ModelList.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelList.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ModelList.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelReturn.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ModelReturn.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ModelReturn.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ModelReturn.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Name.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Name.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Name.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Name.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NullableClass.md b/samples/client/echo_api/dart/dio/json_serializable/doc/NullableClass.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NullableClass.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/NullableClass.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NumberOnly.md b/samples/client/echo_api/dart/dio/json_serializable/doc/NumberOnly.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/NumberOnly.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/NumberOnly.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ObjectWithDeprecatedFields.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ObjectWithDeprecatedFields.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OneOfPrimitiveChild.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OneOfPrimitiveChild.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OneOfPrimitiveChild.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OneOfPrimitiveChild.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Order.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Order.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Order.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Order.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterComposite.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterComposite.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterComposite.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterComposite.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnum.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnum.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnum.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnum.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumDefaultValue.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumDefaultValue.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumInteger.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumInteger.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumInteger.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumInteger.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/client/echo_api/dart/dio/json_serializable/doc/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/OuterObjectWithEnumProperty.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/OuterObjectWithEnumProperty.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Parent.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Parent.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Parent.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Parent.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pasta.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Pasta.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pasta.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Pasta.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pet.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Pet.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pet.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Pet.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PetApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/PetApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PetApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/PetApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pizza.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Pizza.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Pizza.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Pizza.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PizzaSpeziale.md b/samples/client/echo_api/dart/dio/json_serializable/doc/PizzaSpeziale.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/PizzaSpeziale.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/PizzaSpeziale.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ReadOnlyFirst.md b/samples/client/echo_api/dart/dio/json_serializable/doc/ReadOnlyFirst.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/ReadOnlyFirst.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/ReadOnlyFirst.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SingleRefType.md b/samples/client/echo_api/dart/dio/json_serializable/doc/SingleRefType.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SingleRefType.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/SingleRefType.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SpecialModelName.md b/samples/client/echo_api/dart/dio/json_serializable/doc/SpecialModelName.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/SpecialModelName.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/SpecialModelName.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/StoreApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/StoreApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/StoreApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/StoreApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Tag.md b/samples/client/echo_api/dart/dio/json_serializable/doc/Tag.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Tag.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/Tag.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/User.md b/samples/client/echo_api/dart/dio/json_serializable/doc/User.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/User.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/User.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/UserApi.md b/samples/client/echo_api/dart/dio/json_serializable/doc/UserApi.md similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/UserApi.md rename to samples/client/echo_api/dart/dio/json_serializable/doc/UserApi.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/apis.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/apis.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/apis.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/apis.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/models.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/models.dart index 2192ab1bb93c..02ef41593ef1 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/models.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/models.dart @@ -1,3 +1,4 @@ + export 'package:openapi/src/repository_base.dart'; export 'package:openapi/src/repository_impl.dart'; export 'package:openapi/src/model/additional_properties_class.dart'; diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/openapi.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/openapi.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/openapi.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/openapi.dart index 1865b320d1b4..6c3dbb746aa8 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/openapi.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/openapi.dart @@ -2,6 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // + export 'apis.dart'; export 'models.dart'; export 'package:openapi/src/auth/_exports.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/another_fake_api.dart similarity index 91% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/another_fake_api.dart index d0e3a4ef0491..73a338f00c68 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/another_fake_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/another_fake_api.dart @@ -14,6 +14,7 @@ import 'package:openapi/src/model/model_client.dart'; part 'another_fake_api.g.dart'; class AnotherFakeApi { + final AnotherFakeApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -33,7 +34,7 @@ class AnotherFakeApi { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -41,12 +42,18 @@ class AnotherFakeApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.call123testSpecialTags( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -55,16 +62,19 @@ class AnotherFakeApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ModelClient)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -86,9 +96,10 @@ class AnotherFakeApi { extra: _response.extra, ); } -} +} class AnotherFakeApiRaw { + final Dio _dio; const AnotherFakeApiRaw(this._dio); @@ -107,7 +118,7 @@ class AnotherFakeApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ + Future> call123testSpecialTags({ Object? body, String? requestContentType, String? acceptContentType, @@ -144,4 +155,8 @@ class AnotherFakeApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/bar_api.dart similarity index 90% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/bar_api.dart index 09dd9c754c7d..7f52bbce1abd 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/bar_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/bar_api.dart @@ -15,16 +15,17 @@ import 'package:openapi/src/model/bar_create.dart'; part 'bar_api.g.dart'; class BarApi { + final BarApiRaw rawApi; final SerializationRepositoryBase _repository; const BarApi(this.rawApi, this._repository); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -34,7 +35,7 @@ class BarApi { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioException] if API call or serialization fails - Future> createBar({ + Future> createBar({ required BarCreate barCreate, CancelToken? cancelToken, Map? headers, @@ -42,12 +43,18 @@ class BarApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = - encodeBodyParameter(_repository, barCreate, const TypeInfo(BarCreate)); + _bodyData = encodeBodyParameter(_repository, barCreate, const TypeInfo( + + + BarCreate + ) + +); final _response = await rawApi.createBar( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -56,15 +63,19 @@ class BarApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Bar? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Bar)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Bar + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -86,18 +97,19 @@ class BarApi { extra: _response.extra, ); } -} +} class BarApiRaw { + final Dio _dio; const BarApiRaw(this._dio); /// Create a Bar - /// + /// /// /// Parameters: - /// * [barCreate] + /// * [barCreate] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -107,7 +119,7 @@ class BarApiRaw { /// /// Returns a [Future] containing a [Response] with a [Bar] as data /// Throws [DioException] if API call or serialization fails - Future> createBar({ + Future> createBar({ Object? body, String? requestContentType, String? acceptContentType, @@ -144,4 +156,8 @@ class BarApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/default_api.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/default_api.dart index bd8bc185ed97..316fac48cad9 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/default_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/default_api.dart @@ -18,13 +18,14 @@ import 'package:openapi/src/model/giga_one_of.dart'; part 'default_api.g.dart'; class DefaultApi { + final DefaultApiRaw rawApi; final SerializationRepositoryBase _repository; const DefaultApi(this.rawApi, this._repository); /// fooBasicGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -36,31 +37,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data /// Throws [DioException] if API call or serialization fails - Future> fooBasicGet({ + Future> fooBasicGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.fooBasicGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooBasicGetDefaultResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, - const TypeInfo(FooBasicGetDefaultResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FooBasicGetDefaultResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -84,7 +91,7 @@ class DefaultApi { } /// list - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -96,30 +103,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data /// Throws [DioException] if API call or serialization fails - Future> list({ + Future> list({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.list( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); GigaOneOf? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(GigaOneOf)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + GigaOneOf + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -143,7 +157,7 @@ class DefaultApi { } /// oneofGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -155,30 +169,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [Fruit] as data /// Throws [DioException] if API call or serialization fails - Future> oneofGet({ + Future> oneofGet({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.oneofGet( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Fruit? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Fruit)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Fruit + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -202,10 +223,10 @@ class DefaultApi { } /// test - /// + /// /// /// Parameters: - /// * [body] + /// * [body] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -215,20 +236,26 @@ class DefaultApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> test({ - Object? body, + Future> test({ + Object? body, CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = - encodeBodyParameter(_repository, body, const TypeInfo.nullable(Object)); + _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + + + Object + ) + +); final _response = await rawApi.test( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -237,13 +264,13 @@ class DefaultApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// variant1Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -255,31 +282,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data /// Throws [DioException] if API call or serialization fails - Future> variant1Get({ + Future> variant1Get({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.variant1Get( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FruitVariant1? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FruitVariant1)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FruitVariant1 + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -303,7 +336,7 @@ class DefaultApi { } /// variant2Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -315,31 +348,37 @@ class DefaultApi { /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data /// Throws [DioException] if API call or serialization fails - Future> variant2Get({ + Future> variant2Get({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.variant2Get( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FruitAllOfDisc? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FruitAllOfDisc)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FruitAllOfDisc + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -361,15 +400,16 @@ class DefaultApi { extra: _response.extra, ); } -} +} class DefaultApiRaw { + final Dio _dio; const DefaultApiRaw(this._dio); /// fooBasicGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -381,7 +421,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data /// Throws [DioException] if API call or serialization fails - Future> fooBasicGet({ + Future> fooBasicGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -420,7 +460,7 @@ class DefaultApiRaw { } /// list - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -432,7 +472,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data /// Throws [DioException] if API call or serialization fails - Future> list({ + Future> list({ Object? body, String? requestContentType, String? acceptContentType, @@ -471,7 +511,7 @@ class DefaultApiRaw { } /// oneofGet - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -483,7 +523,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [Fruit] as data /// Throws [DioException] if API call or serialization fails - Future> oneofGet({ + Future> oneofGet({ Object? body, String? requestContentType, String? acceptContentType, @@ -522,10 +562,10 @@ class DefaultApiRaw { } /// test - /// + /// /// /// Parameters: - /// * [body] + /// * [body] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -535,7 +575,7 @@ class DefaultApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> test({ + Future> test({ Object? body, String? requestContentType, String? acceptContentType, @@ -574,7 +614,7 @@ class DefaultApiRaw { } /// variant1Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -586,7 +626,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data /// Throws [DioException] if API call or serialization fails - Future> variant1Get({ + Future> variant1Get({ Object? body, String? requestContentType, String? acceptContentType, @@ -625,7 +665,7 @@ class DefaultApiRaw { } /// variant2Get - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -637,7 +677,7 @@ class DefaultApiRaw { /// /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data /// Throws [DioException] if API call or serialization fails - Future> variant2Get({ + Future> variant2Get({ Object? body, String? requestContentType, String? acceptContentType, @@ -674,4 +714,8 @@ class DefaultApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_api.dart similarity index 99% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_api.dart index c51c966f8314..15ce95b2fde7 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_api.dart @@ -2461,11 +2461,11 @@ class FakeApiRaw { enum EnumHeaderStringArrayEnum { - @JsonValue(r'>') + @JsonValue(rr'>') greaterThan, - @JsonValue(r'$') + @JsonValue(rr'$') dollar, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } @@ -2473,24 +2473,24 @@ enum EnumHeaderStringArrayEnum { /// Header parameter enum test (string) enum EnumHeaderStringEnum { - @JsonValue(r'_abc') + @JsonValue(rr'_abc') abc, - @JsonValue(r'-efg') + @JsonValue(rr'-efg') efg, - @JsonValue(r'(xyz)') + @JsonValue(rr'(xyz)') leftParenthesisXyzRightParenthesis, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumQueryStringArrayEnum { - @JsonValue(r'>') + @JsonValue(rr'>') greaterThan, - @JsonValue(r'$') + @JsonValue(rr'$') dollar, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } @@ -2498,13 +2498,13 @@ enum EnumQueryStringArrayEnum { /// Query parameter enum test (string) enum EnumQueryStringEnum { - @JsonValue(r'_abc') + @JsonValue(rr'_abc') abc, - @JsonValue(r'-efg') + @JsonValue(rr'-efg') efg, - @JsonValue(r'(xyz)') + @JsonValue(rr'(xyz)') leftParenthesisXyzRightParenthesis, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } @@ -2522,11 +2522,11 @@ enum EnumQueryIntegerEnum { /// Query parameter enum test (double) enum EnumQueryDoubleEnum { - @JsonValue('1.1') + @JsonValue(r'1.1') number1Period1, - @JsonValue('-1.2') + @JsonValue(r'-1.2') numberNegative1Period2, - @JsonValue('11184809') + @JsonValue(r'11184809') unknownDefaultOpenApi, } @@ -2534,20 +2534,19 @@ enum EnumQueryDoubleEnum { enum InnerEnum { - // } /// Form parameter enum test (string) enum EnumFormStringEnum { - @JsonValue(r'_abc') + @JsonValue(rr'_abc') abc, - @JsonValue(r'-efg') + @JsonValue(rr'-efg') efg, - @JsonValue(r'(xyz)') + @JsonValue(rr'(xyz)') leftParenthesisXyzRightParenthesis, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart index d4da7006767e..a39749d0be45 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart @@ -14,6 +14,7 @@ import 'package:openapi/src/model/model_client.dart'; part 'fake_classname_tags123_api.g.dart'; class FakeClassnameTags123Api { + final FakeClassnameTags123ApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -33,7 +34,7 @@ class FakeClassnameTags123Api { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ required ModelClient modelClient, CancelToken? cancelToken, Map? headers, @@ -41,12 +42,18 @@ class FakeClassnameTags123Api { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, modelClient, const TypeInfo(ModelClient)); + _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + + + ModelClient + ) + +); final _response = await rawApi.testClassname( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -55,16 +62,19 @@ class FakeClassnameTags123Api { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ModelClient? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ModelClient)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ModelClient + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -86,9 +96,10 @@ class FakeClassnameTags123Api { extra: _response.extra, ); } -} +} class FakeClassnameTags123ApiRaw { + final Dio _dio; const FakeClassnameTags123ApiRaw(this._dio); @@ -107,7 +118,7 @@ class FakeClassnameTags123ApiRaw { /// /// Returns a [Future] containing a [Response] with a [ModelClient] as data /// Throws [DioException] if API call or serialization fails - Future> testClassname({ + Future> testClassname({ Object? body, String? requestContentType, String? acceptContentType, @@ -151,4 +162,8 @@ class FakeClassnameTags123ApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/foo_api.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/foo_api.dart index 1285caef6bab..82aa013c1719 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/foo_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/foo_api.dart @@ -15,13 +15,14 @@ import 'package:openapi/src/model/foo_ref_or_value.dart'; part 'foo_api.g.dart'; class FooApi { + final FooApiRaw rawApi; final SerializationRepositoryBase _repository; const FooApi(this.rawApi, this._repository); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -34,7 +35,7 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioException] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ required Foo foo, CancelToken? cancelToken, Map? headers, @@ -42,11 +43,18 @@ class FooApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo(Foo)); + _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo( + + + Foo + ) + +); final _response = await rawApi.createFoo( + body: _bodyData, requestContentType: 'application/json;charset=utf-8', cancelToken: cancelToken, @@ -55,16 +63,19 @@ class FooApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); FooRefOrValue? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(FooRefOrValue)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + FooRefOrValue + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -88,7 +99,7 @@ class FooApi { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -100,35 +111,43 @@ class FooApi { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioException] if API call or serialization fails - Future>> getAllFoos({ + Future>> getAllFoos({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getAllFoos( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); List? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(List, [ - const TypeInfo(FooRefOrValue), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + List, [ + + const TypeInfo( + + FooRefOrValue + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -150,15 +169,16 @@ class FooApi { extra: _response.extra, ); } -} +} class FooApiRaw { + final Dio _dio; const FooApiRaw(this._dio); /// Create a Foo - /// + /// /// /// Parameters: /// * [foo] - The Foo to be created @@ -171,7 +191,7 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data /// Throws [DioException] if API call or serialization fails - Future> createFoo({ + Future> createFoo({ Object? body, String? requestContentType, String? acceptContentType, @@ -210,7 +230,7 @@ class FooApiRaw { } /// GET all Foos - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -222,7 +242,7 @@ class FooApiRaw { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioException] if API call or serialization fails - Future> getAllFoos({ + Future> getAllFoos({ Object? body, String? requestContentType, String? acceptContentType, @@ -259,4 +279,8 @@ class FooApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/pet_api.dart similarity index 89% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/pet_api.dart index b7c8a07bde33..f5c06fc13e24 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/pet_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/pet_api.dart @@ -15,13 +15,14 @@ import 'package:openapi/src/model/pet.dart'; part 'pet_api.g.dart'; class PetApi { + final PetApiRaw rawApi; final SerializationRepositoryBase _repository; const PetApi(this.rawApi, this._repository); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -34,7 +35,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ + Future> addPet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -42,11 +43,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.addPet( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -55,17 +63,17 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -75,7 +83,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required int petId, required String apiKey, CancelToken? cancelToken, @@ -84,18 +92,32 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deletePet( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), - apiKey: - encodeStringParameter(_repository, apiKey, const TypeInfo(String)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), + apiKey: encodeStringParameter(_repository, apiKey, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -114,7 +136,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioException] if API call or serialization fails - Future>> findPetsByStatus({ + Future>> findPetsByStatus({ @Deprecated('status is deprecated') required List status, CancelToken? cancelToken, Map? headers, @@ -122,36 +144,49 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.findPetsByStatus( - status: encodeQueryParameter( - _repository, - status, - const TypeInfo(List, [ - const TypeInfo(StatusEnum), - ]), - format: ListFormat.csv, - ), + + status: encodeQueryParameter(_repository, status, const TypeInfo( + List, [ + + const TypeInfo( + + StatusEnum + + ) + +, + ]) + +, format: ListFormat.csv,), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); List? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(List, [ - const TypeInfo(Pet), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + List, [ + + const TypeInfo( + + Pet + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -189,7 +224,7 @@ class PetApi { /// Returns a [Future] containing a [Response] with a [Set] as data /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ + Future>> findPetsByTags({ required Set tags, CancelToken? cancelToken, Map? headers, @@ -197,36 +232,49 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.findPetsByTags( - tags: encodeQueryParameter( - _repository, - tags, - const TypeInfo(Set, [ - const TypeInfo(String), - ]), - format: ListFormat.csv, - ), + + tags: encodeQueryParameter(_repository, tags, const TypeInfo( + Set, [ + + const TypeInfo( + + String + + ) + +, + ]) + +, format: ListFormat.csv,), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Set? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(Set, [ - const TypeInfo(Pet), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + Set, [ + + const TypeInfo( + + Pet + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -263,7 +311,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required int petId, CancelToken? cancelToken, Map? headers, @@ -271,24 +319,37 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getPetById( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Pet? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Pet)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Pet + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -312,7 +373,7 @@ class PetApi { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -325,7 +386,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ required Pet pet, CancelToken? cancelToken, Map? headers, @@ -333,11 +394,18 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo(Pet)); + _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + + + Pet + ) + +); final _response = await rawApi.updatePet( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -346,13 +414,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -367,7 +435,7 @@ class PetApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required int petId, required String name, required String status, @@ -377,19 +445,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (name != null) - r'name': encodeFormParameter(_repository, name, const TypeInfo(String)), - if (status != null) - r'status': - encodeFormParameter(_repository, status, const TypeInfo(String)), + if (name != null) r'name': encodeFormParameter(_repository, name, const TypeInfo( + + + String + ) + +), + if (status != null) r'status': encodeFormParameter(_repository, status, const TypeInfo( + + + String + ) + +), }; _bodyData = _bodyMap; final _response = await rawApi.updatePetWithForm( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'application/x-www-form-urlencoded', cancelToken: cancelToken, @@ -398,13 +482,13 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -419,7 +503,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required int petId, required String additionalMetadata, required MultipartFile file, @@ -429,20 +513,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) - r'additionalMetadata': encodeFormParameter( - _repository, additionalMetadata, const TypeInfo(String)), - if (file != null) - r'file': encodeFormParameter( - _repository, file, const TypeInfo(MultipartFile)), + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + + + String + ) + +), + if (file != null) r'file': encodeFormParameter(_repository, file, const TypeInfo( + + + MultipartFile + ) + +), }; _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -451,16 +550,19 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ApiResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ApiResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -484,7 +586,7 @@ class PetApi { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -499,7 +601,7 @@ class PetApi { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required int petId, required MultipartFile requiredFile, required String additionalMetadata, @@ -509,19 +611,35 @@ class PetApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) - r'additionalMetadata': encodeFormParameter( - _repository, additionalMetadata, const TypeInfo(String)), - r'requiredFile': encodeFormParameter( - _repository, requiredFile, const TypeInfo(MultipartFile)), + if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + + + String + ) + +), + r'requiredFile': encodeFormParameter(_repository, requiredFile, const TypeInfo( + + + MultipartFile + ) + +), }; _bodyData = FormData.fromMap(_bodyMap); final _response = await rawApi.uploadFileWithRequiredFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo(int)), + + petId: encodeStringParameter(_repository, petId, const TypeInfo( + + + int + ) + +), body: _bodyData, requestContentType: 'multipart/form-data', cancelToken: cancelToken, @@ -530,16 +648,19 @@ class PetApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); ApiResponse? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, rawResponse, const TypeInfo(ApiResponse)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + ApiResponse + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -561,15 +682,16 @@ class PetApi { extra: _response.extra, ); } -} +} class PetApiRaw { + final Dio _dio; const PetApiRaw(this._dio); /// Add a new pet to the store - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -582,7 +704,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> addPet({ + Future> addPet({ Object? body, String? requestContentType, String? acceptContentType, @@ -626,11 +748,11 @@ class PetApiRaw { } /// Deletes a pet - /// + /// /// /// Parameters: /// * [petId] - Pet id to delete - /// * [apiKey] + /// * [apiKey] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -640,7 +762,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deletePet({ + Future> deletePet({ required String petId, String? apiKey, Object? body, @@ -654,8 +776,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -701,7 +822,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [List] as data /// Throws [DioException] if API call or serialization fails - Future> findPetsByStatus({ + Future> findPetsByStatus({ @Deprecated('status is deprecated') required Object status, Object? body, String? requestContentType, @@ -765,7 +886,7 @@ class PetApiRaw { /// Returns a [Future] containing a [Response] with a [Set] as data /// Throws [DioException] if API call or serialization fails @Deprecated('This operation has been deprecated') - Future> findPetsByTags({ + Future> findPetsByTags({ required Object tags, Object? body, String? requestContentType, @@ -828,7 +949,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [Pet] as data /// Throws [DioException] if API call or serialization fails - Future> getPetById({ + Future> getPetById({ required String petId, Object? body, String? requestContentType, @@ -841,8 +962,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'GET', headers: { @@ -876,7 +996,7 @@ class PetApiRaw { } /// Update an existing pet - /// + /// /// /// Parameters: /// * [pet] - Pet object that needs to be added to the store @@ -889,7 +1009,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePet({ + Future> updatePet({ Object? body, String? requestContentType, String? acceptContentType, @@ -933,7 +1053,7 @@ class PetApiRaw { } /// Updates a pet in the store with form data - /// + /// /// /// Parameters: /// * [petId] - ID of pet that needs to be updated @@ -948,7 +1068,7 @@ class PetApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ + Future> updatePetWithForm({ required String petId, Object? body, String? requestContentType, @@ -961,8 +1081,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = - r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -994,7 +1113,7 @@ class PetApiRaw { } /// uploads an image - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1009,7 +1128,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ + Future> uploadFile({ required String petId, Object? body, String? requestContentType, @@ -1022,8 +1141,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/pet/{petId}/uploadImage' - .replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1055,7 +1173,7 @@ class PetApiRaw { } /// uploads an image (required) - /// + /// /// /// Parameters: /// * [petId] - ID of pet to update @@ -1070,7 +1188,7 @@ class PetApiRaw { /// /// Returns a [Future] containing a [Response] with a [ApiResponse] as data /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ + Future> uploadFileWithRequiredFile({ required String petId, Object? body, String? requestContentType, @@ -1083,8 +1201,7 @@ class PetApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile' - .replaceAll('{' r'petId' '}', petId.toString()); + final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); final _options = Options( method: r'POST', headers: { @@ -1114,16 +1231,37 @@ class PetApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + @Deprecated('StatusEnum has been deprecated') enum StatusEnum { - @JsonValue(r'available') + @JsonValue(rr'available') available, - @JsonValue(r'pending') + @JsonValue(rr'pending') pending, - @JsonValue(r'sold') + @JsonValue(rr'sold') sold, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } + + + + + + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/store_api.dart similarity index 91% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/store_api.dart index 32acb15b4111..7d8d00ab8fca 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/store_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/store_api.dart @@ -14,6 +14,7 @@ import 'package:openapi/src/model/order.dart'; part 'store_api.g.dart'; class StoreApi { + final StoreApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -33,7 +34,7 @@ class StoreApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, CancelToken? cancelToken, Map? headers, @@ -41,17 +42,25 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deleteOrder( - orderId: - encodeStringParameter(_repository, orderId, const TypeInfo(String)), + + orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -69,36 +78,43 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Map] as data /// Throws [DioException] if API call or serialization fails - Future>> getInventory({ + Future>> getInventory({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getInventory( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Map? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse( - _repository, - rawResponse, - const TypeInfo(Map, [ - TypeInfo(String), - const TypeInfo(int), - ])); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + Map, [ + TypeInfo(String), + const TypeInfo( + + int + + ) + +, + ]) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -135,7 +151,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required int orderId, CancelToken? cancelToken, Map? headers, @@ -143,24 +159,37 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getOrderById( - orderId: encodeStringParameter(_repository, orderId, const TypeInfo(int)), + + orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + + + int + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Order + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -184,7 +213,7 @@ class StoreApi { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -197,7 +226,7 @@ class StoreApi { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ required Order order, CancelToken? cancelToken, Map? headers, @@ -205,11 +234,18 @@ class StoreApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, order, const TypeInfo(Order)); + _bodyData = encodeBodyParameter(_repository, order, const TypeInfo( + + + Order + ) + +); final _response = await rawApi.placeOrder( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -218,15 +254,19 @@ class StoreApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); Order? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(Order)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + Order + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -248,9 +288,10 @@ class StoreApi { extra: _response.extra, ); } -} +} class StoreApiRaw { + final Dio _dio; const StoreApiRaw(this._dio); @@ -269,7 +310,7 @@ class StoreApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ + Future> deleteOrder({ required String orderId, Object? body, String? requestContentType, @@ -282,8 +323,7 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}' - .replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'DELETE', headers: { @@ -322,7 +362,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Map] as data /// Throws [DioException] if API call or serialization fails - Future> getInventory({ + Future> getInventory({ Object? body, String? requestContentType, String? acceptContentType, @@ -381,7 +421,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ + Future> getOrderById({ required String orderId, Object? body, String? requestContentType, @@ -394,8 +434,7 @@ class StoreApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/store/order/{order_id}' - .replaceAll('{' r'order_id' '}', orderId.toString()); + final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final _options = Options( method: r'GET', headers: { @@ -422,7 +461,7 @@ class StoreApiRaw { } /// Place an order for a pet - /// + /// /// /// Parameters: /// * [order] - order placed for purchasing the pet @@ -435,7 +474,7 @@ class StoreApiRaw { /// /// Returns a [Future] containing a [Response] with a [Order] as data /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ + Future> placeOrder({ Object? body, String? requestContentType, String? acceptContentType, @@ -472,4 +511,10 @@ class StoreApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/user_api.dart similarity index 91% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api/user_api.dart index 87293567d705..f1c1d118e0c3 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api/user_api.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api/user_api.dart @@ -14,6 +14,7 @@ import 'package:openapi/src/model/user.dart'; part 'user_api.g.dart'; class UserApi { + final UserApiRaw rawApi; final SerializationRepositoryBase _repository; @@ -33,7 +34,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUser({ + Future> createUser({ required User user, CancelToken? cancelToken, Map? headers, @@ -41,11 +42,18 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.createUser( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -54,13 +62,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -73,7 +81,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ required List user, CancelToken? cancelToken, Map? headers, @@ -81,16 +89,24 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, - user, - const TypeInfo(List, [ - const TypeInfo(User), - ])); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + List, [ + + const TypeInfo( + + User + + ) + +, + ]) + +); final _response = await rawApi.createUsersWithArrayInput( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -99,13 +115,13 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -118,7 +134,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ required List user, CancelToken? cancelToken, Map? headers, @@ -126,16 +142,24 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter( - _repository, - user, - const TypeInfo(List, [ - const TypeInfo(User), - ])); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + List, [ + + const TypeInfo( + + User + + ) + +, + ]) + +); final _response = await rawApi.createUsersWithListInput( + body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -144,7 +168,7 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -163,7 +187,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, CancelToken? cancelToken, Map? headers, @@ -171,23 +195,31 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.deleteUser( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -200,7 +232,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, CancelToken? cancelToken, Map? headers, @@ -208,25 +240,37 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.getUserByName( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); User? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(User)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + User + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -250,7 +294,7 @@ class UserApi { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -264,7 +308,7 @@ class UserApi { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required String username, required String password, CancelToken? cancelToken, @@ -273,33 +317,44 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.loginUser( - username: encodeQueryParameter( - _repository, - username, - const TypeInfo(String), - ), - password: encodeQueryParameter( - _repository, - password, - const TypeInfo(String), - ), + + username: encodeQueryParameter(_repository, username, const TypeInfo( + + + String + ) + +, ), + password: encodeQueryParameter(_repository, password, const TypeInfo( + + + String + ) + +, ), + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); String? _responseData; try { final rawResponse = _response.data; - _responseData = rawResponse == null - ? null - : decodeResponse(_repository, rawResponse, const TypeInfo(String)); + _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + + String + + ) + +); } catch (error, stackTrace) { throw DioException( requestOptions: _response.requestOptions, @@ -323,7 +378,7 @@ class UserApi { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -335,22 +390,25 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ CancelToken? cancelToken, Map? headers, Map? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { + final _response = await rawApi.logoutUser( + + cancelToken: cancelToken, headers: headers, extra: extra, validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } @@ -370,7 +428,7 @@ class UserApi { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, required User user, CancelToken? cancelToken, @@ -379,13 +437,25 @@ class UserApi { ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - }) async { + }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo(User)); + _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + + + User + ) + +); final _response = await rawApi.updateUser( - username: - encodeStringParameter(_repository, username, const TypeInfo(String)), + + username: encodeStringParameter(_repository, username, const TypeInfo( + + + String + ) + +), body: _bodyData, requestContentType: 'application/json', cancelToken: cancelToken, @@ -394,13 +464,14 @@ class UserApi { validateStatus: validateStatus, onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress, - ); + ); return _response; } -} +} class UserApiRaw { + final Dio _dio; const UserApiRaw(this._dio); @@ -419,7 +490,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUser({ + Future> createUser({ Object? body, String? requestContentType, String? acceptContentType, @@ -458,7 +529,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -471,7 +542,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ + Future> createUsersWithArrayInput({ Object? body, String? requestContentType, String? acceptContentType, @@ -510,7 +581,7 @@ class UserApiRaw { } /// Creates list of users with given input array - /// + /// /// /// Parameters: /// * [user] - List of user object @@ -523,7 +594,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ + Future> createUsersWithListInput({ Object? body, String? requestContentType, String? acceptContentType, @@ -575,7 +646,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ + Future> deleteUser({ required String username, Object? body, String? requestContentType, @@ -588,8 +659,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'DELETE', headers: { @@ -616,7 +686,7 @@ class UserApiRaw { } /// Get user by user name - /// + /// /// /// Parameters: /// * [username] - The name that needs to be fetched. Use user1 for testing. @@ -629,7 +699,7 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [User] as data /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ + Future> getUserByName({ required String username, Object? body, String? requestContentType, @@ -642,8 +712,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'GET', headers: { @@ -670,7 +739,7 @@ class UserApiRaw { } /// Logs user into the system - /// + /// /// /// Parameters: /// * [username] - The user name for login @@ -684,7 +753,7 @@ class UserApiRaw { /// /// Returns a [Future] containing a [Response] with a [String] as data /// Throws [DioException] if API call or serialization fails - Future> loginUser({ + Future> loginUser({ required Object username, required Object password, Object? body, @@ -731,7 +800,7 @@ class UserApiRaw { } /// Logs out current logged in user session - /// + /// /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -743,7 +812,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ + Future> logoutUser({ Object? body, String? requestContentType, String? acceptContentType, @@ -796,7 +865,7 @@ class UserApiRaw { /// /// Returns a [Future] /// Throws [DioException] if API call or serialization fails - Future> updateUser({ + Future> updateUser({ required String username, Object? body, String? requestContentType, @@ -809,8 +878,7 @@ class UserApiRaw { ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, }) async { - final _path = r'/user/{username}' - .replaceAll('{' r'username' '}', username.toString()); + final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final _options = Options( method: r'PUT', headers: { @@ -835,4 +903,16 @@ class UserApiRaw { onReceiveProgress: onReceiveProgress, ); } + } + + + + + + + + + + + diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_client.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api_client.dart similarity index 85% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_client.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/api_client.dart index 0d86bd46b0bd..587fd726c76a 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_client.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api_client.dart @@ -15,6 +15,7 @@ class Openapi { final Dio dio; final SerializationRepositoryBase serializationRepository; + Openapi({ Dio? dio, SerializationRepositoryBase? serializationRepositoryOverride, @@ -25,9 +26,7 @@ class Openapi { baseUrl: basePathOverride ?? basePath, connectTimeout: const Duration(milliseconds: 5000), receiveTimeout: const Duration(milliseconds: 3000), - )), - this.serializationRepository = - serializationRepositoryOverride ?? JsonSerializableRepository() { + )), this.serializationRepository = serializationRepositoryOverride ?? JsonSerializableRepository() { if (interceptors == null) { this.dio.interceptors.addAll([ OAuthInterceptor(), @@ -42,36 +41,25 @@ class Openapi { void setOAuthToken(String name, String token) { if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) - as OAuthInterceptor) - .tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; } } void setBearerAuth(String name, String token) { if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) - as BearerAuthInterceptor) - .tokens[name] = token; + (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; } } void setBasicAuth(String name, String username, String password) { if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) - as BasicAuthInterceptor) - .authInfo[name] = BasicAuthInfo(username, password); + (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); } } void setApiKey(String name, String apiKey) { if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this - .dio - .interceptors - .firstWhere((element) => element is ApiKeyAuthInterceptor) - as ApiKeyAuthInterceptor) - .apiKeys[name] = apiKey; + (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; } } @@ -102,8 +90,7 @@ class Openapi { /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api( - FakeClassnameTags123ApiRaw(dio), serializationRepository); + return FakeClassnameTags123Api(FakeClassnameTags123ApiRaw(dio), serializationRepository); } /// Get FooApi instance, base route and serializer can be overridden by a given but be careful, diff --git a/samples/client/echo_api/dart/dio/json_serializable/lib/src/api_util.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api_util.dart new file mode 100644 index 000000000000..cca5b3427a0a --- /dev/null +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/api_util.dart @@ -0,0 +1,88 @@ +import 'package:dio/dio.dart'; +import 'dart:convert'; +import 'package:openapi/models.dart'; +import 'dart:typed_data'; + +/// Format the given form parameter object into something that Dio can handle. +/// Returns primitive or String. +/// Returns List/Map if the value is BuildList/BuiltMap. +Object encodeFormParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +String encodeStringParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + return repository.serialize(value, type).toString(); +} + +Object encodeBodyParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, +) { + if (value == null) { + return ''; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +Object encodeQueryParameter( + SerializationRepositoryBase repository, + T value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + if (value == null) { + return ''; + } + if (value is String || value is num || value is bool) { + return value; + } + if (value is Uint8List) { + // Currently not sure how to serialize this + return value; + } + final serialized = repository.serialize( + value, + type, + ); + return serialized; +} + +ListParam encodeCollectionQueryParameter( + SerializationRepositoryBase repository, + Iterable value, + TypeInfo type, { + ListFormat format = ListFormat.multi, +}) { + final serialized = repository.serialize( + value, + type, + ); + if (serialized is Iterable) { + return ListParam(serialized.toList(), format); + } + throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); +} + +TOutput decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) { + return repository.deserialize(value, type); +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/_exports.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/_exports.dart similarity index 83% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/_exports.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/_exports.dart index 7219f2ecefa2..f038e92358ef 100644 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/_exports.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/_exports.dart @@ -2,4 +2,4 @@ export 'api_key_auth.dart'; export 'basic_auth.dart'; export 'oauth.dart'; export 'bearer_auth.dart'; -export 'auth.dart'; +export 'auth.dart'; \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/api_key_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/api_key_auth.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/api_key_auth.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/auth.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/auth.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/basic_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/basic_auth.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/basic_auth.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/bearer_auth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/bearer_auth.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/bearer_auth.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/oauth.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/built_value/lib/src/auth/oauth.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/auth/oauth.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/deserialize.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/deserialize.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/deserialize.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/additional_properties_class.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/addressable.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/addressable.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/addressable.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/animal.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/animal.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/animal.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/api_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/api_response.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/api_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_all_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_one_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_req_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/apple_variant1.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/apple_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_of_number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_of_number_only.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_of_number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/array_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/array_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_all_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_one_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/banana_req_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/banana_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_create.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_create.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_create.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/bar_ref_or_value.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/bar_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/capitalization.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/capitalization.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/capitalization.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/cat.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/cat.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/cat.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/category.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/category.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/category.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/class_model.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/class_model.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/class_model.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/deprecated_object.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/deprecated_object.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/deprecated_object.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_type_incorrect.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/disc_type_incorrect.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/disc_type_incorrect.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/dog.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/dog.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/dog.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/entity.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/entity.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/entity_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/entity_ref.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/entity_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_arrays.dart similarity index 88% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_arrays.dart index a97d069a3d25..f941a9318135 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_arrays.dart @@ -70,22 +70,22 @@ class EnumArrays { enum EnumArraysJustSymbolEnum { - @JsonValue(r'>=') + @JsonValue(rr'>=') greaterThanEqual, - @JsonValue(r'$') + @JsonValue(rr'$') dollar, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumArraysArrayEnumEnum { - @JsonValue(r'fish') + @JsonValue(rr'fish') fish, - @JsonValue(r'crab') + @JsonValue(rr'crab') crab, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_test.dart similarity index 92% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_test.dart index 80555c14d038..84026da5d834 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/enum_test.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/enum_test.dart @@ -170,26 +170,26 @@ class EnumTest { enum EnumTestEnumStringEnum { - @JsonValue(r'UPPER') + @JsonValue(rr'UPPER') UPPER, - @JsonValue(r'lower') + @JsonValue(rr'lower') lower, - @JsonValue(r'') + @JsonValue(rr'') empty, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } enum EnumTestEnumStringRequiredEnum { - @JsonValue(r'UPPER') + @JsonValue(rr'UPPER') UPPER, - @JsonValue(r'lower') + @JsonValue(rr'lower') lower, - @JsonValue(r'') + @JsonValue(rr'') empty, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } @@ -207,11 +207,11 @@ enum EnumTestEnumIntegerEnum { enum EnumTestEnumNumberEnum { - @JsonValue('1.1') + @JsonValue(r'1.1') number1Period1, - @JsonValue('-1.2') + @JsonValue(r'-1.2') numberNegative1Period2, - @JsonValue('11184809') + @JsonValue(r'11184809') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/extensible.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/extensible.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/extensible.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/file_schema_test_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/file_schema_test_class.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/file_schema_test_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_ref.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_ref.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_ref_or_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/foo_ref_or_value.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/foo_ref_or_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/format_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/format_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/format_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_req_disc.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_req_disc.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_req_disc.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_type.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_type.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_type.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/fruit_variant1.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/fruit_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/giga_one_of.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/giga_one_of.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/giga_one_of.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/grape_variant1.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/grape_variant1.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/grape_variant1.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/has_only_read_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/has_only_read_only.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/has_only_read_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/health_check_result.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/health_check_result.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/health_check_result.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/map_test.dart similarity index 95% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/map_test.dart index 7ab19eabd5cd..b75b1684cb54 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/map_test.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/map_test.dart @@ -102,11 +102,11 @@ class MapTest { enum MapTestMapOfEnumStringEnum { - @JsonValue(r'UPPER') + @JsonValue(rr'UPPER') UPPER, - @JsonValue(r'lower') + @JsonValue(rr'lower') lower, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model200_response.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model200_response.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model200_response.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_client.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_client.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_client.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_enum_class.dart similarity index 67% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_enum_class.dart index 8abf107d98e6..060dbc5695d0 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_enum_class.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_enum_class.dart @@ -7,12 +7,12 @@ import 'package:json_annotation/json_annotation.dart'; enum ModelEnumClass { - @JsonValue(r'_abc') + @JsonValue(rr'_abc') abc, - @JsonValue(r'-efg') + @JsonValue(rr'-efg') efg, - @JsonValue(r'(xyz)') + @JsonValue(rr'(xyz)') leftParenthesisXyzRightParenthesis, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_file.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_file.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_file.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_list.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_list.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_list.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_return.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/model_return.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/model_return.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/name.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/nullable_class.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/nullable_class.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/nullable_class.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/number_only.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/number_only.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/number_only.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/one_of_primitive_child.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/one_of_primitive_child.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/one_of_primitive_child.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/order.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/order.dart index 54134b511316..7ddd2257c5bb 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/order.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/order.dart @@ -135,13 +135,13 @@ class Order { /// Order Status enum OrderStatusEnum { - @JsonValue(r'placed') + @JsonValue(rr'placed') placed, - @JsonValue(r'approved') + @JsonValue(rr'approved') approved, - @JsonValue(r'delivered') + @JsonValue(rr'delivered') delivered, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_composite.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_composite.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_composite.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum.dart similarity index 63% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum.dart index 514507968c66..fb9eb9e15efd 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum.dart @@ -7,12 +7,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnum { - @JsonValue(r'placed') + @JsonValue(rr'placed') placed, - @JsonValue(r'approved') + @JsonValue(rr'approved') approved, - @JsonValue(r'delivered') + @JsonValue(rr'delivered') delivered, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_default_value.dart similarity index 65% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_default_value.dart index 0c8116edea96..0b99109f2cd3 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_default_value.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_default_value.dart @@ -7,12 +7,12 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumDefaultValue { - @JsonValue(r'placed') + @JsonValue(rr'placed') placed, - @JsonValue(r'approved') + @JsonValue(rr'approved') approved, - @JsonValue(r'delivered') + @JsonValue(rr'delivered') delivered, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_integer.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_integer.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/parent.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/parent.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/parent.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pasta.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pasta.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pasta.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pet.dart similarity index 94% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pet.dart index 28d6294bae59..d502d8d1d0a2 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pet.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pet.dart @@ -137,13 +137,13 @@ class Pet { /// pet status in the store enum PetStatusEnum { - @JsonValue(r'available') + @JsonValue(rr'available') available, - @JsonValue(r'pending') + @JsonValue(rr'pending') pending, - @JsonValue(r'sold') + @JsonValue(rr'sold') sold, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pizza.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pizza.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pizza_speziale.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/pizza_speziale.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/pizza_speziale.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/read_only_first.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/read_only_first.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/read_only_first.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/single_ref_type.dart similarity index 69% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/single_ref_type.dart index ca56d9841a5a..3bee8c68c1be 100644 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/single_ref_type.dart +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/single_ref_type.dart @@ -7,10 +7,10 @@ import 'package:json_annotation/json_annotation.dart'; enum SingleRefType { - @JsonValue(r'admin') + @JsonValue(rr'admin') admin, - @JsonValue(r'user') + @JsonValue(rr'user') user, - @JsonValue(r'unknown_default_open_api') + @JsonValue(rr'unknown_default_open_api') unknownDefaultOpenApi, } diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/special_model_name.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/special_model_name.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/special_model_name.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/tag.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/tag.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/tag.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/model/user.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/model/user.dart rename to samples/client/echo_api/dart/dio/json_serializable/lib/src/model/user.dart diff --git a/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_base.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_base.dart new file mode 100644 index 000000000000..c4c2def37aa6 --- /dev/null +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_base.dart @@ -0,0 +1,58 @@ +/// The general rule for implementing this class is +/// json == serialize(deserialize(json)) +/// object == deserialize(serialize(object)) +/// Where json in this context means a dart primitive +/// JSON = String | num | bool | null | Uint8List | List | Map +abstract class SerializationRepositoryBase { + const SerializationRepositoryBase(); + + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); +} + +/// A modified version of `built_value`'s `FullType` class, found here +/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart +/// It holds type information known by the spec (including generic type parameters) +class TypeInfo { + final Type root; + final bool nullable; + final List parameters; + + /// The [Object] type. + static const TypeInfo object = TypeInfo(Object); + + const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; + const TypeInfo.nullable(this.root, [this.parameters = const []]) : nullable = true; + + @override + bool operator ==(dynamic other) { + if (identical(other, this)) return true; + if (other is! TypeInfo) return false; + if (root != other.root) return false; + if (nullable != other.nullable) return false; + if (parameters.length != other.parameters.length) return false; + for (var i = 0; i != parameters.length; ++i) { + if (parameters[i] != other.parameters[i]) return false; + } + return true; + } + + @override + int get hashCode { + return Object.hash(root, Object.hashAll(parameters), nullable); + } + + @override + String toString() => (parameters.isEmpty + ? _getRawName(root) + : '${_getRawName(root)}<${parameters.join(", ")}>') + + _nullabilitySuffix; + + String get _nullabilitySuffix => nullable ? '?' : ''; + + static String _getRawName(Type? type) { + var name = type.toString(); + var genericsStart = name.indexOf('<'); + return genericsStart == -1 ? name : name.substring(0, genericsStart); + } +} diff --git a/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_impl.dart b/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_impl.dart new file mode 100644 index 000000000000..b07401f2f3a9 --- /dev/null +++ b/samples/client/echo_api/dart/dio/json_serializable/lib/src/repository_impl.dart @@ -0,0 +1,315 @@ +import 'dart:convert'; +import 'dart:typed_data'; +import 'repository_base.dart'; +import 'package:openapi/models.dart'; + +class JsonSerializableRepository extends SerializationRepositoryBase { + JsonSerializableRepository(); + + /// Transforms an object of arbitrary type [T] (whose information is passed in inputTypeInfo) to a dart primitive + @override + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context}) { + if (src == null) { + return null; + } + if (src is String) { + return src; + } + if (src is bool) { + return src; + } + if (src is DateTime) { + return src.toIso8601String(); + } + if (src is num) { + return src; + } + if (src is Uint8List) { + return src; + } + if (src is Iterable) { + return src.map((value) => serialize(value, inputTypeInfo.parameters[0], context: context)).toList(); + } + if (src is Map) { + return src.map((key,value) => MapEntry( + //Json Map keys must always be strings + serialize(key, inputTypeInfo.parameters[0], context: context).toString(), + serialize(value, inputTypeInfo.parameters[1], context: context) + )); + } + + if (context is Object? Function(Object?)) { + return context(src); + } + + try { + return (src as dynamic).toJson(); + } on NoSuchMethodError { + assert(false, + ''' + Failed to serialize the object properly, falling back to `toString()` + '''); + return src.toString(); + } + } + + /// Transforms a dart primitive to an object of arbitrary type [T] (whose information is passed in inputTypeInfo) + @override + T deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { + //Don't rely on T being accurate here, since it won't get passed for generic arguments. + if (value == null) { + return null as T; + } + final targetRootType = targetTypeInfo.root; + if (targetRootType == T) { + //short circuit if we already have the output as the input + return value as T; + } + switch (targetRootType) { + case String: + return value.toString() as T; + case double: + return (value is num ? value.toDouble() : double.tryParse(value.toString())) as T; + case int: + return (value is num ? value.toInt() : int.tryParse(value.toString())) as T; + case num: + return (value is num ? value : num.tryParse(value.toString())) as T; + case bool: + return (value is bool ? value : bool.tryParse(value.toString())) as T; + case DateTime: + return (value is DateTime ? value : DateTime.tryParse(value.toString())) as T; + case Iterable: + case List: + case Set: + if (value is! Iterable) { + throw Exception('Cannot deserialize'); + } + final mappedItems = value.map((v) => deserialize(v, targetTypeInfo.parameters[0], context: context)); + if (targetRootType == List) { + return List.from(mappedItems); + } else if (targetRootType == Set) { + return Set.from(mappedItems); + } else if (targetRootType == Iterable) { + return mappedItems; + } else { + throw Exception('Cannot deserialize'); + } + case Map: + if (value is! Map) { + throw Exception('Cannot deserialize'); + } + return value.map((k,v) => MapEntry(deserialize(k, targetTypeInfo.parameters[0], context: context),deserialize(v, targetTypeInfo.parameters[1], context: context))); + case AdditionalPropertiesClass: + return AdditionalPropertiesClass.fromJson(value as Map) as T; + case Addressable: + return Addressable.fromJson(value as Map) as T; + case AllOfWithSingleRef: + return AllOfWithSingleRef.fromJson(value as Map) as T; + case Animal: + return Animal.fromJson(value as Map) as T; + case ApiResponse: + return ApiResponse.fromJson(value as Map) as T; + case Apple: + return Apple.fromJson(value as Map) as T; + case AppleAllOfDisc: + return AppleAllOfDisc.fromJson(value as Map) as T; + case AppleGrandparentDisc: + return AppleGrandparentDisc.fromJson(value as Map) as T; + case AppleOneOfDisc: + return AppleOneOfDisc.fromJson(value as Map) as T; + case AppleReqDisc: + return AppleReqDisc.fromJson(value as Map) as T; + case AppleVariant1: + return AppleVariant1.fromJson(value as Map) as T; + case ArrayOfArrayOfNumberOnly: + return ArrayOfArrayOfNumberOnly.fromJson(value as Map) as T; + case ArrayOfNumberOnly: + return ArrayOfNumberOnly.fromJson(value as Map) as T; + case ArrayTest: + return ArrayTest.fromJson(value as Map) as T; + case Banana: + return Banana.fromJson(value as Map) as T; + case BananaAllOfDisc: + return BananaAllOfDisc.fromJson(value as Map) as T; + case BananaGrandparentDisc: + return BananaGrandparentDisc.fromJson(value as Map) as T; + case BananaOneOfDisc: + return BananaOneOfDisc.fromJson(value as Map) as T; + case BananaReqDisc: + return BananaReqDisc.fromJson(value as Map) as T; + case Bar: + return Bar.fromJson(value as Map) as T; + case BarCreate: + return BarCreate.fromJson(value as Map) as T; + case BarRef: + return BarRef.fromJson(value as Map) as T; + case BarRefOrValue: + return BarRefOrValue.fromJson(value as Map) as T; + case Capitalization: + return Capitalization.fromJson(value as Map) as T; + case Cat: + return Cat.fromJson(value as Map) as T; + case Category: + return Category.fromJson(value as Map) as T; + case ClassModel: + return ClassModel.fromJson(value as Map) as T; + case ComposedDiscMissingFromProperties: + return ComposedDiscMissingFromProperties.fromJson(value as Map) as T; + case ComposedDiscOptionalTypeCorrect: + return ComposedDiscOptionalTypeCorrect.fromJson(value as Map) as T; + case ComposedDiscOptionalTypeInconsistent: + return ComposedDiscOptionalTypeInconsistent.fromJson(value as Map) as T; + case ComposedDiscOptionalTypeIncorrect: + return ComposedDiscOptionalTypeIncorrect.fromJson(value as Map) as T; + case ComposedDiscRequiredInconsistent: + return ComposedDiscRequiredInconsistent.fromJson(value as Map) as T; + case ComposedDiscTypeInconsistent: + return ComposedDiscTypeInconsistent.fromJson(value as Map) as T; + case ComposedDiscTypeIncorrect: + return ComposedDiscTypeIncorrect.fromJson(value as Map) as T; + case DeprecatedObject: + return DeprecatedObject.fromJson(value as Map) as T; + case DiscMissingFromProperties: + return DiscMissingFromProperties.fromJson(value as Map) as T; + case DiscOptionalTypeCorrect: + return DiscOptionalTypeCorrect.fromJson(value as Map) as T; + case DiscOptionalTypeIncorrect: + return DiscOptionalTypeIncorrect.fromJson(value as Map) as T; + case DiscTypeIncorrect: + return DiscTypeIncorrect.fromJson(value as Map) as T; + case Dog: + return Dog.fromJson(value as Map) as T; + case Entity: + return Entity.fromJson(value as Map) as T; + case EntityRef: + return EntityRef.fromJson(value as Map) as T; + case EnumArrays: + return EnumArrays.fromJson(value as Map) as T; + case EnumTest: + return EnumTest.fromJson(value as Map) as T; + case Extensible: + return Extensible.fromJson(value as Map) as T; + case FileSchemaTestClass: + return FileSchemaTestClass.fromJson(value as Map) as T; + case Foo: + return Foo.fromJson(value as Map) as T; + case FooBasicGetDefaultResponse: + return FooBasicGetDefaultResponse.fromJson(value as Map) as T; + case FooRef: + return FooRef.fromJson(value as Map) as T; + case FooRefOrValue: + return FooRefOrValue.fromJson(value as Map) as T; + case FormatTest: + return FormatTest.fromJson(value as Map) as T; + case Fruit: + return Fruit.fromJson(value as Map) as T; + case FruitAllOfDisc: + return FruitAllOfDisc.fromJson(value as Map) as T; + case FruitAnyOfDisc: + return FruitAnyOfDisc.fromJson(value as Map) as T; + case FruitGrandparentDisc: + return FruitGrandparentDisc.fromJson(value as Map) as T; + case FruitInlineDisc: + return FruitInlineDisc.fromJson(value as Map) as T; + case FruitInlineDiscOneOf: + return FruitInlineDiscOneOf.fromJson(value as Map) as T; + case FruitInlineDiscOneOf1: + return FruitInlineDiscOneOf1.fromJson(value as Map) as T; + case FruitInlineInlineDisc: + return FruitInlineInlineDisc.fromJson(value as Map) as T; + case FruitInlineInlineDiscOneOf: + return FruitInlineInlineDiscOneOf.fromJson(value as Map) as T; + case FruitInlineInlineDiscOneOf1: + return FruitInlineInlineDiscOneOf1.fromJson(value as Map) as T; + case FruitInlineInlineDiscOneOfOneOf: + return FruitInlineInlineDiscOneOfOneOf.fromJson(value as Map) as T; + case FruitOneOfDisc: + return FruitOneOfDisc.fromJson(value as Map) as T; + case FruitReqDisc: + return FruitReqDisc.fromJson(value as Map) as T; + case FruitType: + return FruitType.fromJson(value as Map) as T; + case FruitVariant1: + return FruitVariant1.fromJson(value as Map) as T; + case GigaOneOf: + return GigaOneOf.fromJson(value as Map) as T; + case GrapeVariant1: + return GrapeVariant1.fromJson(value as Map) as T; + case HasOnlyReadOnly: + return HasOnlyReadOnly.fromJson(value as Map) as T; + case HealthCheckResult: + return HealthCheckResult.fromJson(value as Map) as T; + case MapTest: + return MapTest.fromJson(value as Map) as T; + case MixedPropertiesAndAdditionalPropertiesClass: + return MixedPropertiesAndAdditionalPropertiesClass.fromJson(value as Map) as T; + case Model200Response: + return Model200Response.fromJson(value as Map) as T; + case ModelClient: + return ModelClient.fromJson(value as Map) as T; + case ModelEnumClass: + //TODO: find a way to support enums + return value as T; + case ModelFile: + return ModelFile.fromJson(value as Map) as T; + case ModelList: + return ModelList.fromJson(value as Map) as T; + case ModelReturn: + return ModelReturn.fromJson(value as Map) as T; + case Name: + return Name.fromJson(value as Map) as T; + case NullableClass: + return NullableClass.fromJson(value as Map) as T; + case NumberOnly: + return NumberOnly.fromJson(value as Map) as T; + case ObjectWithDeprecatedFields: + return ObjectWithDeprecatedFields.fromJson(value as Map) as T; + case OneOfPrimitiveChild: + return OneOfPrimitiveChild.fromJson(value as Map) as T; + case Order: + return Order.fromJson(value as Map) as T; + case OuterComposite: + return OuterComposite.fromJson(value as Map) as T; + case OuterEnum: + //TODO: find a way to support enums + return value as T; + case OuterEnumDefaultValue: + //TODO: find a way to support enums + return value as T; + case OuterEnumInteger: + //TODO: find a way to support enums + return value as T; + case OuterEnumIntegerDefaultValue: + //TODO: find a way to support enums + return value as T; + case OuterObjectWithEnumProperty: + return OuterObjectWithEnumProperty.fromJson(value as Map) as T; + case Parent: + return Parent.fromJson(value as Map) as T; + case Pasta: + return Pasta.fromJson(value as Map) as T; + case Pet: + return Pet.fromJson(value as Map) as T; + case Pizza: + return Pizza.fromJson(value as Map) as T; + case PizzaSpeziale: + return PizzaSpeziale.fromJson(value as Map) as T; + case ReadOnlyFirst: + return ReadOnlyFirst.fromJson(value as Map) as T; + case SingleRefType: + //TODO: find a way to support enums + return value as T; + case SpecialModelName: + return SpecialModelName.fromJson(value as Map) as T; + case Tag: + return Tag.fromJson(value as Map) as T; + case User: + return User.fromJson(value as Map) as T; + default: + if (value is T) { + return value; + } + throw Exception('Cannot deserialize'); + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml b/samples/client/echo_api/dart/dio/json_serializable/pom.xml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/pom.xml rename to samples/client/echo_api/dart/dio/json_serializable/pom.xml diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/pubspec.yaml b/samples/client/echo_api/dart/dio/json_serializable/pubspec.yaml similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/pubspec.yaml rename to samples/client/echo_api/dart/dio/json_serializable/pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/additional_properties_class_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/addressable_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/addressable_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/addressable_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/addressable_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/all_of_with_single_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/all_of_with_single_ref_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/all_of_with_single_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/animal_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/animal_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/animal_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/animal_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/another_fake_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/another_fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/another_fake_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/another_fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/api_response_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/api_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/api_response_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/api_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_req_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_req_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_variant1_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/apple_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/apple_variant1_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/apple_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/array_of_array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_array_of_number_only_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/array_of_array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/array_of_number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_of_number_only_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/array_of_number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_test_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/array_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/array_test_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/array_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/banana_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/banana_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/banana_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/banana_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/banana_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/banana_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_req_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/banana_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_req_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/banana_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/banana_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/banana_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/banana_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/bar_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/bar_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_create_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/bar_create_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_create_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/bar_create_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/bar_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_or_value_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/bar_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/bar_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_ref_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/bar_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/bar_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/bar_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/bar_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/capitalization_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/capitalization_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/capitalization_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/capitalization_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/cat_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/cat_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/cat_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/cat_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/category_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/category_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/category_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/category_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/class_model_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/class_model_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/class_model_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/class_model_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/composed_disc_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/composed_disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/default_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/default_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/default_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/default_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/deprecated_object_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/deprecated_object_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/deprecated_object_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/disc_missing_from_properties_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_missing_from_properties_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/disc_missing_from_properties_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/disc_optional_type_correct_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_correct_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/disc_optional_type_correct_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/disc_optional_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_optional_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/disc_optional_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/disc_type_incorrect_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/disc_type_incorrect_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/disc_type_incorrect_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/dog_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/dog_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/dog_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/dog_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_ref_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/entity_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_ref_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/entity_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/entity_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/entity_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/entity_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/enum_arrays_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_arrays_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/enum_arrays_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_test_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/enum_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/enum_test_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/enum_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/extensible_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/extensible_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/extensible_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/extensible_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fake_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fake_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_classname_tags123_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fake_classname_tags123_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fake_classname_tags123_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fake_classname_tags123_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/file_schema_test_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/file_schema_test_class_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/file_schema_test_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/foo_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/foo_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_basic_get_default_response_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/foo_basic_get_default_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_basic_get_default_response_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/foo_basic_get_default_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/foo_ref_or_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_or_value_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/foo_ref_or_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/foo_ref_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_ref_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/foo_ref_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/foo_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/foo_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/foo_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/format_test_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/format_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/format_test_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/format_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_all_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_all_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_all_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_any_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_any_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_any_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_grandparent_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_grandparent_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_grandparent_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_inline_inline_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_inline_inline_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_one_of_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_one_of_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_one_of_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_req_disc_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_req_disc_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_req_disc_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_type_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_type_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_variant1_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/fruit_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/fruit_variant1_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/fruit_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/giga_one_of_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/giga_one_of_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/giga_one_of_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/giga_one_of_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/grape_variant1_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/grape_variant1_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/grape_variant1_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/grape_variant1_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/has_only_read_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/has_only_read_only_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/has_only_read_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/health_check_result_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/health_check_result_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/health_check_result_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/health_check_result_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/map_test_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/map_test_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/map_test_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/map_test_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model200_response_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model200_response_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model200_response_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model200_response_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_client_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model_client_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_client_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model_client_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model_enum_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_enum_class_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model_enum_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_file_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model_file_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_file_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model_file_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_list_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model_list_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_list_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model_list_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_return_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/model_return_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/model_return_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/model_return_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/name_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/name_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/name_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/nullable_class_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/nullable_class_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/nullable_class_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/nullable_class_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/number_only_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/number_only_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/number_only_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/number_only_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/object_with_deprecated_fields_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/object_with_deprecated_fields_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/object_with_deprecated_fields_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/one_of_primitive_child_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/one_of_primitive_child_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/one_of_primitive_child_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/order_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/order_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/order_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/order_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_composite_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_composite_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_composite_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_composite_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_default_value_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_integer_default_value_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_default_value_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_integer_default_value_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_integer_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_integer_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_integer_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_enum_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_enum_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/outer_object_with_enum_property_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/outer_object_with_enum_property_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/outer_object_with_enum_property_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/parent_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/parent_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/parent_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/parent_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pasta_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/pasta_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pasta_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/pasta_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/pet_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/pet_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/pet_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pet_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/pet_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/pizza_speziale_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_speziale_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/pizza_speziale_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/pizza_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/pizza_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/pizza_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/read_only_first_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/read_only_first_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/read_only_first_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/read_only_first_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/single_ref_type_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/single_ref_type_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/single_ref_type_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/special_model_name_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/special_model_name_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/special_model_name_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/special_model_name_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/store_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/store_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/store_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/store_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/tag_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/tag_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/tag_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/tag_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_api_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/user_api_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_api_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/user_api_test.dart diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_test.dart b/samples/client/echo_api/dart/dio/json_serializable/test/user_test.dart similarity index 100% rename from samples/openapi3/client/petstore/dart-next/dio/json_serializable/test/user_test.dart rename to samples/client/echo_api/dart/dio/json_serializable/test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES deleted file mode 100644 index 6ca871272518..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/.openapi-generator/FILES +++ /dev/null @@ -1,341 +0,0 @@ -.gitignore -.openapi-generator-ignore -README.md -analysis_options.yaml -build.yaml -doc/AdditionalPropertiesClass.md -doc/Addressable.md -doc/AllOfWithSingleRef.md -doc/Animal.md -doc/AnotherFakeApi.md -doc/ApiResponse.md -doc/Apple.md -doc/AppleAllOfDisc.md -doc/AppleGrandparentDisc.md -doc/AppleOneOfDisc.md -doc/AppleReqDisc.md -doc/AppleVariant1.md -doc/ArrayOfArrayOfNumberOnly.md -doc/ArrayOfNumberOnly.md -doc/ArrayTest.md -doc/Banana.md -doc/BananaAllOfDisc.md -doc/BananaGrandparentDisc.md -doc/BananaOneOfDisc.md -doc/BananaReqDisc.md -doc/Bar.md -doc/BarApi.md -doc/BarCreate.md -doc/BarRef.md -doc/BarRefOrValue.md -doc/Capitalization.md -doc/Cat.md -doc/Category.md -doc/ClassModel.md -doc/ComposedDiscMissingFromProperties.md -doc/ComposedDiscOptionalTypeCorrect.md -doc/ComposedDiscOptionalTypeInconsistent.md -doc/ComposedDiscOptionalTypeIncorrect.md -doc/ComposedDiscRequiredInconsistent.md -doc/ComposedDiscTypeInconsistent.md -doc/ComposedDiscTypeIncorrect.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/DiscMissingFromProperties.md -doc/DiscOptionalTypeCorrect.md -doc/DiscOptionalTypeIncorrect.md -doc/DiscTypeIncorrect.md -doc/Dog.md -doc/Entity.md -doc/EntityRef.md -doc/EnumArrays.md -doc/EnumTest.md -doc/Extensible.md -doc/FakeApi.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FooApi.md -doc/FooBasicGetDefaultResponse.md -doc/FooRef.md -doc/FooRefOrValue.md -doc/FormatTest.md -doc/Fruit.md -doc/FruitAllOfDisc.md -doc/FruitAnyOfDisc.md -doc/FruitGrandparentDisc.md -doc/FruitInlineDisc.md -doc/FruitInlineDiscOneOf.md -doc/FruitInlineDiscOneOf1.md -doc/FruitInlineInlineDisc.md -doc/FruitInlineInlineDiscOneOf.md -doc/FruitInlineInlineDiscOneOf1.md -doc/FruitInlineInlineDiscOneOfOneOf.md -doc/FruitOneOfDisc.md -doc/FruitReqDisc.md -doc/FruitType.md -doc/FruitVariant1.md -doc/GigaOneOf.md -doc/GrapeVariant1.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.md -doc/MapTest.md -doc/MixedPropertiesAndAdditionalPropertiesClass.md -doc/Model200Response.md -doc/ModelClient.md -doc/ModelEnumClass.md -doc/ModelFile.md -doc/ModelList.md -doc/ModelReturn.md -doc/Name.md -doc/NullableClass.md -doc/NumberOnly.md -doc/ObjectWithDeprecatedFields.md -doc/OneOfPrimitiveChild.md -doc/Order.md -doc/OuterComposite.md -doc/OuterEnum.md -doc/OuterEnumDefaultValue.md -doc/OuterEnumInteger.md -doc/OuterEnumIntegerDefaultValue.md -doc/OuterObjectWithEnumProperty.md -doc/Parent.md -doc/Pasta.md -doc/Pet.md -doc/PetApi.md -doc/Pizza.md -doc/PizzaSpeziale.md -doc/ReadOnlyFirst.md -doc/SingleRefType.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/User.md -doc/UserApi.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/another_fake_api.dart -lib/src/api/bar_api.dart -lib/src/api/default_api.dart -lib/src/api/fake_api.dart -lib/src/api/fake_classname_tags123_api.dart -lib/src/api/foo_api.dart -lib/src/api/pet_api.dart -lib/src/api/store_api.dart -lib/src/api/user_api.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/deserialize.dart -lib/src/model/additional_properties_class.dart -lib/src/model/addressable.dart -lib/src/model/all_of_with_single_ref.dart -lib/src/model/animal.dart -lib/src/model/api_response.dart -lib/src/model/apple.dart -lib/src/model/apple_all_of_disc.dart -lib/src/model/apple_grandparent_disc.dart -lib/src/model/apple_one_of_disc.dart -lib/src/model/apple_req_disc.dart -lib/src/model/apple_variant1.dart -lib/src/model/array_of_array_of_number_only.dart -lib/src/model/array_of_number_only.dart -lib/src/model/array_test.dart -lib/src/model/banana.dart -lib/src/model/banana_all_of_disc.dart -lib/src/model/banana_grandparent_disc.dart -lib/src/model/banana_one_of_disc.dart -lib/src/model/banana_req_disc.dart -lib/src/model/bar.dart -lib/src/model/bar_create.dart -lib/src/model/bar_ref.dart -lib/src/model/bar_ref_or_value.dart -lib/src/model/capitalization.dart -lib/src/model/cat.dart -lib/src/model/category.dart -lib/src/model/class_model.dart -lib/src/model/composed_disc_missing_from_properties.dart -lib/src/model/composed_disc_optional_type_correct.dart -lib/src/model/composed_disc_optional_type_inconsistent.dart -lib/src/model/composed_disc_optional_type_incorrect.dart -lib/src/model/composed_disc_required_inconsistent.dart -lib/src/model/composed_disc_type_inconsistent.dart -lib/src/model/composed_disc_type_incorrect.dart -lib/src/model/deprecated_object.dart -lib/src/model/disc_missing_from_properties.dart -lib/src/model/disc_optional_type_correct.dart -lib/src/model/disc_optional_type_incorrect.dart -lib/src/model/disc_type_incorrect.dart -lib/src/model/dog.dart -lib/src/model/entity.dart -lib/src/model/entity_ref.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/extensible.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/foo_basic_get_default_response.dart -lib/src/model/foo_ref.dart -lib/src/model/foo_ref_or_value.dart -lib/src/model/format_test.dart -lib/src/model/fruit.dart -lib/src/model/fruit_all_of_disc.dart -lib/src/model/fruit_any_of_disc.dart -lib/src/model/fruit_grandparent_disc.dart -lib/src/model/fruit_inline_disc.dart -lib/src/model/fruit_inline_disc_one_of.dart -lib/src/model/fruit_inline_disc_one_of1.dart -lib/src/model/fruit_inline_inline_disc.dart -lib/src/model/fruit_inline_inline_disc_one_of.dart -lib/src/model/fruit_inline_inline_disc_one_of1.dart -lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart -lib/src/model/fruit_one_of_disc.dart -lib/src/model/fruit_req_disc.dart -lib/src/model/fruit_type.dart -lib/src/model/fruit_variant1.dart -lib/src/model/giga_one_of.dart -lib/src/model/grape_variant1.dart -lib/src/model/has_only_read_only.dart -lib/src/model/health_check_result.dart -lib/src/model/map_test.dart -lib/src/model/mixed_properties_and_additional_properties_class.dart -lib/src/model/model200_response.dart -lib/src/model/model_client.dart -lib/src/model/model_enum_class.dart -lib/src/model/model_file.dart -lib/src/model/model_list.dart -lib/src/model/model_return.dart -lib/src/model/name.dart -lib/src/model/nullable_class.dart -lib/src/model/number_only.dart -lib/src/model/object_with_deprecated_fields.dart -lib/src/model/one_of_primitive_child.dart -lib/src/model/order.dart -lib/src/model/outer_composite.dart -lib/src/model/outer_enum.dart -lib/src/model/outer_enum_default_value.dart -lib/src/model/outer_enum_integer.dart -lib/src/model/outer_enum_integer_default_value.dart -lib/src/model/outer_object_with_enum_property.dart -lib/src/model/parent.dart -lib/src/model/pasta.dart -lib/src/model/pet.dart -lib/src/model/pizza.dart -lib/src/model/pizza_speziale.dart -lib/src/model/read_only_first.dart -lib/src/model/single_ref_type.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/user.dart -pubspec.yaml -test/additional_properties_class_test.dart -test/addressable_test.dart -test/all_of_with_single_ref_test.dart -test/animal_test.dart -test/another_fake_api_test.dart -test/api_response_test.dart -test/apple_all_of_disc_test.dart -test/apple_grandparent_disc_test.dart -test/apple_one_of_disc_test.dart -test/apple_req_disc_test.dart -test/apple_test.dart -test/apple_variant1_test.dart -test/array_of_array_of_number_only_test.dart -test/array_of_number_only_test.dart -test/array_test_test.dart -test/banana_all_of_disc_test.dart -test/banana_grandparent_disc_test.dart -test/banana_one_of_disc_test.dart -test/banana_req_disc_test.dart -test/banana_test.dart -test/bar_api_test.dart -test/bar_create_test.dart -test/bar_ref_or_value_test.dart -test/bar_ref_test.dart -test/bar_test.dart -test/capitalization_test.dart -test/cat_test.dart -test/category_test.dart -test/class_model_test.dart -test/composed_disc_missing_from_properties_test.dart -test/composed_disc_optional_type_correct_test.dart -test/composed_disc_optional_type_inconsistent_test.dart -test/composed_disc_optional_type_incorrect_test.dart -test/composed_disc_required_inconsistent_test.dart -test/composed_disc_type_inconsistent_test.dart -test/composed_disc_type_incorrect_test.dart -test/default_api_test.dart -test/deprecated_object_test.dart -test/disc_missing_from_properties_test.dart -test/disc_optional_type_correct_test.dart -test/disc_optional_type_incorrect_test.dart -test/disc_type_incorrect_test.dart -test/dog_test.dart -test/entity_ref_test.dart -test/entity_test.dart -test/enum_arrays_test.dart -test/enum_test_test.dart -test/extensible_test.dart -test/fake_api_test.dart -test/fake_classname_tags123_api_test.dart -test/file_schema_test_class_test.dart -test/foo_api_test.dart -test/foo_basic_get_default_response_test.dart -test/foo_ref_or_value_test.dart -test/foo_ref_test.dart -test/foo_test.dart -test/format_test_test.dart -test/fruit_all_of_disc_test.dart -test/fruit_any_of_disc_test.dart -test/fruit_grandparent_disc_test.dart -test/fruit_inline_disc_one_of1_test.dart -test/fruit_inline_disc_one_of_test.dart -test/fruit_inline_disc_test.dart -test/fruit_inline_inline_disc_one_of1_test.dart -test/fruit_inline_inline_disc_one_of_one_of_test.dart -test/fruit_inline_inline_disc_one_of_test.dart -test/fruit_inline_inline_disc_test.dart -test/fruit_one_of_disc_test.dart -test/fruit_req_disc_test.dart -test/fruit_test.dart -test/fruit_type_test.dart -test/fruit_variant1_test.dart -test/giga_one_of_test.dart -test/grape_variant1_test.dart -test/has_only_read_only_test.dart -test/health_check_result_test.dart -test/map_test_test.dart -test/mixed_properties_and_additional_properties_class_test.dart -test/model200_response_test.dart -test/model_client_test.dart -test/model_enum_class_test.dart -test/model_file_test.dart -test/model_list_test.dart -test/model_return_test.dart -test/name_test.dart -test/nullable_class_test.dart -test/number_only_test.dart -test/object_with_deprecated_fields_test.dart -test/one_of_primitive_child_test.dart -test/order_test.dart -test/outer_composite_test.dart -test/outer_enum_default_value_test.dart -test/outer_enum_integer_default_value_test.dart -test/outer_enum_integer_test.dart -test/outer_enum_test.dart -test/outer_object_with_enum_property_test.dart -test/parent_test.dart -test/pasta_test.dart -test/pet_api_test.dart -test/pet_test.dart -test/pizza_speziale_test.dart -test/pizza_test.dart -test/read_only_first_test.dart -test/single_ref_type_test.dart -test/special_model_name_test.dart -test/store_api_test.dart -test/tag_test.dart -test/user_api_test.dart -test/user_test.dart diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml deleted file mode 100644 index ac01482530cc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/analysis_options.yaml +++ /dev/null @@ -1,12 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart - - lib/src/model/*.g.dart - errors: - deprecated_member_use_from_same_package: ignore diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md deleted file mode 100644 index 863b8503db83..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AdditionalPropertiesClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md deleted file mode 100644 index 0fcd81b80382..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Addressable.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Addressable - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md deleted file mode 100644 index 4c6f3ab2fe11..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AllOfWithSingleRef.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AllOfWithSingleRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **String** | | [optional] -**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md deleted file mode 100644 index 36a94e6bb703..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AnotherFakeApi.md +++ /dev/null @@ -1,57 +0,0 @@ -# openapi.api.AnotherFakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -> ModelClient call123testSpecialTags(modelClient) - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.call123testSpecialTags(modelClient); - print(response); -} catch on DioException (e) { - print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md deleted file mode 100644 index 7ad5da0f89e4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md deleted file mode 100644 index c7f711b87cef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Apple.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Apple - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md deleted file mode 100644 index d98670235ee7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleAllOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleAllOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md deleted file mode 100644 index 312f1f7018d7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleGrandparentDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleGrandparentDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md deleted file mode 100644 index ff87dcf1d64f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleOneOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleOneOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md deleted file mode 100644 index 82a1f7c23bb0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleReqDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AppleReqDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md deleted file mode 100644 index d2ec2e148c15..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/AppleVariant1.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.AppleVariant1 - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index e5b9d669a436..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**List<List<num>>**](List.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md deleted file mode 100644 index fe8e071eb45c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **List<num>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md deleted file mode 100644 index 8ae11de10022..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ArrayTest.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ArrayTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] -**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md deleted file mode 100644 index bef8a58a4276..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Banana.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Banana - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **num** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md deleted file mode 100644 index 900115023298..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaAllOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaAllOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md deleted file mode 100644 index 5dad7cfe1342..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaGrandparentDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaGrandparentDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md deleted file mode 100644 index 8a66091712a1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaOneOfDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaOneOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md deleted file mode 100644 index 8ae3cdb5bdd0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BananaReqDisc.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.BananaReqDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md deleted file mode 100644 index 4cccc863a489..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Bar.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.Bar - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md deleted file mode 100644 index 270f62e266b1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarApi.md +++ /dev/null @@ -1,55 +0,0 @@ -# openapi.api.BarApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createBar**](BarApi.md#createbar) | **POST** /bar | Create a Bar - - -# **createBar** -> Bar createBar(barCreate) - -Create a Bar - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getBarApi(); -final BarCreate barCreate = ; // BarCreate | - -try { - final response = api.createBar(barCreate); - print(response); -} catch on DioException (e) { - print('Exception when calling BarApi->createBar: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **barCreate** | [**BarCreate**](BarCreate.md)| | - -### Return type - -[**Bar**](Bar.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md deleted file mode 100644 index c0b4ba6edc9a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarCreate.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.BarCreate - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md deleted file mode 100644 index 949695f4d36f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRef.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.BarRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md deleted file mode 100644 index 9dafa2d6b220..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/BarRefOrValue.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.BarRefOrValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md deleted file mode 100644 index 4a07b4eb820d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Capitalization.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Capitalization - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md deleted file mode 100644 index 13ae5d3a4708..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ClassModel.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ClassModel - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md deleted file mode 100644 index 2afd29ec62a8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscMissingFromProperties.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscMissingFromProperties - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md deleted file mode 100644 index ff9eb48e6345..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeCorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscOptionalTypeCorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md deleted file mode 100644 index 488fd83228a0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeInconsistent.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscOptionalTypeInconsistent - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md deleted file mode 100644 index 63d535bf9af2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscOptionalTypeIncorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscOptionalTypeIncorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md deleted file mode 100644 index 51d9e9cb31ee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscRequiredInconsistent.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscRequiredInconsistent - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md deleted file mode 100644 index 09a938fc20ee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeInconsistent.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscTypeInconsistent - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md deleted file mode 100644 index a3150835897a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ComposedDiscTypeIncorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ComposedDiscTypeIncorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **int** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md deleted file mode 100644 index 11f2e79e26f3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DefaultApi.md +++ /dev/null @@ -1,244 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooBasicGet**](DefaultApi.md#foobasicget) | **GET** /foo-basic | -[**list**](DefaultApi.md#list) | **GET** /oneof-primitive | -[**oneofGet**](DefaultApi.md#oneofget) | **GET** /oneof | -[**test**](DefaultApi.md#test) | **PUT** /variant1 | -[**variant1Get**](DefaultApi.md#variant1get) | **GET** /variant1 | -[**variant2Get**](DefaultApi.md#variant2get) | **GET** /variant2 | - - -# **fooBasicGet** -> FooBasicGetDefaultResponse fooBasicGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.fooBasicGet(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->fooBasicGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FooBasicGetDefaultResponse**](FooBasicGetDefaultResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list** -> GigaOneOf list() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.list(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->list: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**GigaOneOf**](GigaOneOf.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **oneofGet** -> Fruit oneofGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.oneofGet(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->oneofGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Fruit**](Fruit.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test** -> test(body) - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); -final Object body = ; // Object | - -try { - api.test(body); -} catch on DioException (e) { - print('Exception when calling DefaultApi->test: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Object**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **variant1Get** -> FruitVariant1 variant1Get() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.variant1Get(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->variant1Get: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FruitVariant1**](FruitVariant1.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **variant2Get** -> FruitAllOfDisc variant2Get() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.variant2Get(); - print(response); -} catch on DioException (e) { - print('Exception when calling DefaultApi->variant2Get: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**FruitAllOfDisc**](FruitAllOfDisc.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md deleted file mode 100644 index bf2ef67a26fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DeprecatedObject.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DeprecatedObject - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md deleted file mode 100644 index dc4b2ba0df92..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscMissingFromProperties.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DiscMissingFromProperties - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md deleted file mode 100644 index c52fb7051b0e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeCorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DiscOptionalTypeCorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md deleted file mode 100644 index 73d0af550f33..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscOptionalTypeIncorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DiscOptionalTypeIncorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md deleted file mode 100644 index 17d35da09631..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/DiscTypeIncorrect.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DiscTypeIncorrect - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **int** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md deleted file mode 100644 index 5ba2144b44fe..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Entity.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.Entity - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md deleted file mode 100644 index 80eae55f4145..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EntityRef.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.EntityRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md deleted file mode 100644 index 1d4fd1363b59..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumArrays.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.EnumArrays - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **List<String>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md deleted file mode 100644 index 7c24fe2347b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/EnumTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.EnumTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **int** | | [optional] -**enumNumber** | **double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md deleted file mode 100644 index 7a781e578ea4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Extensible.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Extensible - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md deleted file mode 100644 index adfc932207ca..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeApi.md +++ /dev/null @@ -1,816 +0,0 @@ -# openapi.api.FakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | - - -# **fakeHealthGet** -> HealthCheckResult fakeHealthGet() - -Health check endpoint - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeHealthGet(); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeHealthGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store -final String query1 = query1_example; // String | query parameter -final String header1 = header1_example; // String | header parameter - -try { - api.fakeHttpSignatureTest(pet, query1, header1); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterBooleanSerialize** -> bool fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final bool body = true; // bool | Input boolean as post body - -try { - final response = api.fakeOuterBooleanSerialize(body); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(outerComposite) - - - -Test serialization of object with outer number type - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body - -try { - final response = api.fakeOuterCompositeSerialize(outerComposite); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -> num fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final num body = 8.14; // num | Input number as post body - -try { - final response = api.fakeOuterNumberSerialize(body); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **num**| Input number as post body | [optional] - -### Return type - -**num** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String body = body_example; // String | Input string as post body - -try { - final response = api.fakeOuterStringSerialize(body); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakePropertyEnumIntegerSerialize** -> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) - - - -Test serialization of enum (int) properties with examples - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body - -try { - final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | - -### Return type - -[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithBinary** -> testBodyWithBinary(body) - - - -For this test, the body has to be a binary file. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload - -try { - api.testBodyWithBinary(body); -} catch on DioException (e) { - print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **MultipartFile**| image to upload | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: image/png - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request must reference a schema named `File`. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | - -try { - api.testBodyWithFileSchema(fileSchemaTestClass); -} catch on DioException (e) { - print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String query = query_example; // String | -final User user = ; // User | - -try { - api.testBodyWithQueryParams(query, user); -} catch on DioException (e) { - print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -> ModelClient testClientModel(modelClient) - -To test \"client\" model - -To test \"client\" model - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClientModel(modelClient); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeApi->testClientModel: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_basic_test -//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final num number = 8.14; // num | None -final double double_ = 1.2; // double | None -final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None -final String byte = BYTE_ARRAY_DATA_HERE; // String | None -final int integer = 56; // int | None -final int int32 = 56; // int | None -final int int64 = 789; // int | None -final double float = 3.4; // double | None -final String string = string_example; // String | None -final MultipartFile binary = BINARY_DATA_HERE; // MultipartFile | None -final DateTime date = 2013-10-20; // DateTime | None -final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None -final String password = password_example; // String | None -final String callback = callback_example; // String | None - -try { - api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); -} catch on DioException (e) { - print('Exception when calling FakeApi->testEndpointParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **num**| None | - **double_** | **double**| None | - **patternWithoutDelimiter** | **String**| None | - **byte** | **String**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **double**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **MultipartFile**| None | [optional] - **date** | **DateTime**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) - -To test enum parameters - -To test enum parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final List enumHeaderStringArray = ; // List | Header parameter enum test (string array) -final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) -final List enumQueryStringArray = ; // List | Query parameter enum test (string array) -final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) -final int enumQueryInteger = 56; // int | Query parameter enum test (double) -final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) -final List enumQueryModelArray = ; // List | -final List enumFormStringArray = ; // List | Form parameter enum test (string array) -final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) - -try { - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); -} catch on DioException (e) { - print('Exception when calling FakeApi->testEnumParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumQueryModelArray** | [**List<ModelEnumClass>**](ModelEnumClass.md)| | [optional] - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final int requiredStringGroup = 56; // int | Required String in group parameters -final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters -final int requiredInt64Group = 789; // int | Required Integer in group parameters -final int stringGroup = 56; // int | String in group parameters -final bool booleanGroup = true; // bool | Boolean in group parameters -final int int64Group = 789; // int | Integer in group parameters - -try { - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); -} catch on DioException (e) { - print('Exception when calling FakeApi->testGroupParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int**| Required String in group parameters | - **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | - **requiredInt64Group** | **int**| Required Integer in group parameters | - **stringGroup** | **int**| String in group parameters | [optional] - **booleanGroup** | **bool**| Boolean in group parameters | [optional] - **int64Group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final Map requestBody = ; // Map | request body - -try { - api.testInlineAdditionalProperties(requestBody); -} catch on DioException (e) { - print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**Map<String, String>**](String.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String param = param_example; // String | field1 -final String param2 = param2_example; // String | field2 - -try { - api.testJsonFormData(param, param2); -} catch on DioException (e) { - print('Exception when calling FakeApi->testJsonFormData: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) - - - -To test the collection format in query parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final List pipe = ; // List | -final List ioutil = ; // List | -final List http = ; // List | -final List url = ; // List | -final List context = ; // List | -final String allowEmpty = allowEmpty_example; // String | -final Map language = ; // Map | - -try { - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); -} catch on DioException (e) { - print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**List<String>**](String.md)| | - **ioutil** | [**List<String>**](String.md)| | - **http** | [**List<String>**](String.md)| | - **url** | [**List<String>**](String.md)| | - **context** | [**List<String>**](String.md)| | - **allowEmpty** | **String**| | - **language** | [**Map<String, String>**](String.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md deleted file mode 100644 index 645aebf399f0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FakeClassnameTags123Api.md +++ /dev/null @@ -1,61 +0,0 @@ -# openapi.api.FakeClassnameTags123Api - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -> ModelClient testClassname(modelClient) - -To test class name in snake case - -To test class name in snake case - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key_query -//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getFakeClassnameTags123Api(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClassname(modelClient); - print(response); -} catch on DioException (e) { - print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md deleted file mode 100644 index d14ac319d294..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FileSchemaTestClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FileSchemaTestClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**ModelFile**](ModelFile.md) | | [optional] -**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md deleted file mode 100644 index 2627691fefe5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Foo.md +++ /dev/null @@ -1,21 +0,0 @@ -# openapi.model.Foo - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fooPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md deleted file mode 100644 index 7bf731fc4bc7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooApi.md +++ /dev/null @@ -1,93 +0,0 @@ -# openapi.api.FooApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createFoo**](FooApi.md#createfoo) | **POST** /foo | Create a Foo -[**getAllFoos**](FooApi.md#getallfoos) | **GET** /foo | GET all Foos - - -# **createFoo** -> FooRefOrValue createFoo(foo) - -Create a Foo - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFooApi(); -final Foo foo = ; // Foo | The Foo to be created - -try { - final response = api.createFoo(foo); - print(response); -} catch on DioException (e) { - print('Exception when calling FooApi->createFoo: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **foo** | [**Foo**](Foo.md)| The Foo to be created | [optional] - -### Return type - -[**FooRefOrValue**](FooRefOrValue.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json;charset=utf-8 - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getAllFoos** -> List getAllFoos() - -GET all Foos - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFooApi(); - -try { - final response = api.getAllFoos(); - print(response); -} catch on DioException (e) { - print('Exception when calling FooApi->getAllFoos: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List<FooRefOrValue>**](FooRefOrValue.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json;charset=utf-8 - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md deleted file mode 100644 index 491b64c42f00..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooBasicGetDefaultResponse.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FooBasicGetDefaultResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md deleted file mode 100644 index 68104b227292..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRef.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.FooRef - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**foorefPropA** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md deleted file mode 100644 index 35e9fd114e1d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FooRefOrValue.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.FooRefOrValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md deleted file mode 100644 index 83b60545eb61..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FormatTest.md +++ /dev/null @@ -1,30 +0,0 @@ -# openapi.model.FormatTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **num** | | -**float** | **double** | | [optional] -**double_** | **double** | | [optional] -**decimal** | **double** | | [optional] -**string** | **String** | | [optional] -**byte** | **String** | | -**binary** | [**MultipartFile**](MultipartFile.md) | | [optional] -**date** | [**DateTime**](DateTime.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | -**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md deleted file mode 100644 index 5d48cc6e6d38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Fruit.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Fruit - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **String** | | [optional] -**kind** | **String** | | [optional] -**count** | **num** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md deleted file mode 100644 index 733363dbb42e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAllOfDisc.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitAllOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md deleted file mode 100644 index 537c0e0ab862..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitAnyOfDisc.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitAnyOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md deleted file mode 100644 index bfd888c625ea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitGrandparentDisc.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitGrandparentDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md deleted file mode 100644 index 40f58d8fa57e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDisc.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.FruitInlineDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | -**length** | **int** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md deleted file mode 100644 index 68bdac19308a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FruitInlineDiscOneOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md deleted file mode 100644 index 249b1c05ea20..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineDiscOneOf1.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FruitInlineDiscOneOf1 - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md deleted file mode 100644 index e56f0b56b949..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDisc.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitInlineInlineDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md deleted file mode 100644 index 0b69ee93ffb0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FruitInlineInlineDiscOneOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md deleted file mode 100644 index 3d00114f2a21..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOf1.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FruitInlineInlineDiscOneOf1 - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**length** | **int** | | -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md deleted file mode 100644 index 4729a639a999..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitInlineInlineDiscOneOfOneOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitInlineInlineDiscOneOfOneOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md deleted file mode 100644 index d081ec443559..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitOneOfDisc.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitOneOfDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md deleted file mode 100644 index 4fb7b6024403..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitReqDisc.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.FruitReqDisc - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**seeds** | **int** | | -**fruitType** | **String** | | -**length** | **int** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md deleted file mode 100644 index b4a8adc49a0f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitType.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.FruitType - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md deleted file mode 100644 index 1a0f58f86cad..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/FruitVariant1.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FruitVariant1 - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **String** | | [optional] -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md deleted file mode 100644 index 269723b2a215..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GigaOneOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.GigaOneOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md deleted file mode 100644 index 4be2630f6f28..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/GrapeVariant1.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.GrapeVariant1 - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md deleted file mode 100644 index 32cae937155d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HasOnlyReadOnly.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.HasOnlyReadOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md deleted file mode 100644 index 4d6aeb75d965..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/HealthCheckResult.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.HealthCheckResult - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullableMessage** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md deleted file mode 100644 index 197fe780a25a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MapTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.MapTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapOfEnumString** | **Map<String, String>** | | [optional] -**directMap** | **Map<String, bool>** | | [optional] -**indirectMap** | **Map<String, bool>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 66d0d39c42be..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.MixedPropertiesAndAdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md deleted file mode 100644 index 5aa3fb97c32e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Model200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Model200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md deleted file mode 100644 index f7b922f4a398..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelClient.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelClient - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md deleted file mode 100644 index ebaafb44c7f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelEnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.ModelEnumClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md deleted file mode 100644 index 4be260e93f6e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelFile.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelFile - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md deleted file mode 100644 index 283aa1f6b711..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelList.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelList - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**n123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md deleted file mode 100644 index bc02df7a3692..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ModelReturn.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelReturn - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**return_** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md deleted file mode 100644 index 25f49ea946b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Name.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.Name - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snakeCase** | **int** | | [optional] -**property** | **String** | | [optional] -**n123number** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md deleted file mode 100644 index 70ac1091d417..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NullableClass.md +++ /dev/null @@ -1,26 +0,0 @@ -# openapi.model.NullableClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integerProp** | **int** | | [optional] -**numberProp** | **num** | | [optional] -**booleanProp** | **bool** | | [optional] -**stringProp** | **String** | | [optional] -**dateProp** | [**DateTime**](DateTime.md) | | [optional] -**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] -**arrayNullableProp** | **List<Object>** | | [optional] -**arrayAndItemsNullableProp** | **List<Object>** | | [optional] -**arrayItemsNullable** | **List<Object>** | | [optional] -**objectNullableProp** | **Map<String, Object>** | | [optional] -**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] -**objectItemsNullable** | **Map<String, Object>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md deleted file mode 100644 index d8096a3db37a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/NumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.NumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **num** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md deleted file mode 100644 index e0fa7b908d10..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ObjectWithDeprecatedFields.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.ObjectWithDeprecatedFields - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**id** | **num** | | [optional] -**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | [**List<Bar>**](Bar.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md deleted file mode 100644 index 9f9f05c6cfe2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OneOfPrimitiveChild.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.OneOfPrimitiveChild - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md deleted file mode 100644 index bde5ffe51a2c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**petId** | **int** | | [optional] -**quantity** | **int** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md deleted file mode 100644 index 04bab7eff5d1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterComposite.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.OuterComposite - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **num** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md deleted file mode 100644 index af62ad87ab2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnum - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md deleted file mode 100644 index c1bf8b0dec44..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md deleted file mode 100644 index 8c80a9e5c85f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumInteger.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumInteger - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index eb8b55d70249..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumIntegerDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md deleted file mode 100644 index eab2ae8f66b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/OuterObjectWithEnumProperty.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.OuterObjectWithEnumProperty - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md deleted file mode 100644 index a2ee8510cf68..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Parent.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Parent - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fruitType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md deleted file mode 100644 index 034ff420d323..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pasta.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pasta - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**vendor** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md deleted file mode 100644 index 3cd230bfb213..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **Set<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md deleted file mode 100644 index 5fc7fbd2657f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PetApi.md +++ /dev/null @@ -1,439 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.addPet(pet); -} catch on DioException (e) { - print('Exception when calling PetApi->addPet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | Pet id to delete -final String apiKey = apiKey_example; // String | - -try { - api.deletePet(petId, apiKey); -} catch on DioException (e) { - print('Exception when calling PetApi->deletePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> List findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final List status = ; // List | Status values that need to be considered for filter - -try { - final response = api.findPetsByStatus(status); - print(response); -} catch on DioException (e) { - print('Exception when calling PetApi->findPetsByStatus: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -> Set findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Set tags = ; // Set | Tags to filter by - -try { - final response = api.findPetsByTags(tags); - print(response); -} catch on DioException (e) { - print('Exception when calling PetApi->findPetsByTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**Set<String>**](String.md)| Tags to filter by | - -### Return type - -[**Set<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to return - -try { - final response = api.getPetById(petId); - print(response); -} catch on DioException (e) { - print('Exception when calling PetApi->getPetById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -> updatePet(pet) - -Update an existing pet - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.updatePet(pet); -} catch on DioException (e) { - print('Exception when calling PetApi->updatePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet that needs to be updated -final String name = name_example; // String | Updated name of the pet -final String status = status_example; // String | Updated status of the pet - -try { - api.updatePetWithForm(petId, name, status); -} catch on DioException (e) { - print('Exception when calling PetApi->updatePetWithForm: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload - -try { - final response = api.uploadFile(petId, additionalMetadata, file); - print(response); -} catch on DioException (e) { - print('Exception when calling PetApi->uploadFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **MultipartFile**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - - - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server - -try { - final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - print(response); -} catch on DioException (e) { - print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **requiredFile** | **MultipartFile**| file to upload | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md deleted file mode 100644 index e4b040a6a79c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Pizza.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pizza - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pizzaSize** | **num** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md deleted file mode 100644 index e1d8434c077d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/PizzaSpeziale.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.PizzaSpeziale - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**toppings** | **String** | | [optional] -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md deleted file mode 100644 index 8f612e8ba19f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/ReadOnlyFirst.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.ReadOnlyFirst - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md deleted file mode 100644 index 0dc93840cd7f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SingleRefType.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.SingleRefType - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md deleted file mode 100644 index 5fcfa98e0b36..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/SpecialModelName.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialModelName - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md deleted file mode 100644 index 42028947229f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/StoreApi.md +++ /dev/null @@ -1,188 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final String orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api.deleteOrder(orderId); -} catch on DioException (e) { - print('Exception when calling StoreApi->deleteOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> Map getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getStoreApi(); - -try { - final response = api.getInventory(); - print(response); -} catch on DioException (e) { - print('Exception when calling StoreApi->getInventory: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map<String, int>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final int orderId = 789; // int | ID of pet that needs to be fetched - -try { - final response = api.getOrderById(orderId); - print(response); -} catch on DioException (e) { - print('Exception when calling StoreApi->getOrderById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final Order order = ; // Order | order placed for purchasing the pet - -try { - final response = api.placeOrder(order); - print(response); -} catch on DioException (e) { - print('Exception when calling StoreApi->placeOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md deleted file mode 100644 index c219f987c19c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md deleted file mode 100644 index fa87e64d8595..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md deleted file mode 100644 index 49b79d76b8a1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/doc/UserApi.md +++ /dev/null @@ -1,359 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final User user = ; // User | Created user object - -try { - api.createUser(user); -} catch on DioException (e) { - print('Exception when calling UserApi->createUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final List user = ; // List | List of user object - -try { - api.createUsersWithArrayInput(user); -} catch on DioException (e) { - print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final List user = ; // List | List of user object - -try { - api.createUsersWithListInput(user); -} catch on DioException (e) { - print('Exception when calling UserApi->createUsersWithListInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be deleted - -try { - api.deleteUser(username); -} catch on DioException (e) { - print('Exception when calling UserApi->deleteUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - final response = api.getUserByName(username); - print(response); -} catch on DioException (e) { - print('Exception when calling UserApi->getUserByName: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The user name for login -final String password = password_example; // String | The password for login in clear text - -try { - final response = api.loginUser(username, password); - print(response); -} catch on DioException (e) { - print('Exception when calling UserApi->loginUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); - -try { - api.logoutUser(); -} catch on DioException (e) { - print('Exception when calling UserApi->logoutUser: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | name that need to be deleted -final User user = ; // User | Updated user object - -try { - api.updateUser(username, user); -} catch on DioException (e) { - print('Exception when calling UserApi->updateUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart deleted file mode 100644 index 7eddfc0d38fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/openapi.dart +++ /dev/null @@ -1,120 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; - - -export 'package:openapi/src/api/another_fake_api.dart'; -export 'package:openapi/src/api/bar_api.dart'; -export 'package:openapi/src/api/default_api.dart'; -export 'package:openapi/src/api/fake_api.dart'; -export 'package:openapi/src/api/fake_classname_tags123_api.dart'; -export 'package:openapi/src/api/foo_api.dart'; -export 'package:openapi/src/api/pet_api.dart'; -export 'package:openapi/src/api/store_api.dart'; -export 'package:openapi/src/api/user_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/addressable.dart'; -export 'package:openapi/src/model/all_of_with_single_ref.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/apple.dart'; -export 'package:openapi/src/model/apple_all_of_disc.dart'; -export 'package:openapi/src/model/apple_grandparent_disc.dart'; -export 'package:openapi/src/model/apple_one_of_disc.dart'; -export 'package:openapi/src/model/apple_req_disc.dart'; -export 'package:openapi/src/model/apple_variant1.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/banana.dart'; -export 'package:openapi/src/model/banana_all_of_disc.dart'; -export 'package:openapi/src/model/banana_grandparent_disc.dart'; -export 'package:openapi/src/model/banana_one_of_disc.dart'; -export 'package:openapi/src/model/banana_req_disc.dart'; -export 'package:openapi/src/model/bar.dart'; -export 'package:openapi/src/model/bar_create.dart'; -export 'package:openapi/src/model/bar_ref.dart'; -export 'package:openapi/src/model/bar_ref_or_value.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/composed_disc_missing_from_properties.dart'; -export 'package:openapi/src/model/composed_disc_optional_type_correct.dart'; -export 'package:openapi/src/model/composed_disc_optional_type_inconsistent.dart'; -export 'package:openapi/src/model/composed_disc_optional_type_incorrect.dart'; -export 'package:openapi/src/model/composed_disc_required_inconsistent.dart'; -export 'package:openapi/src/model/composed_disc_type_inconsistent.dart'; -export 'package:openapi/src/model/composed_disc_type_incorrect.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/disc_missing_from_properties.dart'; -export 'package:openapi/src/model/disc_optional_type_correct.dart'; -export 'package:openapi/src/model/disc_optional_type_incorrect.dart'; -export 'package:openapi/src/model/disc_type_incorrect.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/entity.dart'; -export 'package:openapi/src/model/entity_ref.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/extensible.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/foo_basic_get_default_response.dart'; -export 'package:openapi/src/model/foo_ref.dart'; -export 'package:openapi/src/model/foo_ref_or_value.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/fruit.dart'; -export 'package:openapi/src/model/fruit_all_of_disc.dart'; -export 'package:openapi/src/model/fruit_any_of_disc.dart'; -export 'package:openapi/src/model/fruit_grandparent_disc.dart'; -export 'package:openapi/src/model/fruit_inline_disc.dart'; -export 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; -export 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; -export 'package:openapi/src/model/fruit_inline_inline_disc.dart'; -export 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; -export 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; -export 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; -export 'package:openapi/src/model/fruit_one_of_disc.dart'; -export 'package:openapi/src/model/fruit_req_disc.dart'; -export 'package:openapi/src/model/fruit_type.dart'; -export 'package:openapi/src/model/fruit_variant1.dart'; -export 'package:openapi/src/model/giga_one_of.dart'; -export 'package:openapi/src/model/grape_variant1.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/one_of_primitive_child.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/parent.dart'; -export 'package:openapi/src/model/pasta.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/pizza.dart'; -export 'package:openapi/src/model/pizza_speziale.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart deleted file mode 100644 index d98f3c23f4f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/another_fake_api.dart +++ /dev/null @@ -1,109 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class AnotherFakeApi { - - final Dio _dio; - - const AnotherFakeApi(this._dio); - - /// To test special tags - /// To test special tags and operation ID starting with number - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioException] if API call or serialization fails - Future> call123testSpecialTags({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart deleted file mode 100644 index 9928242bb02a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/bar_api.dart +++ /dev/null @@ -1,110 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/bar.dart'; -import 'package:openapi/src/model/bar_create.dart'; - -class BarApi { - - final Dio _dio; - - const BarApi(this._dio); - - /// Create a Bar - /// - /// - /// Parameters: - /// * [barCreate] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Bar] as data - /// Throws [DioException] if API call or serialization fails - Future> createBar({ - required BarCreate barCreate, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/bar'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(barCreate); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Bar? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Bar', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart deleted file mode 100644 index 9f304f45dff1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/default_api.dart +++ /dev/null @@ -1,434 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/foo_basic_get_default_response.dart'; -import 'package:openapi/src/model/fruit.dart'; -import 'package:openapi/src/model/fruit_all_of_disc.dart'; -import 'package:openapi/src/model/fruit_variant1.dart'; -import 'package:openapi/src/model/giga_one_of.dart'; - -class DefaultApi { - - final Dio _dio; - - const DefaultApi(this._dio); - - /// fooBasicGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooBasicGetDefaultResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> fooBasicGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo-basic'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooBasicGetDefaultResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FooBasicGetDefaultResponse', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// list - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [GigaOneOf] as data - /// Throws [DioException] if API call or serialization fails - Future> list({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/oneof-primitive'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - GigaOneOf? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'GigaOneOf', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// oneofGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Fruit] as data - /// Throws [DioException] if API call or serialization fails - Future> oneofGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/oneof'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Fruit? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Fruit', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// test - /// - /// - /// Parameters: - /// * [body] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> test({ - Object? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/variant1'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// variant1Get - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FruitVariant1] as data - /// Throws [DioException] if API call or serialization fails - Future> variant1Get({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/variant1'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FruitVariant1? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FruitVariant1', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// variant2Get - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FruitAllOfDisc] as data - /// Throws [DioException] if API call or serialization fails - Future> variant2Get({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/variant2'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FruitAllOfDisc? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FruitAllOfDisc', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart deleted file mode 100644 index 08b8fffb04d3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_api.dart +++ /dev/null @@ -1,1380 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/user.dart'; - -class FakeApi { - - final Dio _dio; - - const FakeApi(this._dio); - - /// Health check endpoint - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeHealthGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/health'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - HealthCheckResult? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'HealthCheckResult', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// test http signature authentication - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [query1] - query parameter - /// * [header1] - header parameter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': query1, - }; - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// fakeOuterBooleanSerialize - /// Test serialization of outer boolean types - /// - /// Parameters: - /// * [body] - Input boolean as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ - bool? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - bool? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'bool', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterCompositeSerialize - /// Test serialization of object with outer number type - /// - /// Parameters: - /// * [outerComposite] - Input composite as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(outerComposite); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterComposite? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'OuterComposite', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterNumberSerialize - /// Test serialization of outer number types - /// - /// Parameters: - /// * [body] - Input number as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterNumberSerialize({ - num? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/number'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - num? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'num', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterStringSerialize - /// Test serialization of outer string types - /// - /// Parameters: - /// * [body] - Input string as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioException] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/string'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakePropertyEnumIntegerSerialize - /// Test serialization of enum (int) properties with examples - /// - /// Parameters: - /// * [outerObjectWithEnumProperty] - Input enum (int) as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioException] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/property/enum-int'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(outerObjectWithEnumProperty); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterObjectWithEnumProperty? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'OuterObjectWithEnumProperty', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// testBodyWithBinary - /// For this test, the body has to be a binary file. - /// - /// Parameters: - /// * [body] - image to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithBinary({ - MultipartFile? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-binary'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'image/png', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(body); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithFileSchema - /// For this test, the body for this request must reference a schema named `File`. - /// - /// Parameters: - /// * [fileSchemaTestClass] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-file-schema'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(fileSchemaTestClass); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithQueryParams - /// - /// - /// Parameters: - /// * [query] - /// * [user] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testBodyWithQueryParams({ - required String query, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-query-params'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'query': query, - }; - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test \"client\" model - /// To test \"client\" model - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioException] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// - /// Parameters: - /// * [number] - None - /// * [double_] - None - /// * [patternWithoutDelimiter] - None - /// * [byte] - None - /// * [integer] - None - /// * [int32] - None - /// * [int64] - None - /// * [float] - None - /// * [string] - None - /// * [binary] - None - /// * [date] - None - /// * [dateTime] - None - /// * [password] - None - /// * [callback] - None - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - MultipartFile? binary, - DateTime? date, - DateTime? dateTime, - String? password, - String? callback, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'basic', - 'name': 'http_basic_test', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test enum parameters - /// To test enum parameters - /// - /// Parameters: - /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) - /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) - /// * [enumQueryInteger] - Query parameter enum test (double) - /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumQueryModelArray] - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testEnumParameters({ - List? enumHeaderStringArray, - String? enumHeaderString = '-efg', - List? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - List? enumQueryModelArray, - List? enumFormStringArray, - String? enumFormString, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'GET', - headers: { - if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, - if (enumHeaderString != null) r'enum_header_string': enumHeaderString, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray, - if (enumQueryString != null) r'enum_query_string': enumQueryString, - if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger, - if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble, - if (enumQueryModelArray != null) r'enum_query_model_array': enumQueryModelArray, - }; - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Fake endpoint to test group parameters (optional) - /// Fake endpoint to test group parameters (optional) - /// - /// Parameters: - /// * [requiredStringGroup] - Required String in group parameters - /// * [requiredBooleanGroup] - Required Boolean in group parameters - /// * [requiredInt64Group] - Required Integer in group parameters - /// * [stringGroup] - String in group parameters - /// * [booleanGroup] - Boolean in group parameters - /// * [int64Group] - Integer in group parameters - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'DELETE', - headers: { - r'required_boolean_group': requiredBooleanGroup, - if (booleanGroup != null) r'boolean_group': booleanGroup, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'bearer', - 'name': 'bearer_test', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'required_string_group': requiredStringGroup, - r'required_int64_group': requiredInt64Group, - if (stringGroup != null) r'string_group': stringGroup, - if (int64Group != null) r'int64_group': int64Group, - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test inline additionalProperties - /// - /// - /// Parameters: - /// * [requestBody] - request body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testInlineAdditionalProperties({ - required Map requestBody, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/inline-additionalProperties'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(requestBody); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test json serialization of form data - /// - /// - /// Parameters: - /// * [param] - field1 - /// * [param2] - field2 - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testJsonFormData({ - required String param, - required String param2, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/jsonFormData'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testQueryParameterCollectionFormat - /// To test the collection format in query parameters - /// - /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ - required List pipe, - required List ioutil, - required List http, - required List url, - required List context, - required String allowEmpty, - Map? language, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/test-query-parameters'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'pipe': pipe, - r'ioutil': ioutil, - r'http': http, - r'url': url, - r'context': context, - if (language != null) r'language': language, - r'allowEmpty': allowEmpty, - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart deleted file mode 100644 index 56ec33f1cace..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/fake_classname_tags123_api.dart +++ /dev/null @@ -1,116 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class FakeClassnameTags123Api { - - final Dio _dio; - - const FakeClassnameTags123Api(this._dio); - - /// To test class name in snake case - /// To test class name in snake case - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioException] if API call or serialization fails - Future> testClassname({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(modelClient); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ModelClient', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart deleted file mode 100644 index 836429ae3f39..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/foo_api.dart +++ /dev/null @@ -1,179 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref_or_value.dart'; - -class FooApi { - - final Dio _dio; - - const FooApi(this._dio); - - /// Create a Foo - /// - /// - /// Parameters: - /// * [foo] - The Foo to be created - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [FooRefOrValue] as data - /// Throws [DioException] if API call or serialization fails - Future> createFoo({ - Foo? foo, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json;charset=utf-8', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(foo); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - FooRefOrValue? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'FooRefOrValue', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// GET all Foos - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioException] if API call or serialization fails - Future>> getAllFoos({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - List? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, FooRefOrValue>(rawData, 'List', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart deleted file mode 100644 index ec20128ee1e3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/pet_api.dart +++ /dev/null @@ -1,727 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/pet.dart'; - -class PetApi { - - final Dio _dio; - - const PetApi(this._dio); - - /// Add a new pet to the store - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> addPet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Deletes a pet - /// - /// - /// Parameters: - /// * [petId] - Pet id to delete - /// * [apiKey] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> deletePet({ - required int petId, - String? apiKey, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - if (apiKey != null) r'api_key': apiKey, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Finds Pets by status - /// Multiple status values can be provided with comma separated strings - /// - /// Parameters: - /// * [status] - Status values that need to be considered for filter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [List] as data - /// Throws [DioException] if API call or serialization fails - Future>> findPetsByStatus({ - @Deprecated('status is deprecated') required List status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByStatus'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'status': status, - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - List? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'List', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Finds Pets by tags - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Parameters: - /// * [tags] - Tags to filter by - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Set] as data - /// Throws [DioException] if API call or serialization fails - @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required Set tags, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByTags'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'tags': tags, - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Set? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, Pet>(rawData, 'Set', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find pet by ID - /// Returns a single pet - /// - /// Parameters: - /// * [petId] - ID of pet to return - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioException] if API call or serialization fails - Future> getPetById({ - required int petId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Pet? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Pet', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Update an existing pet - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(pet); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updates a pet in the store with form data - /// - /// - /// Parameters: - /// * [petId] - ID of pet that needs to be updated - /// * [name] - Updated name of the pet - /// * [status] - Updated status of the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updatePetWithForm({ - required int petId, - String? name, - String? status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// uploads an image - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [additionalMetadata] - Additional data to pass to server - /// * [file] - file to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// uploads an image (required) - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [requiredFile] - file to upload - /// * [additionalMetadata] - Additional data to pass to server - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioException] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'ApiResponse', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart deleted file mode 100644 index 23e8deceaea8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/store_api.dart +++ /dev/null @@ -1,303 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/order.dart'; - -class StoreApi { - - final Dio _dio; - - const StoreApi(this._dio); - - /// Delete purchase order by ID - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Parameters: - /// * [orderId] - ID of the order that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> deleteOrder({ - required String orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Returns pet inventories by status - /// Returns a map of status codes to quantities - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Map] as data - /// Throws [DioException] if API call or serialization fails - Future>> getInventory({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/inventory'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Map? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize, int>(rawData, 'Map', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find purchase order by ID - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// - /// Parameters: - /// * [orderId] - ID of pet that needs to be fetched - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> getOrderById({ - required int orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Place an order for a pet - /// - /// - /// Parameters: - /// * [order] - order placed for purchasing the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioException] if API call or serialization fails - Future> placeOrder({ - required Order order, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(order); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'Order', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart deleted file mode 100644 index 24bbeb48f746..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/lib/src/api/user_api.dart +++ /dev/null @@ -1,524 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -// ignore: unused_import -import 'dart:convert'; -import 'package:openapi/src/deserialize.dart'; -import 'package:dio/dio.dart'; - -import 'package:openapi/src/model/user.dart'; - -class UserApi { - - final Dio _dio; - - const UserApi(this._dio); - - /// Create user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [user] - Created user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> createUser({ - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> createUsersWithArrayInput({ - required List user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithArray'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> createUsersWithListInput({ - required List user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithList'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Delete user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - The name that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> deleteUser({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Get user by user name - /// - /// - /// Parameters: - /// * [username] - The name that needs to be fetched. Use user1 for testing. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioException] if API call or serialization fails - Future> getUserByName({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - User? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'User', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs user into the system - /// - /// - /// Parameters: - /// * [username] - The user name for login - /// * [password] - The password for login in clear text - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioException] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/login'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'username': username, - r'password': password, - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String? _responseData; - - try { -final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'String', growable: true); - } catch (error, stackTrace) { - throw DioException( - requestOptions: _response.requestOptions, - response: _response, - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs out current logged in user session - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> logoutUser({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/logout'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updated user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - name that need to be deleted - /// * [user] - Updated user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioException] if API call or serialization fails - Future> updateUser({ - required String username, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { -_bodyData=jsonEncode(user); - } catch(error, stackTrace) { - throw DioException( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioExceptionType.unknown, - error: error, - stackTrace: stackTrace, - ); - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml deleted file mode 100644 index d005a785419f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/pubspec.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.15.0 <3.0.0' - -dependencies: - dio: '^5.2.0' - json_annotation: '^4.4.0' - -dev_dependencies: - build_runner: any - json_serializable: '^6.1.5' - test: ^1.16.0 diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart deleted file mode 100644 index fd8299fb998f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/additional_properties_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AdditionalPropertiesClass -void main() { - final AdditionalPropertiesClass? instance = /* AdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity - - group(AdditionalPropertiesClass, () { - // Map mapProperty - test('to test the property `mapProperty`', () async { - // TODO - }); - - // Map> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart deleted file mode 100644 index 2c4a84f1cb39..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/addressable_test.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Addressable -void main() { - final Addressable? instance = /* Addressable(...) */ null; - // TODO add properties to the entity - - group(Addressable, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart deleted file mode 100644 index ad5da909f6e3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/all_of_with_single_ref_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AllOfWithSingleRef -void main() { - final AllOfWithSingleRef? instance = /* AllOfWithSingleRef(...) */ null; - // TODO add properties to the entity - - group(AllOfWithSingleRef, () { - // String username - test('to test the property `username`', () async { - // TODO - }); - - // SingleRefType singleRefType - test('to test the property `singleRefType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart deleted file mode 100644 index 83c65b22bfc3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/animal_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Animal -void main() { - final Animal? instance = /* Animal(...) */ null; - // TODO add properties to the entity - - group(Animal, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart deleted file mode 100644 index ddafef2a831b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/another_fake_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for AnotherFakeApi -void main() { - final instance = Openapi().getAnotherFakeApi(); - - group(AnotherFakeApi, () { - // To test special tags - // - // To test special tags and operation ID starting with number - // - //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart deleted file mode 100644 index 9487afd7f58c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/api_response_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ApiResponse -void main() { - final ApiResponse? instance = /* ApiResponse(...) */ null; - // TODO add properties to the entity - - group(ApiResponse, () { - // int code - test('to test the property `code`', () async { - // TODO - }); - - // String type - test('to test the property `type`', () async { - // TODO - }); - - // String message - test('to test the property `message`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart deleted file mode 100644 index 795a76a02d4a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_all_of_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleAllOfDisc -void main() { - final AppleAllOfDisc? instance = /* AppleAllOfDisc(...) */ null; - // TODO add properties to the entity - - group(AppleAllOfDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart deleted file mode 100644 index 6a3ddd70df85..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_grandparent_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleGrandparentDisc -void main() { - final AppleGrandparentDisc? instance = /* AppleGrandparentDisc(...) */ null; - // TODO add properties to the entity - - group(AppleGrandparentDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart deleted file mode 100644 index 02e0384c46c4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_one_of_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleOneOfDisc -void main() { - final AppleOneOfDisc? instance = /* AppleOneOfDisc(...) */ null; - // TODO add properties to the entity - - group(AppleOneOfDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart deleted file mode 100644 index 4f6319e1dac1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_req_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleReqDisc -void main() { - final AppleReqDisc? instance = /* AppleReqDisc(...) */ null; - // TODO add properties to the entity - - group(AppleReqDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart deleted file mode 100644 index 200492f8b1f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Apple -void main() { - final Apple? instance = /* Apple(...) */ null; - // TODO add properties to the entity - - group(Apple, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart deleted file mode 100644 index 3da39610c385..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/apple_variant1_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AppleVariant1 -void main() { - final AppleVariant1? instance = /* AppleVariant1(...) */ null; - // TODO add properties to the entity - - group(AppleVariant1, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart deleted file mode 100644 index 79c0d3f3bba8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfArrayOfNumberOnly -void main() { - final ArrayOfArrayOfNumberOnly? instance = /* ArrayOfArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity - - group(ArrayOfArrayOfNumberOnly, () { - // List> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart deleted file mode 100644 index d80be97cf147..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfNumberOnly -void main() { - final ArrayOfNumberOnly? instance = /* ArrayOfNumberOnly(...) */ null; - // TODO add properties to the entity - - group(ArrayOfNumberOnly, () { - // List arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart deleted file mode 100644 index bfe7c84fd122..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/array_test_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayTest -void main() { - final ArrayTest? instance = /* ArrayTest(...) */ null; - // TODO add properties to the entity - - group(ArrayTest, () { - // List arrayOfString - test('to test the property `arrayOfString`', () async { - // TODO - }); - - // List> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async { - // TODO - }); - - // List> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart deleted file mode 100644 index 63ddbb143c2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_all_of_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaAllOfDisc -void main() { - final BananaAllOfDisc? instance = /* BananaAllOfDisc(...) */ null; - // TODO add properties to the entity - - group(BananaAllOfDisc, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart deleted file mode 100644 index c8cd21759361..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_grandparent_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaGrandparentDisc -void main() { - final BananaGrandparentDisc? instance = /* BananaGrandparentDisc(...) */ null; - // TODO add properties to the entity - - group(BananaGrandparentDisc, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart deleted file mode 100644 index b28908dce973..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_one_of_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaOneOfDisc -void main() { - final BananaOneOfDisc? instance = /* BananaOneOfDisc(...) */ null; - // TODO add properties to the entity - - group(BananaOneOfDisc, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart deleted file mode 100644 index 9e3dd9f4e58f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_req_disc_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BananaReqDisc -void main() { - final BananaReqDisc? instance = /* BananaReqDisc(...) */ null; - // TODO add properties to the entity - - group(BananaReqDisc, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart deleted file mode 100644 index ae681c740af5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/banana_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Banana -void main() { - final Banana? instance = /* Banana(...) */ null; - // TODO add properties to the entity - - group(Banana, () { - // num count - test('to test the property `count`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart deleted file mode 100644 index 73be91c446e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_api_test.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for BarApi -void main() { - final instance = Openapi().getBarApi(); - - group(BarApi, () { - // Create a Bar - // - //Future createBar(BarCreate barCreate) async - test('test createBar', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart deleted file mode 100644 index 720b7afc6e94..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_create_test.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarCreate -void main() { - final BarCreate? instance = /* BarCreate(...) */ null; - // TODO add properties to the entity - - group(BarCreate, () { - // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart deleted file mode 100644 index 68ef8d7e473d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_or_value_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRefOrValue -void main() { - final BarRefOrValue? instance = /* BarRefOrValue(...) */ null; - // TODO add properties to the entity - - group(BarRefOrValue, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart deleted file mode 100644 index 9901ee8da41e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_ref_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for BarRef -void main() { - final BarRef? instance = /* BarRef(...) */ null; - // TODO add properties to the entity - - group(BarRef, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart deleted file mode 100644 index bacdc3d3b62d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/bar_test.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Bar -void main() { - final Bar? instance = /* Bar(...) */ null; - // TODO add properties to the entity - - group(Bar, () { - // String id - test('to test the property `id`', () async { - // TODO - }); - - // String barPropA - test('to test the property `barPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // FooRefOrValue foo - test('to test the property `foo`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart deleted file mode 100644 index 156b0ee4993c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/capitalization_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Capitalization -void main() { - final Capitalization? instance = /* Capitalization(...) */ null; - // TODO add properties to the entity - - group(Capitalization, () { - // String smallCamel - test('to test the property `smallCamel`', () async { - // TODO - }); - - // String capitalCamel - test('to test the property `capitalCamel`', () async { - // TODO - }); - - // String smallSnake - test('to test the property `smallSnake`', () async { - // TODO - }); - - // String capitalSnake - test('to test the property `capitalSnake`', () async { - // TODO - }); - - // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async { - // TODO - }); - - // Name of the pet - // String ATT_NAME - test('to test the property `ATT_NAME`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart deleted file mode 100644 index 0a8811bd37f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/cat_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Cat -void main() { - final Cat? instance = /* Cat(...) */ null; - // TODO add properties to the entity - - group(Cat, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart deleted file mode 100644 index 0ed6921ae7fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/category_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Category -void main() { - final Category? instance = /* Category(...) */ null; - // TODO add properties to the entity - - group(Category, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name (default value: 'default-name') - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart deleted file mode 100644 index e2dda7bab74e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/class_model_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ClassModel -void main() { - final ClassModel? instance = /* ClassModel(...) */ null; - // TODO add properties to the entity - - group(ClassModel, () { - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart deleted file mode 100644 index 6aa4ea7cd3f3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_missing_from_properties_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscMissingFromProperties -void main() { - final ComposedDiscMissingFromProperties? instance = /* ComposedDiscMissingFromProperties(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscMissingFromProperties, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart deleted file mode 100644 index 019707164585..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_correct_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscOptionalTypeCorrect -void main() { - final ComposedDiscOptionalTypeCorrect? instance = /* ComposedDiscOptionalTypeCorrect(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscOptionalTypeCorrect, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart deleted file mode 100644 index a7908a9af523..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_inconsistent_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscOptionalTypeInconsistent -void main() { - final ComposedDiscOptionalTypeInconsistent? instance = /* ComposedDiscOptionalTypeInconsistent(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscOptionalTypeInconsistent, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart deleted file mode 100644 index 75c12126867c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_optional_type_incorrect_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscOptionalTypeIncorrect -void main() { - final ComposedDiscOptionalTypeIncorrect? instance = /* ComposedDiscOptionalTypeIncorrect(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscOptionalTypeIncorrect, () { - // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart deleted file mode 100644 index 474919be74c1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_required_inconsistent_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscRequiredInconsistent -void main() { - final ComposedDiscRequiredInconsistent? instance = /* ComposedDiscRequiredInconsistent(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscRequiredInconsistent, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart deleted file mode 100644 index 0d4e5de48f57..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_inconsistent_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscTypeInconsistent -void main() { - final ComposedDiscTypeInconsistent? instance = /* ComposedDiscTypeInconsistent(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscTypeInconsistent, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart deleted file mode 100644 index e6319e3932e7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/composed_disc_type_incorrect_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ComposedDiscTypeIncorrect -void main() { - final ComposedDiscTypeIncorrect? instance = /* ComposedDiscTypeIncorrect(...) */ null; - // TODO add properties to the entity - - group(ComposedDiscTypeIncorrect, () { - // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart deleted file mode 100644 index 5e638c26329e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/default_api_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future fooBasicGet() async - test('test fooBasicGet', () async { - // TODO - }); - - //Future list() async - test('test list', () async { - // TODO - }); - - //Future oneofGet() async - test('test oneofGet', () async { - // TODO - }); - - //Future test({ Object body }) async - test('test test', () async { - // TODO - }); - - //Future variant1Get() async - test('test variant1Get', () async { - // TODO - }); - - //Future variant2Get() async - test('test variant2Get', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart deleted file mode 100644 index 1b2214668577..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/deprecated_object_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DeprecatedObject -void main() { - final DeprecatedObject? instance = /* DeprecatedObject(...) */ null; - // TODO add properties to the entity - - group(DeprecatedObject, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart deleted file mode 100644 index 6588519317b3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_missing_from_properties_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DiscMissingFromProperties -void main() { - final DiscMissingFromProperties? instance = /* DiscMissingFromProperties(...) */ null; - // TODO add properties to the entity - - group(DiscMissingFromProperties, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart deleted file mode 100644 index 6f52229b070d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_correct_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DiscOptionalTypeCorrect -void main() { - final DiscOptionalTypeCorrect? instance = /* DiscOptionalTypeCorrect(...) */ null; - // TODO add properties to the entity - - group(DiscOptionalTypeCorrect, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart deleted file mode 100644 index 6503824b7980..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_optional_type_incorrect_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DiscOptionalTypeIncorrect -void main() { - final DiscOptionalTypeIncorrect? instance = /* DiscOptionalTypeIncorrect(...) */ null; - // TODO add properties to the entity - - group(DiscOptionalTypeIncorrect, () { - // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart deleted file mode 100644 index 9eb0795df41b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/disc_type_incorrect_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DiscTypeIncorrect -void main() { - final DiscTypeIncorrect? instance = /* DiscTypeIncorrect(...) */ null; - // TODO add properties to the entity - - group(DiscTypeIncorrect, () { - // int fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart deleted file mode 100644 index 98097bd4bf25..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/dog_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Dog -void main() { - final Dog? instance = /* Dog(...) */ null; - // TODO add properties to the entity - - group(Dog, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // String breed - test('to test the property `breed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart deleted file mode 100644 index 65fed045507a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_ref_test.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EntityRef -void main() { - final EntityRef? instance = /* EntityRef(...) */ null; - // TODO add properties to the entity - - group(EntityRef, () { - // Name of the related entity. - // String name - test('to test the property `name`', () async { - // TODO - }); - - // The actual type of the target instance when needed for disambiguation. - // String atReferredType - test('to test the property `atReferredType`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart deleted file mode 100644 index b34dd0ec767d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/entity_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Entity -void main() { - final Entity? instance = /* Entity(...) */ null; - // TODO add properties to the entity - - group(Entity, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart deleted file mode 100644 index 30d12204ba17..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_arrays_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumArrays -void main() { - final EnumArrays? instance = /* EnumArrays(...) */ null; - // TODO add properties to the entity - - group(EnumArrays, () { - // String justSymbol - test('to test the property `justSymbol`', () async { - // TODO - }); - - // List arrayEnum - test('to test the property `arrayEnum`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart deleted file mode 100644 index befb9901ce9d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/enum_test_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumTest -void main() { - final EnumTest? instance = /* EnumTest(...) */ null; - // TODO add properties to the entity - - group(EnumTest, () { - // String enumString - test('to test the property `enumString`', () async { - // TODO - }); - - // String enumStringRequired - test('to test the property `enumStringRequired`', () async { - // TODO - }); - - // int enumInteger - test('to test the property `enumInteger`', () async { - // TODO - }); - - // double enumNumber - test('to test the property `enumNumber`', () async { - // TODO - }); - - // OuterEnum outerEnum - test('to test the property `outerEnum`', () async { - // TODO - }); - - // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async { - // TODO - }); - - // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async { - // TODO - }); - - // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart deleted file mode 100644 index df1f73c05b35..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/extensible_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Extensible -void main() { - final Extensible? instance = /* Extensible(...) */ null; - // TODO add properties to the entity - - group(Extensible, () { - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart deleted file mode 100644 index 06418dfa53c4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_api_test.dart +++ /dev/null @@ -1,140 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeApi -void main() { - final instance = Openapi().getFakeApi(); - - group(FakeApi, () { - // Health check endpoint - // - //Future fakeHealthGet() async - test('test fakeHealthGet', () async { - // TODO - }); - - // test http signature authentication - // - //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async { - // TODO - }); - - // Test serialization of outer boolean types - // - //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async { - // TODO - }); - - // Test serialization of object with outer number type - // - //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async { - // TODO - }); - - // Test serialization of outer number types - // - //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async { - // TODO - }); - - // Test serialization of outer string types - // - //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async { - // TODO - }); - - // Test serialization of enum (int) properties with examples - // - //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async { - // TODO - }); - - // For this test, the body has to be a binary file. - // - //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async { - // TODO - }); - - // For this test, the body for this request must reference a schema named `File`. - // - //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async { - // TODO - }); - - //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async { - // TODO - }); - - // To test \"client\" model - // - // To test \"client\" model - // - //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async { - // TODO - }); - - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async { - // TODO - }); - - // To test enum parameters - // - // To test enum parameters - // - //Future testEnumParameters({ List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async { - // TODO - }); - - // Fake endpoint to test group parameters (optional) - // - // Fake endpoint to test group parameters (optional) - // - //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async { - // TODO - }); - - // test inline additionalProperties - // - // - // - //Future testInlineAdditionalProperties(Map requestBody) async - test('test testInlineAdditionalProperties', () async { - // TODO - }); - - // test json serialization of form data - // - // - // - //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); - - // To test the collection format in query parameters - // - //Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async - test('test testQueryParameterCollectionFormat', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart deleted file mode 100644 index 3075147f52fd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fake_classname_tags123_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeClassnameTags123Api -void main() { - final instance = Openapi().getFakeClassnameTags123Api(); - - group(FakeClassnameTags123Api, () { - // To test class name in snake case - // - // To test class name in snake case - // - //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart deleted file mode 100644 index 2ccd0d450ce7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/file_schema_test_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FileSchemaTestClass -void main() { - final FileSchemaTestClass? instance = /* FileSchemaTestClass(...) */ null; - // TODO add properties to the entity - - group(FileSchemaTestClass, () { - // ModelFile file - test('to test the property `file`', () async { - // TODO - }); - - // List files - test('to test the property `files`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart deleted file mode 100644 index 40bc24e691ea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_api_test.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FooApi -void main() { - final instance = Openapi().getFooApi(); - - group(FooApi, () { - // Create a Foo - // - //Future createFoo({ Foo foo }) async - test('test createFoo', () async { - // TODO - }); - - // GET all Foos - // - //Future> getAllFoos() async - test('test getAllFoos', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart deleted file mode 100644 index d344c491bc93..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_basic_get_default_response_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooBasicGetDefaultResponse -void main() { - final FooBasicGetDefaultResponse? instance = /* FooBasicGetDefaultResponse(...) */ null; - // TODO add properties to the entity - - group(FooBasicGetDefaultResponse, () { - // Foo string - test('to test the property `string`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart deleted file mode 100644 index 5e1422e41a2f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_or_value_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRefOrValue -void main() { - final FooRefOrValue? instance = /* FooRefOrValue(...) */ null; - // TODO add properties to the entity - - group(FooRefOrValue, () { - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart deleted file mode 100644 index b5258ac11d7d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_ref_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FooRef -void main() { - final FooRef? instance = /* FooRef(...) */ null; - // TODO add properties to the entity - - group(FooRef, () { - // String foorefPropA - test('to test the property `foorefPropA`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart deleted file mode 100644 index e4ccad0f338a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/foo_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final Foo? instance = /* Foo(...) */ null; - // TODO add properties to the entity - - group(Foo, () { - // String fooPropA - test('to test the property `fooPropA`', () async { - // TODO - }); - - // String fooPropB - test('to test the property `fooPropB`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart deleted file mode 100644 index b08838d81a37..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/format_test_test.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FormatTest -void main() { - final FormatTest? instance = /* FormatTest(...) */ null; - // TODO add properties to the entity - - group(FormatTest, () { - // int integer - test('to test the property `integer`', () async { - // TODO - }); - - // int int32 - test('to test the property `int32`', () async { - // TODO - }); - - // int int64 - test('to test the property `int64`', () async { - // TODO - }); - - // num number - test('to test the property `number`', () async { - // TODO - }); - - // double float - test('to test the property `float`', () async { - // TODO - }); - - // double double_ - test('to test the property `double_`', () async { - // TODO - }); - - // double decimal - test('to test the property `decimal`', () async { - // TODO - }); - - // String string - test('to test the property `string`', () async { - // TODO - }); - - // String byte - test('to test the property `byte`', () async { - // TODO - }); - - // MultipartFile binary - test('to test the property `binary`', () async { - // TODO - }); - - // DateTime date - test('to test the property `date`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // A string that is a 10 digit number. Can have leading zeros. - // String patternWithDigits - test('to test the property `patternWithDigits`', () async { - // TODO - }); - - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart deleted file mode 100644 index 809603237282..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_all_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitAllOfDisc -void main() { - final FruitAllOfDisc? instance = /* FruitAllOfDisc(...) */ null; - // TODO add properties to the entity - - group(FruitAllOfDisc, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart deleted file mode 100644 index 4e1075e27963..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_any_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitAnyOfDisc -void main() { - final FruitAnyOfDisc? instance = /* FruitAnyOfDisc(...) */ null; - // TODO add properties to the entity - - group(FruitAnyOfDisc, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart deleted file mode 100644 index bb27a8c3bb35..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_grandparent_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitGrandparentDisc -void main() { - final FruitGrandparentDisc? instance = /* FruitGrandparentDisc(...) */ null; - // TODO add properties to the entity - - group(FruitGrandparentDisc, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart deleted file mode 100644 index 1d0795670ac0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of1_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineDiscOneOf1 -void main() { - final FruitInlineDiscOneOf1? instance = /* FruitInlineDiscOneOf1(...) */ null; - // TODO add properties to the entity - - group(FruitInlineDiscOneOf1, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart deleted file mode 100644 index 29b97e1ac71a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_one_of_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineDiscOneOf -void main() { - final FruitInlineDiscOneOf? instance = /* FruitInlineDiscOneOf(...) */ null; - // TODO add properties to the entity - - group(FruitInlineDiscOneOf, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart deleted file mode 100644 index e4d8b8c6abeb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_disc_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineDisc -void main() { - final FruitInlineDisc? instance = /* FruitInlineDisc(...) */ null; - // TODO add properties to the entity - - group(FruitInlineDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart deleted file mode 100644 index 5cb5a73f910e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of1_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineInlineDiscOneOf1 -void main() { - final FruitInlineInlineDiscOneOf1? instance = /* FruitInlineInlineDiscOneOf1(...) */ null; - // TODO add properties to the entity - - group(FruitInlineInlineDiscOneOf1, () { - // int length - test('to test the property `length`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart deleted file mode 100644 index b00e9c4ba91e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_one_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineInlineDiscOneOfOneOf -void main() { - final FruitInlineInlineDiscOneOfOneOf? instance = /* FruitInlineInlineDiscOneOfOneOf(...) */ null; - // TODO add properties to the entity - - group(FruitInlineInlineDiscOneOfOneOf, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart deleted file mode 100644 index c55ffc399277..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_one_of_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineInlineDiscOneOf -void main() { - final FruitInlineInlineDiscOneOf? instance = /* FruitInlineInlineDiscOneOf(...) */ null; - // TODO add properties to the entity - - group(FruitInlineInlineDiscOneOf, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart deleted file mode 100644 index cc609633a2e1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_inline_inline_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitInlineInlineDisc -void main() { - final FruitInlineInlineDisc? instance = /* FruitInlineInlineDisc(...) */ null; - // TODO add properties to the entity - - group(FruitInlineInlineDisc, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart deleted file mode 100644 index 1af3c64a1719..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_one_of_disc_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitOneOfDisc -void main() { - final FruitOneOfDisc? instance = /* FruitOneOfDisc(...) */ null; - // TODO add properties to the entity - - group(FruitOneOfDisc, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart deleted file mode 100644 index d0f31e458df4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_req_disc_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitReqDisc -void main() { - final FruitReqDisc? instance = /* FruitReqDisc(...) */ null; - // TODO add properties to the entity - - group(FruitReqDisc, () { - // int seeds - test('to test the property `seeds`', () async { - // TODO - }); - - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - // int length - test('to test the property `length`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart deleted file mode 100644 index 8dfac99108f2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Fruit -void main() { - final Fruit? instance = /* Fruit(...) */ null; - // TODO add properties to the entity - - group(Fruit, () { - // String color - test('to test the property `color`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - // num count - test('to test the property `count`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart deleted file mode 100644 index 24a25d03a935..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_type_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitType -void main() { - final FruitType? instance = /* FruitType(...) */ null; - // TODO add properties to the entity - - group(FruitType, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart deleted file mode 100644 index ae3da72d4eb9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/fruit_variant1_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FruitVariant1 -void main() { - final FruitVariant1? instance = /* FruitVariant1(...) */ null; - // TODO add properties to the entity - - group(FruitVariant1, () { - // String color - test('to test the property `color`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart deleted file mode 100644 index 10e23cf1ef9e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/giga_one_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for GigaOneOf -void main() { - final GigaOneOf? instance = /* GigaOneOf(...) */ null; - // TODO add properties to the entity - - group(GigaOneOf, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart deleted file mode 100644 index 6d508469e62b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/grape_variant1_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for GrapeVariant1 -void main() { - final GrapeVariant1? instance = /* GrapeVariant1(...) */ null; - // TODO add properties to the entity - - group(GrapeVariant1, () { - // String color - test('to test the property `color`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart deleted file mode 100644 index d72429a31bb5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/has_only_read_only_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HasOnlyReadOnly -void main() { - final HasOnlyReadOnly? instance = /* HasOnlyReadOnly(...) */ null; - // TODO add properties to the entity - - group(HasOnlyReadOnly, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String foo - test('to test the property `foo`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart deleted file mode 100644 index b2b48337b76c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/health_check_result_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HealthCheckResult -void main() { - final HealthCheckResult? instance = /* HealthCheckResult(...) */ null; - // TODO add properties to the entity - - group(HealthCheckResult, () { - // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart deleted file mode 100644 index 909415df7540..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/map_test_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MapTest -void main() { - final MapTest? instance = /* MapTest(...) */ null; - // TODO add properties to the entity - - group(MapTest, () { - // Map> mapMapOfString - test('to test the property `mapMapOfString`', () async { - // TODO - }); - - // Map mapOfEnumString - test('to test the property `mapOfEnumString`', () async { - // TODO - }); - - // Map directMap - test('to test the property `directMap`', () async { - // TODO - }); - - // Map indirectMap - test('to test the property `indirectMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart deleted file mode 100644 index 0115f01ed6be..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/mixed_properties_and_additional_properties_class_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MixedPropertiesAndAdditionalPropertiesClass -void main() { - final MixedPropertiesAndAdditionalPropertiesClass? instance = /* MixedPropertiesAndAdditionalPropertiesClass(...) */ null; - // TODO add properties to the entity - - group(MixedPropertiesAndAdditionalPropertiesClass, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // Map map - test('to test the property `map`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart deleted file mode 100644 index de8cf3037b6b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Model200Response -void main() { - final Model200Response? instance = /* Model200Response(...) */ null; - // TODO add properties to the entity - - group(Model200Response, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart deleted file mode 100644 index 44faf62f15b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_client_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelClient -void main() { - final ModelClient? instance = /* ModelClient(...) */ null; - // TODO add properties to the entity - - group(ModelClient, () { - // String client - test('to test the property `client`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart deleted file mode 100644 index 03e5855bf004..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_enum_class_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelEnumClass -void main() { - - group(ModelEnumClass, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart deleted file mode 100644 index 8ea65f6ccb41..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_file_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelFile -void main() { - final ModelFile? instance = /* ModelFile(...) */ null; - // TODO add properties to the entity - - group(ModelFile, () { - // Test capitalization - // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart deleted file mode 100644 index f748eee993ac..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_list_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelList -void main() { - final ModelList? instance = /* ModelList(...) */ null; - // TODO add properties to the entity - - group(ModelList, () { - // String n123list - test('to test the property `n123list`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart deleted file mode 100644 index cfc17807c151..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/model_return_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelReturn -void main() { - final ModelReturn? instance = /* ModelReturn(...) */ null; - // TODO add properties to the entity - - group(ModelReturn, () { - // int return_ - test('to test the property `return_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart deleted file mode 100644 index 4f3f7f633728..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/name_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Name -void main() { - final Name? instance = /* Name(...) */ null; - // TODO add properties to the entity - - group(Name, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // int snakeCase - test('to test the property `snakeCase`', () async { - // TODO - }); - - // String property - test('to test the property `property`', () async { - // TODO - }); - - // int n123number - test('to test the property `n123number`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart deleted file mode 100644 index 0ab76167983b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/nullable_class_test.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NullableClass -void main() { - final NullableClass? instance = /* NullableClass(...) */ null; - // TODO add properties to the entity - - group(NullableClass, () { - // int integerProp - test('to test the property `integerProp`', () async { - // TODO - }); - - // num numberProp - test('to test the property `numberProp`', () async { - // TODO - }); - - // bool booleanProp - test('to test the property `booleanProp`', () async { - // TODO - }); - - // String stringProp - test('to test the property `stringProp`', () async { - // TODO - }); - - // DateTime dateProp - test('to test the property `dateProp`', () async { - // TODO - }); - - // DateTime datetimeProp - test('to test the property `datetimeProp`', () async { - // TODO - }); - - // List arrayNullableProp - test('to test the property `arrayNullableProp`', () async { - // TODO - }); - - // List arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async { - // TODO - }); - - // List arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async { - // TODO - }); - - // Map objectNullableProp - test('to test the property `objectNullableProp`', () async { - // TODO - }); - - // Map objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async { - // TODO - }); - - // Map objectItemsNullable - test('to test the property `objectItemsNullable`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart deleted file mode 100644 index 12b19c59dfb7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NumberOnly -void main() { - final NumberOnly? instance = /* NumberOnly(...) */ null; - // TODO add properties to the entity - - group(NumberOnly, () { - // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart deleted file mode 100644 index 956b0b5e727c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/object_with_deprecated_fields_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ObjectWithDeprecatedFields -void main() { - final ObjectWithDeprecatedFields? instance = /* ObjectWithDeprecatedFields(...) */ null; - // TODO add properties to the entity - - group(ObjectWithDeprecatedFields, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // num id - test('to test the property `id`', () async { - // TODO - }); - - // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async { - // TODO - }); - - // List bars - test('to test the property `bars`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart deleted file mode 100644 index 09b6866b4ab0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/one_of_primitive_child_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OneOfPrimitiveChild -void main() { - final OneOfPrimitiveChild? instance = /* OneOfPrimitiveChild(...) */ null; - // TODO add properties to the entity - - group(OneOfPrimitiveChild, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart deleted file mode 100644 index 45b02097daed..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/order_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Order -void main() { - final Order? instance = /* Order(...) */ null; - // TODO add properties to the entity - - group(Order, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // int petId - test('to test the property `petId`', () async { - // TODO - }); - - // int quantity - test('to test the property `quantity`', () async { - // TODO - }); - - // DateTime shipDate - test('to test the property `shipDate`', () async { - // TODO - }); - - // Order Status - // String status - test('to test the property `status`', () async { - // TODO - }); - - // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart deleted file mode 100644 index a5f0172ba21c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_composite_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterComposite -void main() { - final OuterComposite? instance = /* OuterComposite(...) */ null; - // TODO add properties to the entity - - group(OuterComposite, () { - // num myNumber - test('to test the property `myNumber`', () async { - // TODO - }); - - // String myString - test('to test the property `myString`', () async { - // TODO - }); - - // bool myBoolean - test('to test the property `myBoolean`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart deleted file mode 100644 index 502c8326be58..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumDefaultValue -void main() { - - group(OuterEnumDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart deleted file mode 100644 index c535fe8ac354..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumIntegerDefaultValue -void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart deleted file mode 100644 index d945bc8c489d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_integer_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumInteger -void main() { - - group(OuterEnumInteger, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart deleted file mode 100644 index 8e11eb02fb8a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_enum_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnum -void main() { - - group(OuterEnum, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart deleted file mode 100644 index 3d72c6188e17..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/outer_object_with_enum_property_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterObjectWithEnumProperty -void main() { - final OuterObjectWithEnumProperty? instance = /* OuterObjectWithEnumProperty(...) */ null; - // TODO add properties to the entity - - group(OuterObjectWithEnumProperty, () { - // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart deleted file mode 100644 index e2f1d26ee3e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/parent_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Parent -void main() { - final Parent? instance = /* Parent(...) */ null; - // TODO add properties to the entity - - group(Parent, () { - // String fruitType - test('to test the property `fruitType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart deleted file mode 100644 index c944fa0db8e7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pasta_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pasta -void main() { - final Pasta? instance = /* Pasta(...) */ null; - // TODO add properties to the entity - - group(Pasta, () { - // String vendor - test('to test the property `vendor`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart deleted file mode 100644 index 85a28bcfbe53..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_api_test.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for PetApi -void main() { - final instance = Openapi().getPetApi(); - - group(PetApi, () { - // Add a new pet to the store - // - // - // - //Future addPet(Pet pet) async - test('test addPet', () async { - // TODO - }); - - // Deletes a pet - // - // - // - //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); - - // Finds Pets by status - // - // Multiple status values can be provided with comma separated strings - // - //Future> findPetsByStatus(List status) async - test('test findPetsByStatus', () async { - // TODO - }); - - // Finds Pets by tags - // - // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - // - //Future> findPetsByTags(Set tags) async - test('test findPetsByTags', () async { - // TODO - }); - - // Find pet by ID - // - // Returns a single pet - // - //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); - - // Update an existing pet - // - // - // - //Future updatePet(Pet pet) async - test('test updatePet', () async { - // TODO - }); - - // Updates a pet in the store with form data - // - // - // - //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); - - // uploads an image - // - // - // - //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); - - // uploads an image (required) - // - // - // - //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart deleted file mode 100644 index 20b5e3e06735..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pet_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pet -void main() { - final Pet? instance = /* Pet(...) */ null; - // TODO add properties to the entity - - group(Pet, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // Category category - test('to test the property `category`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - // Set photoUrls - test('to test the property `photoUrls`', () async { - // TODO - }); - - // List tags - test('to test the property `tags`', () async { - // TODO - }); - - // pet status in the store - // String status - test('to test the property `status`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart deleted file mode 100644 index d013ccc06315..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_speziale_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for PizzaSpeziale -void main() { - final PizzaSpeziale? instance = /* PizzaSpeziale(...) */ null; - // TODO add properties to the entity - - group(PizzaSpeziale, () { - // String toppings - test('to test the property `toppings`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart deleted file mode 100644 index f23c37b80e8b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/pizza_test.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pizza -void main() { - final Pizza? instance = /* Pizza(...) */ null; - // TODO add properties to the entity - - group(Pizza, () { - // num pizzaSize - test('to test the property `pizzaSize`', () async { - // TODO - }); - - // Hyperlink reference - // String href - test('to test the property `href`', () async { - // TODO - }); - - // unique identifier - // String id - test('to test the property `id`', () async { - // TODO - }); - - // A URI to a JSON-Schema file that defines additional attributes and relationships - // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async { - // TODO - }); - - // When sub-classing, this defines the super-class - // String atBaseType - test('to test the property `atBaseType`', () async { - // TODO - }); - - // When sub-classing, this defines the sub-class Extensible name - // String atType - test('to test the property `atType`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart deleted file mode 100644 index bcefd75befb6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/read_only_first_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ReadOnlyFirst -void main() { - final ReadOnlyFirst? instance = /* ReadOnlyFirst(...) */ null; - // TODO add properties to the entity - - group(ReadOnlyFirst, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String baz - test('to test the property `baz`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart deleted file mode 100644 index 5cd85add393e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/single_ref_type_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SingleRefType -void main() { - - group(SingleRefType, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart deleted file mode 100644 index 23b58324ef99..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/special_model_name_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialModelName -void main() { - final SpecialModelName? instance = /* SpecialModelName(...) */ null; - // TODO add properties to the entity - - group(SpecialModelName, () { - // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart deleted file mode 100644 index 08f7f738043b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/store_api_test.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for StoreApi -void main() { - final instance = Openapi().getStoreApi(); - - group(StoreApi, () { - // Delete purchase order by ID - // - // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - // - //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); - - // Returns pet inventories by status - // - // Returns a map of status codes to quantities - // - //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); - - // Find purchase order by ID - // - // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - // - //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); - - // Place an order for a pet - // - // - // - //Future placeOrder(Order order) async - test('test placeOrder', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart deleted file mode 100644 index ffe49b3179c3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/tag_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Tag -void main() { - final Tag? instance = /* Tag(...) */ null; - // TODO add properties to the entity - - group(Tag, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart deleted file mode 100644 index 4bf28b67623b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_api_test.dart +++ /dev/null @@ -1,83 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for UserApi -void main() { - final instance = Openapi().getUserApi(); - - group(UserApi, () { - // Create user - // - // This can only be done by the logged in user. - // - //Future createUser(User user) async - test('test createUser', () async { - // TODO - }); - - // Creates list of users with given input array - // - // - // - //Future createUsersWithArrayInput(List user) async - test('test createUsersWithArrayInput', () async { - // TODO - }); - - // Creates list of users with given input array - // - // - // - //Future createUsersWithListInput(List user) async - test('test createUsersWithListInput', () async { - // TODO - }); - - // Delete user - // - // This can only be done by the logged in user. - // - //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); - - // Get user by user name - // - // - // - //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); - - // Logs user into the system - // - // - // - //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); - - // Logs out current logged in user session - // - // - // - //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); - - // Updated user - // - // This can only be done by the logged in user. - // - //Future updateUser(String username, User user) async - test('test updateUser', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart deleted file mode 100644 index 847b14196b93..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/dio/json_serializable/test/user_test.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for User -void main() { - final User? instance = /* User(...) */ null; - // TODO add properties to the entity - - group(User, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String username - test('to test the property `username`', () async { - // TODO - }); - - // String firstName - test('to test the property `firstName`', () async { - // TODO - }); - - // String lastName - test('to test the property `lastName`', () async { - // TODO - }); - - // String email - test('to test the property `email`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // String phone - test('to test the property `phone`', () async { - // TODO - }); - - // User Status - // int userStatus - test('to test the property `userStatus`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md deleted file mode 100644 index 05aa2b0bbc1c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValueWithProperties.md +++ /dev/null @@ -1,19 +0,0 @@ -# openapi.model.FooRefOrValueWithProperties - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**href** | **String** | Hyperlink reference | [optional] -**id** | **String** | unique identifier | [optional] -**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] -**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] -**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md deleted file mode 100644 index 36b2ae0e8ab3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md deleted file mode 100644 index 97a7c8fba492..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart deleted file mode 100644 index abb9dbc25e5f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'cat_all_of.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class CatAllOf { - /// Returns a new [CatAllOf] instance. - CatAllOf({ - - this.declawed, - }); - - @JsonKey( - - name: r'declawed', - required: false, - includeIfNull: false - ) - - - final bool? declawed; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is CatAllOf && - other.declawed == declawed; - - @override - int get hashCode => - declawed.hashCode; - - factory CatAllOf.fromJson(Map json) => _$CatAllOfFromJson(json); - - Map toJson() => _$CatAllOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart deleted file mode 100644 index 19bd4c0267be..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'dog_all_of.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DogAllOf { - /// Returns a new [DogAllOf] instance. - DogAllOf({ - - this.breed, - }); - - @JsonKey( - - name: r'breed', - required: false, - includeIfNull: false - ) - - - final String? breed; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is DogAllOf && - other.breed == breed; - - @override - int get hashCode => - breed.hashCode; - - factory DogAllOf.fromJson(Map json) => _$DogAllOfFromJson(json); - - Map toJson() => _$DogAllOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart deleted file mode 100644 index 9f1eefd4c1a3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'inline_response_default.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class InlineResponseDefault { - /// Returns a new [InlineResponseDefault] instance. - InlineResponseDefault({ - - this.string, - }); - - @JsonKey( - - name: r'string', - required: false, - includeIfNull: false - ) - - - final Foo? string; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is InlineResponseDefault && - other.string == string; - - @override - int get hashCode => - string.hashCode; - - factory InlineResponseDefault.fromJson(Map json) => _$InlineResponseDefaultFromJson(json); - - Map toJson() => _$InlineResponseDefaultToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart index 06418dfa53c4..c31c4aac2708 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/fake_api_test.dart @@ -7,6 +7,13 @@ void main() { final instance = Openapi().getFakeApi(); group(FakeApi, () { + // for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + // + //Future fakeBigDecimalMap() async + test('test fakeBigDecimalMap', () async { + // TODO + }); + // Health check endpoint // //Future fakeHealthGet() async diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md deleted file mode 100644 index 36b2ae0e8ab3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md deleted file mode 100644 index 97a7c8fba492..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart deleted file mode 100644 index 02d9cce0cae1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,141 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat_all_of.g.dart'; - -/// CatAllOf -/// -/// Properties: -/// * [declawed] -@BuiltValue(instantiable: false) -abstract class CatAllOf { - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatAllOfSerializer(); -} - -class _$CatAllOfSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [CatAllOf]; - - @override - final String wireName = r'CatAllOf'; - - Iterable _serializeProperties( - Serializers serializers, - CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); - } - } - - @override - Object serialize( - Serializers serializers, - CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - CatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, specifiedType: FullType($CatAllOf)) as $CatAllOf; - } -} - -/// a concrete implementation of [CatAllOf], since [CatAllOf] is not instantiable -@BuiltValue(instantiable: true) -abstract class $CatAllOf implements CatAllOf, Built<$CatAllOf, $CatAllOfBuilder> { - $CatAllOf._(); - - factory $CatAllOf([void Function($CatAllOfBuilder)? updates]) = _$$CatAllOf; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($CatAllOfBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$CatAllOf> get serializer => _$$CatAllOfSerializer(); -} - -class _$$CatAllOfSerializer implements PrimitiveSerializer<$CatAllOf> { - @override - final Iterable types = const [$CatAllOf, _$$CatAllOf]; - - @override - final String wireName = r'$CatAllOf'; - - @override - Object serialize( - Serializers serializers, - $CatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(CatAllOf))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required CatAllOfBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'declawed': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.declawed = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $CatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $CatAllOfBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart deleted file mode 100644 index bd52567fa60a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,141 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog_all_of.g.dart'; - -/// DogAllOf -/// -/// Properties: -/// * [breed] -@BuiltValue(instantiable: false) -abstract class DogAllOf { - @BuiltValueField(wireName: r'breed') - String? get breed; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogAllOfSerializer(); -} - -class _$DogAllOfSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [DogAllOf]; - - @override - final String wireName = r'DogAllOf'; - - Iterable _serializeProperties( - Serializers serializers, - DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.breed != null) { - yield r'breed'; - yield serializers.serialize( - object.breed, - specifiedType: const FullType(String), - ); - } - } - - @override - Object serialize( - Serializers serializers, - DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - DogAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, specifiedType: FullType($DogAllOf)) as $DogAllOf; - } -} - -/// a concrete implementation of [DogAllOf], since [DogAllOf] is not instantiable -@BuiltValue(instantiable: true) -abstract class $DogAllOf implements DogAllOf, Built<$DogAllOf, $DogAllOfBuilder> { - $DogAllOf._(); - - factory $DogAllOf([void Function($DogAllOfBuilder)? updates]) = _$$DogAllOf; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($DogAllOfBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$DogAllOf> get serializer => _$$DogAllOfSerializer(); -} - -class _$$DogAllOfSerializer implements PrimitiveSerializer<$DogAllOf> { - @override - final Iterable types = const [$DogAllOf, _$$DogAllOf]; - - @override - final String wireName = r'$DogAllOf'; - - @override - Object serialize( - Serializers serializers, - $DogAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(DogAllOf))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required DogAllOfBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'breed': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.breed = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $DogAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $DogAllOfBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart deleted file mode 100644 index 74d5ed70f1e8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,91 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; -import 'package:one_of/one_of.dart'; -import 'package:one_of/any_of.dart'; -// ignore_for_file: unused_element, unused_import - -part 'inline_response_default.g.dart'; - -/// InlineResponseDefault -/// -/// Properties: -/// * [string] -@BuiltValue() -abstract class InlineResponseDefault implements Built { - @BuiltValueField(wireName: r'string') - Foo? get string; - - - InlineResponseDefault._(); - - factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(InlineResponseDefaultBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$InlineResponseDefaultSerializer(); - - -} - -class _$InlineResponseDefaultSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [InlineResponseDefault, _$InlineResponseDefault]; - - @override - final String wireName = r'InlineResponseDefault'; - - Iterable _serializeProperties(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) sync* { - if (object.string != null) { - yield r'string'; - yield serializers.serialize(object.string, - specifiedType: const FullType(Foo)); - } - } - - @override - Object serialize(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified, required List serializedList,required InlineResponseDefaultBuilder result, required List unhandled}) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Foo)) as Foo; - result.string.replace(valueDes); - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - InlineResponseDefault deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = InlineResponseDefaultBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties(serializers, serialized, specifiedType: specifiedType, serializedList: serializedList, unhandled: unhandled, result: result); - return result.build(); - } -} - - - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart index c552474e280b..07319f9363fb 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/fake_api_test.dart @@ -7,6 +7,13 @@ void main() { final instance = Openapi().getFakeApi(); group(FakeApi, () { + // for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + // + //Future fakeBigDecimalMap() async + test('test fakeBigDecimalMap', () async { + // TODO + }); + // Health check endpoint // //Future fakeHealthGet() async diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION deleted file mode 100644 index 757e67400401..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md deleted file mode 100644 index 31acd6e9f132..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/README.md +++ /dev/null @@ -1,264 +0,0 @@ -# openapi (EXPERIMENTAL) -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioClientCodegen - -## Requirements - -* Dart 2.15.0+ or Flutter 2.8.0+ -* Dio 5.0.0+ (https://pub.dev/packages/dio) -* JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable) - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = await api.call123testSpecialTags(modelClient); - print(response); -} catch on DioException (e) { - print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*BarApi*](doc/BarApi.md) | [**createBar**](doc/BarApi.md#createbar) | **POST** /bar | Create a Bar -[*DefaultApi*](doc/DefaultApi.md) | [**fooBasicGet**](doc/DefaultApi.md#foobasicget) | **GET** /foo-basic | -[*DefaultApi*](doc/DefaultApi.md) | [**list**](doc/DefaultApi.md#list) | **GET** /oneof-primitive | -[*DefaultApi*](doc/DefaultApi.md) | [**oneofGet**](doc/DefaultApi.md#oneofget) | **GET** /oneof | -[*DefaultApi*](doc/DefaultApi.md) | [**test**](doc/DefaultApi.md#test) | **PUT** /variant1 | -[*DefaultApi*](doc/DefaultApi.md) | [**variant1Get**](doc/DefaultApi.md#variant1get) | **GET** /variant1 | -[*DefaultApi*](doc/DefaultApi.md) | [**variant2Get**](doc/DefaultApi.md#variant2get) | **GET** /variant2 | -[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -[*FooApi*](doc/FooApi.md) | [**createFoo**](doc/FooApi.md#createfoo) | **POST** /foo | Create a Foo -[*FooApi*](doc/FooApi.md) | [**getAllFoos**](doc/FooApi.md#getallfoos) | **GET** /foo | GET all Foos -[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user -[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) - - [Addressable](doc/Addressable.md) - - [AllOfWithSingleRef](doc/AllOfWithSingleRef.md) - - [Animal](doc/Animal.md) - - [ApiResponse](doc/ApiResponse.md) - - [Apple](doc/Apple.md) - - [AppleAllOfDisc](doc/AppleAllOfDisc.md) - - [AppleGrandparentDisc](doc/AppleGrandparentDisc.md) - - [AppleOneOfDisc](doc/AppleOneOfDisc.md) - - [AppleReqDisc](doc/AppleReqDisc.md) - - [AppleVariant1](doc/AppleVariant1.md) - - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - - [ArrayTest](doc/ArrayTest.md) - - [Banana](doc/Banana.md) - - [BananaAllOfDisc](doc/BananaAllOfDisc.md) - - [BananaGrandparentDisc](doc/BananaGrandparentDisc.md) - - [BananaOneOfDisc](doc/BananaOneOfDisc.md) - - [BananaReqDisc](doc/BananaReqDisc.md) - - [Bar](doc/Bar.md) - - [BarCreate](doc/BarCreate.md) - - [BarRef](doc/BarRef.md) - - [BarRefOrValue](doc/BarRefOrValue.md) - - [Capitalization](doc/Capitalization.md) - - [Cat](doc/Cat.md) - - [Category](doc/Category.md) - - [ClassModel](doc/ClassModel.md) - - [ComposedDiscMissingFromProperties](doc/ComposedDiscMissingFromProperties.md) - - [ComposedDiscOptionalTypeCorrect](doc/ComposedDiscOptionalTypeCorrect.md) - - [ComposedDiscOptionalTypeInconsistent](doc/ComposedDiscOptionalTypeInconsistent.md) - - [ComposedDiscOptionalTypeIncorrect](doc/ComposedDiscOptionalTypeIncorrect.md) - - [ComposedDiscRequiredInconsistent](doc/ComposedDiscRequiredInconsistent.md) - - [ComposedDiscTypeInconsistent](doc/ComposedDiscTypeInconsistent.md) - - [ComposedDiscTypeIncorrect](doc/ComposedDiscTypeIncorrect.md) - - [DeprecatedObject](doc/DeprecatedObject.md) - - [DiscMissingFromProperties](doc/DiscMissingFromProperties.md) - - [DiscOptionalTypeCorrect](doc/DiscOptionalTypeCorrect.md) - - [DiscOptionalTypeIncorrect](doc/DiscOptionalTypeIncorrect.md) - - [DiscTypeIncorrect](doc/DiscTypeIncorrect.md) - - [Dog](doc/Dog.md) - - [Entity](doc/Entity.md) - - [EntityRef](doc/EntityRef.md) - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [Extensible](doc/Extensible.md) - - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - - [Foo](doc/Foo.md) - - [FooBasicGetDefaultResponse](doc/FooBasicGetDefaultResponse.md) - - [FooRef](doc/FooRef.md) - - [FooRefOrValue](doc/FooRefOrValue.md) - - [FormatTest](doc/FormatTest.md) - - [Fruit](doc/Fruit.md) - - [FruitAllOfDisc](doc/FruitAllOfDisc.md) - - [FruitAnyOfDisc](doc/FruitAnyOfDisc.md) - - [FruitGrandparentDisc](doc/FruitGrandparentDisc.md) - - [FruitInlineDisc](doc/FruitInlineDisc.md) - - [FruitInlineDiscOneOf](doc/FruitInlineDiscOneOf.md) - - [FruitInlineDiscOneOf1](doc/FruitInlineDiscOneOf1.md) - - [FruitInlineInlineDisc](doc/FruitInlineInlineDisc.md) - - [FruitInlineInlineDiscOneOf](doc/FruitInlineInlineDiscOneOf.md) - - [FruitInlineInlineDiscOneOf1](doc/FruitInlineInlineDiscOneOf1.md) - - [FruitInlineInlineDiscOneOfOneOf](doc/FruitInlineInlineDiscOneOfOneOf.md) - - [FruitOneOfDisc](doc/FruitOneOfDisc.md) - - [FruitReqDisc](doc/FruitReqDisc.md) - - [FruitType](doc/FruitType.md) - - [FruitVariant1](doc/FruitVariant1.md) - - [GigaOneOf](doc/GigaOneOf.md) - - [GrapeVariant1](doc/GrapeVariant1.md) - - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - - [HealthCheckResult](doc/HealthCheckResult.md) - - [MapTest](doc/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](doc/Model200Response.md) - - [ModelClient](doc/ModelClient.md) - - [ModelEnumClass](doc/ModelEnumClass.md) - - [ModelFile](doc/ModelFile.md) - - [ModelList](doc/ModelList.md) - - [ModelReturn](doc/ModelReturn.md) - - [Name](doc/Name.md) - - [NullableClass](doc/NullableClass.md) - - [NumberOnly](doc/NumberOnly.md) - - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) - - [OneOfPrimitiveChild](doc/OneOfPrimitiveChild.md) - - [Order](doc/Order.md) - - [OuterComposite](doc/OuterComposite.md) - - [OuterEnum](doc/OuterEnum.md) - - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) - - [OuterEnumInteger](doc/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - - [Parent](doc/Parent.md) - - [Pasta](doc/Pasta.md) - - [Pet](doc/Pet.md) - - [Pizza](doc/Pizza.md) - - [PizzaSpeziale](doc/PizzaSpeziale.md) - - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - - [SingleRefType](doc/SingleRefType.md) - - [SpecialModelName](doc/SpecialModelName.md) - - [Tag](doc/Tag.md) - - [User](doc/User.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -### http_basic_test - -- **Type**: HTTP basic authentication - -### bearer_test - -- **Type**: HTTP Bearer Token authentication (JWT) - -### http_signature_test - -- **Type**: HTTP signature authentication - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml deleted file mode 100644 index 89a4dd6e1c2e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/build.yaml +++ /dev/null @@ -1,18 +0,0 @@ -targets: - $default: - builders: - json_serializable: - options: - # Options configure how source code is generated for every - # `@JsonSerializable`-annotated class in the package. - # - # The default value for each is listed. - any_map: false - checked: true - create_factory: true - create_to_json: true - disallow_unrecognized_keys: true - explicit_to_json: true - field_rename: none - ignore_unannotated: false - include_if_null: false diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md deleted file mode 100644 index 0ce3be703145..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Animal.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Animal - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to r'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md deleted file mode 100644 index 4524aa88fa8c..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Cat - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to r'red'] -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md deleted file mode 100644 index dd155ba49e62..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [default to r'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md deleted file mode 100644 index ebf151d38720..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/doc/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Dog - -## Load the model package -```dart -import 'package:openapi/openapi.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to r'red'] -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart deleted file mode 100644 index 6ba61211c680..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/api_util.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:dio/dio.dart'; -import 'dart:convert'; -import 'package:openapi/models.dart'; -import 'dart:typed_data'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -Object encodeFormParameter( - SerializationRepositoryBase repository, - T value, - TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; -} - -String encodeStringParameter( - SerializationRepositoryBase repository, - T value, - TypeInfo type, -) { - return repository.serialize(value, type).toString(); -} - -Object encodeBodyParameter( - SerializationRepositoryBase repository, - T value, - TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; -} - -Object encodeQueryParameter( - SerializationRepositoryBase repository, - T value, - TypeInfo type, { - ListFormat format = ListFormat.multi, -}) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; -} - -ListParam encodeCollectionQueryParameter( - SerializationRepositoryBase repository, - Iterable value, - TypeInfo type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = repository.serialize( - value, - type, - ); - if (serialized is Iterable) { - return ListParam(serialized.toList(), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} - -TOutput decodeResponse( - SerializationRepositoryBase repository, TInput value, TypeInfo type) { - return repository.deserialize(value, type); -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart deleted file mode 100644 index 312a5ad42602..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = - getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart deleted file mode 100644 index c6fcca595cb3..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/auth.dart +++ /dev/null @@ -1,19 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo( - RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart deleted file mode 100644 index 07b9efc0df0c..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo( - options, - (secure) => - (secure['type'] == 'http' && secure['scheme'] == 'basic') || - secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = - 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart deleted file mode 100644 index 6723de5020d3..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,27 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, - (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart deleted file mode 100644 index 44403e3358be..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/auth/oauth.dart +++ /dev/null @@ -1,27 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio/dio.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, - (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart deleted file mode 100644 index 52aae4f3674b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/additional_properties_class.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'additional_properties_class.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AdditionalPropertiesClass { - /// Returns a new [AdditionalPropertiesClass] instance. - AdditionalPropertiesClass({ - this.mapProperty, - this.mapOfMapProperty, - }); - - @JsonKey(name: r'map_property', required: false, includeIfNull: false) - final Map? mapProperty; - - @JsonKey(name: r'map_of_map_property', required: false, includeIfNull: false) - final Map>? mapOfMapProperty; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AdditionalPropertiesClass && - other.mapProperty == mapProperty && - other.mapOfMapProperty == mapOfMapProperty; - - @override - int get hashCode => mapProperty.hashCode + mapOfMapProperty.hashCode; - - factory AdditionalPropertiesClass.fromJson(Map json) => - _$AdditionalPropertiesClassFromJson(json); - - Map toJson() => _$AdditionalPropertiesClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart deleted file mode 100644 index 1558e6f5e9dc..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/addressable.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'addressable.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Addressable { - /// Returns a new [Addressable] instance. - Addressable({ - this.href, - this.id, - }); - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Addressable && other.href == href && other.id == id; - - @override - int get hashCode => href.hashCode + id.hashCode; - - factory Addressable.fromJson(Map json) => - _$AddressableFromJson(json); - - Map toJson() => _$AddressableToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart deleted file mode 100644 index 9fec7e666068..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/all_of_with_single_ref.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/single_ref_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'all_of_with_single_ref.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AllOfWithSingleRef { - /// Returns a new [AllOfWithSingleRef] instance. - AllOfWithSingleRef({ - this.username, - this.singleRefType, - }); - - @JsonKey(name: r'username', required: false, includeIfNull: false) - final String? username; - - @JsonKey(name: r'SingleRefType', required: false, includeIfNull: false) - final SingleRefType? singleRefType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AllOfWithSingleRef && - other.username == username && - other.singleRefType == singleRefType; - - @override - int get hashCode => username.hashCode + singleRefType.hashCode; - - factory AllOfWithSingleRef.fromJson(Map json) => - _$AllOfWithSingleRefFromJson(json); - - Map toJson() => _$AllOfWithSingleRefToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart deleted file mode 100644 index d39354703349..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/animal.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'animal.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Animal { - /// Returns a new [Animal] instance. - Animal({ - required this.className, - this.color = r'red', - }); - - @JsonKey(name: r'className', required: true, includeIfNull: false) - final String className; - - @JsonKey( - defaultValue: r'red', - name: r'color', - required: false, - includeIfNull: false) - final String? color; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Animal && other.className == className && other.color == color; - - @override - int get hashCode => className.hashCode + color.hashCode; - - factory Animal.fromJson(Map json) => _$AnimalFromJson(json); - - Map toJson() => _$AnimalToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart deleted file mode 100644 index df7b51101d80..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/api_response.dart +++ /dev/null @@ -1,53 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'api_response.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ApiResponse { - /// Returns a new [ApiResponse] instance. - ApiResponse({ - this.code, - this.type, - this.message, - }); - - @JsonKey(name: r'code', required: false, includeIfNull: false) - final int? code; - - @JsonKey(name: r'type', required: false, includeIfNull: false) - final String? type; - - @JsonKey(name: r'message', required: false, includeIfNull: false) - final String? message; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ApiResponse && - other.code == code && - other.type == type && - other.message == message; - - @override - int get hashCode => code.hashCode + type.hashCode + message.hashCode; - - factory ApiResponse.fromJson(Map json) => - _$ApiResponseFromJson(json); - - Map toJson() => _$ApiResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart deleted file mode 100644 index 81be695b9bba..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'apple.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Apple { - /// Returns a new [Apple] instance. - Apple({ - this.kind, - }); - - @JsonKey(name: r'kind', required: false, includeIfNull: false) - final String? kind; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Apple && other.kind == kind; - - @override - int get hashCode => kind.hashCode; - - factory Apple.fromJson(Map json) => _$AppleFromJson(json); - - Map toJson() => _$AppleToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart deleted file mode 100644 index 6be847e87750..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_all_of_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_all_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleAllOfDisc { - /// Returns a new [AppleAllOfDisc] instance. - AppleAllOfDisc({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AppleAllOfDisc && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory AppleAllOfDisc.fromJson(Map json) => - _$AppleAllOfDiscFromJson(json); - - Map toJson() => _$AppleAllOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart deleted file mode 100644 index 3793b2338e7a..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_grandparent_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_grandparent_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleGrandparentDisc { - /// Returns a new [AppleGrandparentDisc] instance. - AppleGrandparentDisc({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AppleGrandparentDisc && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory AppleGrandparentDisc.fromJson(Map json) => - _$AppleGrandparentDiscFromJson(json); - - Map toJson() => _$AppleGrandparentDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart deleted file mode 100644 index 4f9ee97f3529..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_one_of_disc.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_one_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleOneOfDisc { - /// Returns a new [AppleOneOfDisc] instance. - AppleOneOfDisc({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AppleOneOfDisc && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory AppleOneOfDisc.fromJson(Map json) => - _$AppleOneOfDiscFromJson(json); - - Map toJson() => _$AppleOneOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart deleted file mode 100644 index 47e4238aec8b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_req_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_req_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleReqDisc { - /// Returns a new [AppleReqDisc] instance. - AppleReqDisc({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is AppleReqDisc && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory AppleReqDisc.fromJson(Map json) => - _$AppleReqDiscFromJson(json); - - Map toJson() => _$AppleReqDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart deleted file mode 100644 index bf5f5208a0fd..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/apple_variant1.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'apple_variant1.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class AppleVariant1 { - /// Returns a new [AppleVariant1] instance. - AppleVariant1({ - this.kind, - }); - - @JsonKey(name: r'kind', required: false, includeIfNull: false) - final String? kind; - - @override - bool operator ==(Object other) => - identical(this, other) || other is AppleVariant1 && other.kind == kind; - - @override - int get hashCode => kind.hashCode; - - factory AppleVariant1.fromJson(Map json) => - _$AppleVariant1FromJson(json); - - Map toJson() => _$AppleVariant1ToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart deleted file mode 100644 index 879bd5274b61..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_array_of_number_only.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'array_of_array_of_number_only.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ArrayOfArrayOfNumberOnly { - /// Returns a new [ArrayOfArrayOfNumberOnly] instance. - ArrayOfArrayOfNumberOnly({ - this.arrayArrayNumber, - }); - - @JsonKey(name: r'ArrayArrayNumber', required: false, includeIfNull: false) - final List>? arrayArrayNumber; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ArrayOfArrayOfNumberOnly && - other.arrayArrayNumber == arrayArrayNumber; - - @override - int get hashCode => arrayArrayNumber.hashCode; - - factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => - _$ArrayOfArrayOfNumberOnlyFromJson(json); - - Map toJson() => _$ArrayOfArrayOfNumberOnlyToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart deleted file mode 100644 index a1dea32fe74d..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_of_number_only.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'array_of_number_only.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ArrayOfNumberOnly { - /// Returns a new [ArrayOfNumberOnly] instance. - ArrayOfNumberOnly({ - this.arrayNumber, - }); - - @JsonKey(name: r'ArrayNumber', required: false, includeIfNull: false) - final List? arrayNumber; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ArrayOfNumberOnly && other.arrayNumber == arrayNumber; - - @override - int get hashCode => arrayNumber.hashCode; - - factory ArrayOfNumberOnly.fromJson(Map json) => - _$ArrayOfNumberOnlyFromJson(json); - - Map toJson() => _$ArrayOfNumberOnlyToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart deleted file mode 100644 index bc0f83a42051..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/array_test.dart +++ /dev/null @@ -1,58 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'array_test.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ArrayTest { - /// Returns a new [ArrayTest] instance. - ArrayTest({ - this.arrayOfString, - this.arrayArrayOfInteger, - this.arrayArrayOfModel, - }); - - @JsonKey(name: r'array_of_string', required: false, includeIfNull: false) - final List? arrayOfString; - - @JsonKey( - name: r'array_array_of_integer', required: false, includeIfNull: false) - final List>? arrayArrayOfInteger; - - @JsonKey(name: r'array_array_of_model', required: false, includeIfNull: false) - final List>? arrayArrayOfModel; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ArrayTest && - other.arrayOfString == arrayOfString && - other.arrayArrayOfInteger == arrayArrayOfInteger && - other.arrayArrayOfModel == arrayArrayOfModel; - - @override - int get hashCode => - arrayOfString.hashCode + - arrayArrayOfInteger.hashCode + - arrayArrayOfModel.hashCode; - - factory ArrayTest.fromJson(Map json) => - _$ArrayTestFromJson(json); - - Map toJson() => _$ArrayTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart deleted file mode 100644 index 41fbfb80acc1..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'banana.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Banana { - /// Returns a new [Banana] instance. - Banana({ - this.count, - }); - - @JsonKey(name: r'count', required: false, includeIfNull: false) - final num? count; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Banana && other.count == count; - - @override - int get hashCode => count.hashCode; - - factory Banana.fromJson(Map json) => _$BananaFromJson(json); - - Map toJson() => _$BananaToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart deleted file mode 100644 index 1ed8ad86f1f3..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_all_of_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'banana_all_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BananaAllOfDisc { - /// Returns a new [BananaAllOfDisc] instance. - BananaAllOfDisc({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BananaAllOfDisc && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory BananaAllOfDisc.fromJson(Map json) => - _$BananaAllOfDiscFromJson(json); - - Map toJson() => _$BananaAllOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart deleted file mode 100644 index 368fe57f6de7..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_grandparent_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'banana_grandparent_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BananaGrandparentDisc { - /// Returns a new [BananaGrandparentDisc] instance. - BananaGrandparentDisc({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BananaGrandparentDisc && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory BananaGrandparentDisc.fromJson(Map json) => - _$BananaGrandparentDiscFromJson(json); - - Map toJson() => _$BananaGrandparentDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart deleted file mode 100644 index ab658900b312..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_one_of_disc.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'banana_one_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BananaOneOfDisc { - /// Returns a new [BananaOneOfDisc] instance. - BananaOneOfDisc({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BananaOneOfDisc && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory BananaOneOfDisc.fromJson(Map json) => - _$BananaOneOfDiscFromJson(json); - - Map toJson() => _$BananaOneOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart deleted file mode 100644 index 07c69a82b090..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/banana_req_disc.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'banana_req_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BananaReqDisc { - /// Returns a new [BananaReqDisc] instance. - BananaReqDisc({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BananaReqDisc && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory BananaReqDisc.fromJson(Map json) => - _$BananaReqDiscFromJson(json); - - Map toJson() => _$BananaReqDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart deleted file mode 100644 index 39a28a166b7f..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar.dart +++ /dev/null @@ -1,93 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'bar.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Bar { - /// Returns a new [Bar] instance. - Bar({ - required this.id, - this.barPropA, - this.fooPropB, - this.foo, - this.href, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'id', required: true, includeIfNull: false) - final String id; - - @JsonKey(name: r'barPropA', required: false, includeIfNull: false) - final String? barPropA; - - @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) - final String? fooPropB; - - @JsonKey(name: r'foo', required: false, includeIfNull: false) - final FooRefOrValue? foo; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Bar && - other.id == id && - other.barPropA == barPropA && - other.fooPropB == fooPropB && - other.foo == foo && - other.href == href && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - id.hashCode + - barPropA.hashCode + - fooPropB.hashCode + - foo.hashCode + - href.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory Bar.fromJson(Map json) => _$BarFromJson(json); - - Map toJson() => _$BarToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart deleted file mode 100644 index 69f8c91e9158..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_create.dart +++ /dev/null @@ -1,95 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo_ref_or_value.dart'; -import 'package:openapi/src/model/entity.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'bar_create.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BarCreate { - /// Returns a new [BarCreate] instance. - BarCreate({ - this.barPropA, - this.fooPropB, - this.foo, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'barPropA', required: false, includeIfNull: false) - final String? barPropA; - - @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) - final String? fooPropB; - - @JsonKey(name: r'foo', required: false, includeIfNull: false) - final FooRefOrValue? foo; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BarCreate && - other.barPropA == barPropA && - other.fooPropB == fooPropB && - other.foo == foo && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - barPropA.hashCode + - fooPropB.hashCode + - foo.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory BarCreate.fromJson(Map json) => - _$BarCreateFromJson(json); - - Map toJson() => _$BarCreateToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart deleted file mode 100644 index 441f1475ed91..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'bar_ref.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BarRef { - /// Returns a new [BarRef] instance. - BarRef({ - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BarRef && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory BarRef.fromJson(Map json) => _$BarRefFromJson(json); - - Map toJson() => _$BarRefToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart deleted file mode 100644 index 2a31af86fb87..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/bar_ref_or_value.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/bar_ref.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'bar_ref_or_value.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class BarRefOrValue { - /// Returns a new [BarRefOrValue] instance. - BarRefOrValue({ - this.href, - required this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: true, includeIfNull: false) - final String id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is BarRefOrValue && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory BarRefOrValue.fromJson(Map json) => - _$BarRefOrValueFromJson(json); - - Map toJson() => _$BarRefOrValueToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart deleted file mode 100644 index dc4ed957e2a0..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/capitalization.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'capitalization.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Capitalization { - /// Returns a new [Capitalization] instance. - Capitalization({ - this.smallCamel, - this.capitalCamel, - this.smallSnake, - this.capitalSnake, - this.sCAETHFlowPoints, - this.ATT_NAME, - }); - - @JsonKey(name: r'smallCamel', required: false, includeIfNull: false) - final String? smallCamel; - - @JsonKey(name: r'CapitalCamel', required: false, includeIfNull: false) - final String? capitalCamel; - - @JsonKey(name: r'small_Snake', required: false, includeIfNull: false) - final String? smallSnake; - - @JsonKey(name: r'Capital_Snake', required: false, includeIfNull: false) - final String? capitalSnake; - - @JsonKey(name: r'SCA_ETH_Flow_Points', required: false, includeIfNull: false) - final String? sCAETHFlowPoints; - - /// Name of the pet - @JsonKey(name: r'ATT_NAME', required: false, includeIfNull: false) - final String? ATT_NAME; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Capitalization && - other.smallCamel == smallCamel && - other.capitalCamel == capitalCamel && - other.smallSnake == smallSnake && - other.capitalSnake == capitalSnake && - other.sCAETHFlowPoints == sCAETHFlowPoints && - other.ATT_NAME == ATT_NAME; - - @override - int get hashCode => - smallCamel.hashCode + - capitalCamel.hashCode + - smallSnake.hashCode + - capitalSnake.hashCode + - sCAETHFlowPoints.hashCode + - ATT_NAME.hashCode; - - factory Capitalization.fromJson(Map json) => - _$CapitalizationFromJson(json); - - Map toJson() => _$CapitalizationToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart deleted file mode 100644 index ae7b2ede17d1..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/cat.dart +++ /dev/null @@ -1,59 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/animal.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'cat.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Cat { - /// Returns a new [Cat] instance. - Cat({ - required this.className, - this.color = r'red', - this.declawed, - }); - - @JsonKey(name: r'className', required: true, includeIfNull: false) - final String className; - - @JsonKey( - defaultValue: r'red', - name: r'color', - required: false, - includeIfNull: false) - final String? color; - - @JsonKey(name: r'declawed', required: false, includeIfNull: false) - final bool? declawed; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Cat && - other.className == className && - other.color == color && - other.declawed == declawed; - - @override - int get hashCode => className.hashCode + color.hashCode + declawed.hashCode; - - factory Cat.fromJson(Map json) => _$CatFromJson(json); - - Map toJson() => _$CatToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart deleted file mode 100644 index 2e4b66ada568..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/category.dart +++ /dev/null @@ -1,50 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'category.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Category { - /// Returns a new [Category] instance. - Category({ - this.id, - this.name = r'default-name', - }); - - @JsonKey(name: r'id', required: false, includeIfNull: false) - final int? id; - - @JsonKey( - defaultValue: r'default-name', - name: r'name', - required: true, - includeIfNull: false) - final String name; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Category && other.id == id && other.name == name; - - @override - int get hashCode => id.hashCode + name.hashCode; - - factory Category.fromJson(Map json) => - _$CategoryFromJson(json); - - Map toJson() => _$CategoryToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart deleted file mode 100644 index 67d589a1edc0..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/class_model.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'class_model.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ClassModel { - /// Returns a new [ClassModel] instance. - ClassModel({ - this.class_, - }); - - @JsonKey(name: r'_class', required: false, includeIfNull: false) - final String? class_; - - @override - bool operator ==(Object other) => - identical(this, other) || other is ClassModel && other.class_ == class_; - - @override - int get hashCode => class_.hashCode; - - factory ClassModel.fromJson(Map json) => - _$ClassModelFromJson(json); - - Map toJson() => _$ClassModelToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart deleted file mode 100644 index 08e1308faee9..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_missing_from_properties.dart +++ /dev/null @@ -1,45 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_missing_from_properties.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_missing_from_properties.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscMissingFromProperties { - /// Returns a new [ComposedDiscMissingFromProperties] instance. - ComposedDiscMissingFromProperties({ - this.length, - }); - - @JsonKey(name: r'length', required: false, includeIfNull: false) - final int? length; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscMissingFromProperties && other.length == length; - - @override - int get hashCode => length.hashCode; - - factory ComposedDiscMissingFromProperties.fromJson( - Map json) => - _$ComposedDiscMissingFromPropertiesFromJson(json); - - Map toJson() => - _$ComposedDiscMissingFromPropertiesToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart deleted file mode 100644 index 21f028fb862e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_correct.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_optional_type_correct.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_optional_type_correct.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscOptionalTypeCorrect { - /// Returns a new [ComposedDiscOptionalTypeCorrect] instance. - ComposedDiscOptionalTypeCorrect({ - this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: false, includeIfNull: false) - final String? fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscOptionalTypeCorrect && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscOptionalTypeCorrect.fromJson(Map json) => - _$ComposedDiscOptionalTypeCorrectFromJson(json); - - Map toJson() => - _$ComposedDiscOptionalTypeCorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart deleted file mode 100644 index a4f6010c43c6..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_inconsistent.dart +++ /dev/null @@ -1,47 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; -import 'package:openapi/src/model/disc_optional_type_correct.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_optional_type_inconsistent.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscOptionalTypeInconsistent { - /// Returns a new [ComposedDiscOptionalTypeInconsistent] instance. - ComposedDiscOptionalTypeInconsistent({ - this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: false, includeIfNull: false) - final String? fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscOptionalTypeInconsistent && - other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscOptionalTypeInconsistent.fromJson( - Map json) => - _$ComposedDiscOptionalTypeInconsistentFromJson(json); - - Map toJson() => - _$ComposedDiscOptionalTypeInconsistentToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart deleted file mode 100644 index 48f2553073f2..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_optional_type_incorrect.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_optional_type_incorrect.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_optional_type_incorrect.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscOptionalTypeIncorrect { - /// Returns a new [ComposedDiscOptionalTypeIncorrect] instance. - ComposedDiscOptionalTypeIncorrect({ - this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: false, includeIfNull: false) - final int? fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscOptionalTypeIncorrect && - other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscOptionalTypeIncorrect.fromJson( - Map json) => - _$ComposedDiscOptionalTypeIncorrectFromJson(json); - - Map toJson() => - _$ComposedDiscOptionalTypeIncorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart deleted file mode 100644 index f87716aa362b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_required_inconsistent.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:openapi/src/model/disc_optional_type_correct.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_required_inconsistent.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscRequiredInconsistent { - /// Returns a new [ComposedDiscRequiredInconsistent] instance. - ComposedDiscRequiredInconsistent({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscRequiredInconsistent && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscRequiredInconsistent.fromJson( - Map json) => - _$ComposedDiscRequiredInconsistentFromJson(json); - - Map toJson() => - _$ComposedDiscRequiredInconsistentToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart deleted file mode 100644 index 5b440eba4b64..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_inconsistent.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_type_incorrect.dart'; -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_type_inconsistent.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscTypeInconsistent { - /// Returns a new [ComposedDiscTypeInconsistent] instance. - ComposedDiscTypeInconsistent({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscTypeInconsistent && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscTypeInconsistent.fromJson(Map json) => - _$ComposedDiscTypeInconsistentFromJson(json); - - Map toJson() => _$ComposedDiscTypeInconsistentToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart deleted file mode 100644 index 8a992123ac93..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/composed_disc_type_incorrect.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/disc_type_incorrect.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'composed_disc_type_incorrect.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ComposedDiscTypeIncorrect { - /// Returns a new [ComposedDiscTypeIncorrect] instance. - ComposedDiscTypeIncorrect({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final int fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ComposedDiscTypeIncorrect && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory ComposedDiscTypeIncorrect.fromJson(Map json) => - _$ComposedDiscTypeIncorrectFromJson(json); - - Map toJson() => _$ComposedDiscTypeIncorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart deleted file mode 100644 index f50ea7760763..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/deprecated_object.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'deprecated_object.g.dart'; - -@Deprecated('DeprecatedObject has been deprecated') -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DeprecatedObject { - /// Returns a new [DeprecatedObject] instance. - DeprecatedObject({ - this.name, - }); - - @JsonKey(name: r'name', required: false, includeIfNull: false) - final String? name; - - @override - bool operator ==(Object other) => - identical(this, other) || other is DeprecatedObject && other.name == name; - - @override - int get hashCode => name.hashCode; - - factory DeprecatedObject.fromJson(Map json) => - _$DeprecatedObjectFromJson(json); - - Map toJson() => _$DeprecatedObjectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart deleted file mode 100644 index 2f681cebf74d..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_missing_from_properties.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'disc_missing_from_properties.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DiscMissingFromProperties { - /// Returns a new [DiscMissingFromProperties] instance. - DiscMissingFromProperties({ - this.length, - }); - - @JsonKey(name: r'length', required: false, includeIfNull: false) - final int? length; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is DiscMissingFromProperties && other.length == length; - - @override - int get hashCode => length.hashCode; - - factory DiscMissingFromProperties.fromJson(Map json) => - _$DiscMissingFromPropertiesFromJson(json); - - Map toJson() => _$DiscMissingFromPropertiesToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart deleted file mode 100644 index 8f8a23825311..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_correct.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'disc_optional_type_correct.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DiscOptionalTypeCorrect { - /// Returns a new [DiscOptionalTypeCorrect] instance. - DiscOptionalTypeCorrect({ - this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: false, includeIfNull: false) - final String? fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is DiscOptionalTypeCorrect && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory DiscOptionalTypeCorrect.fromJson(Map json) => - _$DiscOptionalTypeCorrectFromJson(json); - - Map toJson() => _$DiscOptionalTypeCorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart deleted file mode 100644 index 3a9fe6ccc87b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_optional_type_incorrect.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'disc_optional_type_incorrect.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DiscOptionalTypeIncorrect { - /// Returns a new [DiscOptionalTypeIncorrect] instance. - DiscOptionalTypeIncorrect({ - this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: false, includeIfNull: false) - final int? fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is DiscOptionalTypeIncorrect && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory DiscOptionalTypeIncorrect.fromJson(Map json) => - _$DiscOptionalTypeIncorrectFromJson(json); - - Map toJson() => _$DiscOptionalTypeIncorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart deleted file mode 100644 index da5e8dbd17cd..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/disc_type_incorrect.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'disc_type_incorrect.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class DiscTypeIncorrect { - /// Returns a new [DiscTypeIncorrect] instance. - DiscTypeIncorrect({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final int fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is DiscTypeIncorrect && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory DiscTypeIncorrect.fromJson(Map json) => - _$DiscTypeIncorrectFromJson(json); - - Map toJson() => _$DiscTypeIncorrectToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart deleted file mode 100644 index 074bd2f07075..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/dog.dart +++ /dev/null @@ -1,59 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/animal.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'dog.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Dog { - /// Returns a new [Dog] instance. - Dog({ - required this.className, - this.color = r'red', - this.breed, - }); - - @JsonKey(name: r'className', required: true, includeIfNull: false) - final String className; - - @JsonKey( - defaultValue: r'red', - name: r'color', - required: false, - includeIfNull: false) - final String? color; - - @JsonKey(name: r'breed', required: false, includeIfNull: false) - final String? breed; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Dog && - other.className == className && - other.color == color && - other.breed == breed; - - @override - int get hashCode => className.hashCode + color.hashCode + breed.hashCode; - - factory Dog.fromJson(Map json) => _$DogFromJson(json); - - Map toJson() => _$DogToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart deleted file mode 100644 index 9bba5eff8b34..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'entity.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Entity { - /// Returns a new [Entity] instance. - Entity({ - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Entity && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory Entity.fromJson(Map json) => _$EntityFromJson(json); - - Map toJson() => _$EntityToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart deleted file mode 100644 index 32901f43eaa9..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/entity_ref.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'entity_ref.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class EntityRef { - /// Returns a new [EntityRef] instance. - EntityRef({ - this.name, - this.atReferredType, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// Name of the related entity. - @JsonKey(name: r'name', required: false, includeIfNull: false) - final String? name; - - /// The actual type of the target instance when needed for disambiguation. - @JsonKey(name: r'@referredType', required: false, includeIfNull: false) - final String? atReferredType; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is EntityRef && - other.name == name && - other.atReferredType == atReferredType && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - name.hashCode + - atReferredType.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory EntityRef.fromJson(Map json) => - _$EntityRefFromJson(json); - - Map toJson() => _$EntityRefToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart deleted file mode 100644 index 4a9ce1458928..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_arrays.dart +++ /dev/null @@ -1,66 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'enum_arrays.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class EnumArrays { - /// Returns a new [EnumArrays] instance. - EnumArrays({ - this.justSymbol, - this.arrayEnum, - }); - - @JsonKey(name: r'just_symbol', required: false, includeIfNull: false) - final EnumArraysJustSymbolEnum? justSymbol; - - @JsonKey(name: r'array_enum', required: false, includeIfNull: false) - final List? arrayEnum; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is EnumArrays && - other.justSymbol == justSymbol && - other.arrayEnum == arrayEnum; - - @override - int get hashCode => justSymbol.hashCode + arrayEnum.hashCode; - - factory EnumArrays.fromJson(Map json) => - _$EnumArraysFromJson(json); - - Map toJson() => _$EnumArraysToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} - -enum EnumArraysJustSymbolEnum { - @JsonValue(r'>=') - greaterThanEqual, - @JsonValue(r'$') - dollar, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - -enum EnumArraysArrayEnumEnum { - @JsonValue(r'fish') - fish, - @JsonValue(r'crab') - crab, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart deleted file mode 100644 index 926b40e5977f..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/enum_test.dart +++ /dev/null @@ -1,134 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'enum_test.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class EnumTest { - /// Returns a new [EnumTest] instance. - EnumTest({ - this.enumString, - required this.enumStringRequired, - this.enumInteger, - this.enumNumber, - this.outerEnum, - this.outerEnumInteger, - this.outerEnumDefaultValue, - this.outerEnumIntegerDefaultValue, - }); - - @JsonKey(name: r'enum_string', required: false, includeIfNull: false) - final EnumTestEnumStringEnum? enumString; - - @JsonKey(name: r'enum_string_required', required: true, includeIfNull: false) - final EnumTestEnumStringRequiredEnum enumStringRequired; - - @JsonKey(name: r'enum_integer', required: false, includeIfNull: false) - final EnumTestEnumIntegerEnum? enumInteger; - - @JsonKey(name: r'enum_number', required: false, includeIfNull: false) - final EnumTestEnumNumberEnum? enumNumber; - - @JsonKey(name: r'outerEnum', required: false, includeIfNull: false) - final OuterEnum? outerEnum; - - @JsonKey(name: r'outerEnumInteger', required: false, includeIfNull: false) - final OuterEnumInteger? outerEnumInteger; - - @JsonKey( - name: r'outerEnumDefaultValue', required: false, includeIfNull: false) - final OuterEnumDefaultValue? outerEnumDefaultValue; - - @JsonKey( - name: r'outerEnumIntegerDefaultValue', - required: false, - includeIfNull: false) - final OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is EnumTest && - other.enumString == enumString && - other.enumStringRequired == enumStringRequired && - other.enumInteger == enumInteger && - other.enumNumber == enumNumber && - other.outerEnum == outerEnum && - other.outerEnumInteger == outerEnumInteger && - other.outerEnumDefaultValue == outerEnumDefaultValue && - other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; - - @override - int get hashCode => - enumString.hashCode + - enumStringRequired.hashCode + - enumInteger.hashCode + - enumNumber.hashCode + - (outerEnum == null ? 0 : outerEnum.hashCode) + - outerEnumInteger.hashCode + - outerEnumDefaultValue.hashCode + - outerEnumIntegerDefaultValue.hashCode; - - factory EnumTest.fromJson(Map json) => - _$EnumTestFromJson(json); - - Map toJson() => _$EnumTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} - -enum EnumTestEnumStringEnum { - @JsonValue(r'UPPER') - UPPER, - @JsonValue(r'lower') - lower, - @JsonValue(r'') - empty, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - -enum EnumTestEnumStringRequiredEnum { - @JsonValue(r'UPPER') - UPPER, - @JsonValue(r'lower') - lower, - @JsonValue(r'') - empty, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - -enum EnumTestEnumIntegerEnum { - @JsonValue(1) - number1, - @JsonValue(-1) - numberNegative1, - @JsonValue(11184809) - unknownDefaultOpenApi, -} - -enum EnumTestEnumNumberEnum { - @JsonValue('1.1') - number1Period1, - @JsonValue('-1.2') - numberNegative1Period2, - @JsonValue('11184809') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart deleted file mode 100644 index bad2e3789836..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/extensible.dart +++ /dev/null @@ -1,57 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'extensible.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Extensible { - /// Returns a new [Extensible] instance. - Extensible({ - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Extensible && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - atSchemaLocation.hashCode + atBaseType.hashCode + atType.hashCode; - - factory Extensible.fromJson(Map json) => - _$ExtensibleFromJson(json); - - Map toJson() => _$ExtensibleToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart deleted file mode 100644 index 3da04204b0b2..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/file_schema_test_class.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/model_file.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'file_schema_test_class.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FileSchemaTestClass { - /// Returns a new [FileSchemaTestClass] instance. - FileSchemaTestClass({ - this.file, - this.files, - }); - - @JsonKey(name: r'file', required: false, includeIfNull: false) - final ModelFile? file; - - @JsonKey(name: r'files', required: false, includeIfNull: false) - final List? files; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FileSchemaTestClass && - other.file == file && - other.files == files; - - @override - int get hashCode => file.hashCode + files.hashCode; - - factory FileSchemaTestClass.fromJson(Map json) => - _$FileSchemaTestClassFromJson(json); - - Map toJson() => _$FileSchemaTestClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart deleted file mode 100644 index 5fbd0e3f800a..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'foo.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Foo { - /// Returns a new [Foo] instance. - Foo({ - this.fooPropA, - this.fooPropB, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'fooPropA', required: false, includeIfNull: false) - final String? fooPropA; - - @JsonKey(name: r'fooPropB', required: false, includeIfNull: false) - final String? fooPropB; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Foo && - other.fooPropA == fooPropA && - other.fooPropB == fooPropB && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - fooPropA.hashCode + - fooPropB.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory Foo.fromJson(Map json) => _$FooFromJson(json); - - Map toJson() => _$FooToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart deleted file mode 100644 index 5a80aca5aeb1..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_basic_get_default_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'foo_basic_get_default_response.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FooBasicGetDefaultResponse { - /// Returns a new [FooBasicGetDefaultResponse] instance. - FooBasicGetDefaultResponse({ - this.string, - }); - - @JsonKey(name: r'string', required: false, includeIfNull: false) - final Foo? string; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FooBasicGetDefaultResponse && other.string == string; - - @override - int get hashCode => string.hashCode; - - factory FooBasicGetDefaultResponse.fromJson(Map json) => - _$FooBasicGetDefaultResponseFromJson(json); - - Map toJson() => _$FooBasicGetDefaultResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart deleted file mode 100644 index 1e0ec166fb66..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref.dart +++ /dev/null @@ -1,81 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity_ref.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'foo_ref.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FooRef { - /// Returns a new [FooRef] instance. - FooRef({ - this.foorefPropA, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'foorefPropA', required: false, includeIfNull: false) - final String? foorefPropA; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FooRef && - other.foorefPropA == foorefPropA && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - foorefPropA.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory FooRef.fromJson(Map json) => _$FooRefFromJson(json); - - Map toJson() => _$FooRefToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart deleted file mode 100644 index f71d4b51f73e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/foo_ref_or_value.dart +++ /dev/null @@ -1,75 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/foo_ref.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'foo_ref_or_value.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FooRefOrValue { - /// Returns a new [FooRefOrValue] instance. - FooRefOrValue({ - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FooRefOrValue && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory FooRefOrValue.fromJson(Map json) => - _$FooRefOrValueFromJson(json); - - Map toJson() => _$FooRefOrValueToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart deleted file mode 100644 index f036a62c2df5..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/format_test.dart +++ /dev/null @@ -1,150 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:dio/dio.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'format_test.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FormatTest { - /// Returns a new [FormatTest] instance. - FormatTest({ - this.integer, - this.int32, - this.int64, - required this.number, - this.float, - this.double_, - this.decimal, - this.string, - required this.byte, - this.binary, - required this.date, - this.dateTime, - this.uuid, - required this.password, - this.patternWithDigits, - this.patternWithDigitsAndDelimiter, - }); - - // minimum: 10 - // maximum: 100 - @JsonKey(name: r'integer', required: false, includeIfNull: false) - final int? integer; - - // minimum: 20 - // maximum: 200 - @JsonKey(name: r'int32', required: false, includeIfNull: false) - final int? int32; - - @JsonKey(name: r'int64', required: false, includeIfNull: false) - final int? int64; - - // minimum: 32.1 - // maximum: 543.2 - @JsonKey(name: r'number', required: true, includeIfNull: false) - final num number; - - // minimum: 54.3 - // maximum: 987.6 - @JsonKey(name: r'float', required: false, includeIfNull: false) - final double? float; - - // minimum: 67.8 - // maximum: 123.4 - @JsonKey(name: r'double', required: false, includeIfNull: false) - final double? double_; - - @JsonKey(name: r'decimal', required: false, includeIfNull: false) - final double? decimal; - - @JsonKey(name: r'string', required: false, includeIfNull: false) - final String? string; - - @JsonKey(name: r'byte', required: true, includeIfNull: false) - final String byte; - - @JsonKey(ignore: true) - final MultipartFile? binary; - - @JsonKey(name: r'date', required: true, includeIfNull: false) - final DateTime date; - - @JsonKey(name: r'dateTime', required: false, includeIfNull: false) - final DateTime? dateTime; - - @JsonKey(name: r'uuid', required: false, includeIfNull: false) - final String? uuid; - - @JsonKey(name: r'password', required: true, includeIfNull: false) - final String password; - - /// A string that is a 10 digit number. Can have leading zeros. - @JsonKey(name: r'pattern_with_digits', required: false, includeIfNull: false) - final String? patternWithDigits; - - /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - @JsonKey( - name: r'pattern_with_digits_and_delimiter', - required: false, - includeIfNull: false) - final String? patternWithDigitsAndDelimiter; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FormatTest && - other.integer == integer && - other.int32 == int32 && - other.int64 == int64 && - other.number == number && - other.float == float && - other.double_ == double_ && - other.decimal == decimal && - other.string == string && - other.byte == byte && - other.binary == binary && - other.date == date && - other.dateTime == dateTime && - other.uuid == uuid && - other.password == password && - other.patternWithDigits == patternWithDigits && - other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; - - @override - int get hashCode => - integer.hashCode + - int32.hashCode + - int64.hashCode + - number.hashCode + - float.hashCode + - double_.hashCode + - decimal.hashCode + - string.hashCode + - byte.hashCode + - binary.hashCode + - date.hashCode + - dateTime.hashCode + - uuid.hashCode + - password.hashCode + - patternWithDigits.hashCode + - patternWithDigitsAndDelimiter.hashCode; - - factory FormatTest.fromJson(Map json) => - _$FormatTestFromJson(json); - - Map toJson() => _$FormatTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart deleted file mode 100644 index ecbad5014c05..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/apple.dart'; -import 'package:openapi/src/model/banana.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Fruit { - /// Returns a new [Fruit] instance. - Fruit({ - this.color, - this.kind, - this.count, - }); - - @JsonKey(name: r'color', required: false, includeIfNull: false) - final String? color; - - @JsonKey(name: r'kind', required: false, includeIfNull: false) - final String? kind; - - @JsonKey(name: r'count', required: false, includeIfNull: false) - final num? count; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Fruit && - other.color == color && - other.kind == kind && - other.count == count; - - @override - int get hashCode => color.hashCode + kind.hashCode + count.hashCode; - - factory Fruit.fromJson(Map json) => _$FruitFromJson(json); - - Map toJson() => _$FruitToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart deleted file mode 100644 index 1dfb20c86bdf..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_all_of_disc.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/banana_all_of_disc.dart'; -import 'package:openapi/src/model/apple_all_of_disc.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_all_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitAllOfDisc { - /// Returns a new [FruitAllOfDisc] instance. - FruitAllOfDisc({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitAllOfDisc && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitAllOfDisc.fromJson(Map json) => - _$FruitAllOfDiscFromJson(json); - - Map toJson() => _$FruitAllOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart deleted file mode 100644 index 17b80eed8f24..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_any_of_disc.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_type.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_any_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitAnyOfDisc { - /// Returns a new [FruitAnyOfDisc] instance. - FruitAnyOfDisc({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitAnyOfDisc && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitAnyOfDisc.fromJson(Map json) => - _$FruitAnyOfDiscFromJson(json); - - Map toJson() => _$FruitAnyOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart deleted file mode 100644 index 463288870973..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_grandparent_disc.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/banana_grandparent_disc.dart'; -import 'package:openapi/src/model/apple_grandparent_disc.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_grandparent_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitGrandparentDisc { - /// Returns a new [FruitGrandparentDisc] instance. - FruitGrandparentDisc({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitGrandparentDisc && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitGrandparentDisc.fromJson(Map json) => - _$FruitGrandparentDiscFromJson(json); - - Map toJson() => _$FruitGrandparentDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart deleted file mode 100644 index df523bdbac52..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc.dart +++ /dev/null @@ -1,55 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_inline_disc_one_of.dart'; -import 'package:openapi/src/model/fruit_inline_disc_one_of1.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineDisc { - /// Returns a new [FruitInlineDisc] instance. - FruitInlineDisc({ - required this.seeds, - required this.fruitType, - required this.length, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineDisc && - other.seeds == seeds && - other.fruitType == fruitType && - other.length == length; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode + length.hashCode; - - factory FruitInlineDisc.fromJson(Map json) => - _$FruitInlineDiscFromJson(json); - - Map toJson() => _$FruitInlineDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart deleted file mode 100644 index 6b438ff6b6ac..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_disc_one_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineDiscOneOf { - /// Returns a new [FruitInlineDiscOneOf] instance. - FruitInlineDiscOneOf({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineDiscOneOf && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory FruitInlineDiscOneOf.fromJson(Map json) => - _$FruitInlineDiscOneOfFromJson(json); - - Map toJson() => _$FruitInlineDiscOneOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart deleted file mode 100644 index 757b16888d56..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_disc_one_of1.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_disc_one_of1.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineDiscOneOf1 { - /// Returns a new [FruitInlineDiscOneOf1] instance. - FruitInlineDiscOneOf1({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineDiscOneOf1 && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory FruitInlineDiscOneOf1.fromJson(Map json) => - _$FruitInlineDiscOneOf1FromJson(json); - - Map toJson() => _$FruitInlineDiscOneOf1ToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart deleted file mode 100644 index f0b7a0a5752b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_inline_inline_disc_one_of.dart'; -import 'package:openapi/src/model/fruit_inline_inline_disc_one_of1.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_inline_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineInlineDisc { - /// Returns a new [FruitInlineInlineDisc] instance. - FruitInlineInlineDisc({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineInlineDisc && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitInlineInlineDisc.fromJson(Map json) => - _$FruitInlineInlineDiscFromJson(json); - - Map toJson() => _$FruitInlineInlineDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart deleted file mode 100644 index 415d864f8102..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_inline_disc_one_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineInlineDiscOneOf { - /// Returns a new [FruitInlineInlineDiscOneOf] instance. - FruitInlineInlineDiscOneOf({ - required this.seeds, - required this.fruitType, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineInlineDiscOneOf && - other.seeds == seeds && - other.fruitType == fruitType; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode; - - factory FruitInlineInlineDiscOneOf.fromJson(Map json) => - _$FruitInlineInlineDiscOneOfFromJson(json); - - Map toJson() => _$FruitInlineInlineDiscOneOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart deleted file mode 100644 index 38d499a0028e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of1.dart +++ /dev/null @@ -1,49 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/fruit_inline_inline_disc_one_of_one_of.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_inline_disc_one_of1.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineInlineDiscOneOf1 { - /// Returns a new [FruitInlineInlineDiscOneOf1] instance. - FruitInlineInlineDiscOneOf1({ - required this.length, - required this.fruitType, - }); - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineInlineDiscOneOf1 && - other.length == length && - other.fruitType == fruitType; - - @override - int get hashCode => length.hashCode + fruitType.hashCode; - - factory FruitInlineInlineDiscOneOf1.fromJson(Map json) => - _$FruitInlineInlineDiscOneOf1FromJson(json); - - Map toJson() => _$FruitInlineInlineDiscOneOf1ToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart deleted file mode 100644 index 11d217bfaf39..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_inline_inline_disc_one_of_one_of.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_inline_inline_disc_one_of_one_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitInlineInlineDiscOneOfOneOf { - /// Returns a new [FruitInlineInlineDiscOneOfOneOf] instance. - FruitInlineInlineDiscOneOfOneOf({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitInlineInlineDiscOneOfOneOf && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitInlineInlineDiscOneOfOneOf.fromJson(Map json) => - _$FruitInlineInlineDiscOneOfOneOfFromJson(json); - - Map toJson() => - _$FruitInlineInlineDiscOneOfOneOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart deleted file mode 100644 index fc23181223cb..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_one_of_disc.dart +++ /dev/null @@ -1,44 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/banana_one_of_disc.dart'; -import 'package:openapi/src/model/apple_one_of_disc.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_one_of_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitOneOfDisc { - /// Returns a new [FruitOneOfDisc] instance. - FruitOneOfDisc({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitOneOfDisc && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitOneOfDisc.fromJson(Map json) => - _$FruitOneOfDiscFromJson(json); - - Map toJson() => _$FruitOneOfDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart deleted file mode 100644 index f538751ea55d..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_req_disc.dart +++ /dev/null @@ -1,55 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/banana_req_disc.dart'; -import 'package:openapi/src/model/apple_req_disc.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_req_disc.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitReqDisc { - /// Returns a new [FruitReqDisc] instance. - FruitReqDisc({ - required this.seeds, - required this.fruitType, - required this.length, - }); - - @JsonKey(name: r'seeds', required: true, includeIfNull: false) - final int seeds; - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @JsonKey(name: r'length', required: true, includeIfNull: false) - final int length; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitReqDisc && - other.seeds == seeds && - other.fruitType == fruitType && - other.length == length; - - @override - int get hashCode => seeds.hashCode + fruitType.hashCode + length.hashCode; - - factory FruitReqDisc.fromJson(Map json) => - _$FruitReqDiscFromJson(json); - - Map toJson() => _$FruitReqDiscToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart deleted file mode 100644 index eafe4ed0efbe..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_type.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_type.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitType { - /// Returns a new [FruitType] instance. - FruitType({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitType && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory FruitType.fromJson(Map json) => - _$FruitTypeFromJson(json); - - Map toJson() => _$FruitTypeToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart deleted file mode 100644 index 4412252bd71e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/fruit_variant1.dart +++ /dev/null @@ -1,48 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/apple_variant1.dart'; -import 'package:openapi/src/model/grape_variant1.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'fruit_variant1.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class FruitVariant1 { - /// Returns a new [FruitVariant1] instance. - FruitVariant1({ - this.color, - this.kind, - }); - - @JsonKey(name: r'color', required: false, includeIfNull: false) - final String? color; - - @JsonKey(name: r'kind', required: false, includeIfNull: false) - final String? kind; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is FruitVariant1 && other.color == color && other.kind == kind; - - @override - int get hashCode => color.hashCode + kind.hashCode; - - factory FruitVariant1.fromJson(Map json) => - _$FruitVariant1FromJson(json); - - Map toJson() => _$FruitVariant1ToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart deleted file mode 100644 index 5d823893c7ad..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/giga_one_of.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/one_of_primitive_child.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'giga_one_of.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class GigaOneOf { - /// Returns a new [GigaOneOf] instance. - GigaOneOf({ - this.name, - }); - - @JsonKey(name: r'name', required: false, includeIfNull: false) - final String? name; - - @override - bool operator ==(Object other) => - identical(this, other) || other is GigaOneOf && other.name == name; - - @override - int get hashCode => name.hashCode; - - factory GigaOneOf.fromJson(Map json) => - _$GigaOneOfFromJson(json); - - Map toJson() => _$GigaOneOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart deleted file mode 100644 index 6f8d7d97722b..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/grape_variant1.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'grape_variant1.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class GrapeVariant1 { - /// Returns a new [GrapeVariant1] instance. - GrapeVariant1({ - this.color, - }); - - @JsonKey(name: r'color', required: false, includeIfNull: false) - final String? color; - - @override - bool operator ==(Object other) => - identical(this, other) || other is GrapeVariant1 && other.color == color; - - @override - int get hashCode => color.hashCode; - - factory GrapeVariant1.fromJson(Map json) => - _$GrapeVariant1FromJson(json); - - Map toJson() => _$GrapeVariant1ToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart deleted file mode 100644 index ed6a55c59d03..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/has_only_read_only.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'has_only_read_only.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class HasOnlyReadOnly { - /// Returns a new [HasOnlyReadOnly] instance. - HasOnlyReadOnly({ - this.bar, - this.foo, - }); - - @JsonKey(name: r'bar', required: false, includeIfNull: false) - final String? bar; - - @JsonKey(name: r'foo', required: false, includeIfNull: false) - final String? foo; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is HasOnlyReadOnly && other.bar == bar && other.foo == foo; - - @override - int get hashCode => bar.hashCode + foo.hashCode; - - factory HasOnlyReadOnly.fromJson(Map json) => - _$HasOnlyReadOnlyFromJson(json); - - Map toJson() => _$HasOnlyReadOnlyToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart deleted file mode 100644 index e14245b733fe..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/health_check_result.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'health_check_result.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class HealthCheckResult { - /// Returns a new [HealthCheckResult] instance. - HealthCheckResult({ - this.nullableMessage, - }); - - @JsonKey(name: r'NullableMessage', required: false, includeIfNull: false) - final String? nullableMessage; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is HealthCheckResult && other.nullableMessage == nullableMessage; - - @override - int get hashCode => (nullableMessage == null ? 0 : nullableMessage.hashCode); - - factory HealthCheckResult.fromJson(Map json) => - _$HealthCheckResultFromJson(json); - - Map toJson() => _$HealthCheckResultToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart deleted file mode 100644 index 68f69e6ab300..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/map_test.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'map_test.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class MapTest { - /// Returns a new [MapTest] instance. - MapTest({ - this.mapMapOfString, - this.mapOfEnumString, - this.directMap, - this.indirectMap, - }); - - @JsonKey(name: r'map_map_of_string', required: false, includeIfNull: false) - final Map>? mapMapOfString; - - @JsonKey(name: r'map_of_enum_string', required: false, includeIfNull: false) - final Map? mapOfEnumString; - - @JsonKey(name: r'direct_map', required: false, includeIfNull: false) - final Map? directMap; - - @JsonKey(name: r'indirect_map', required: false, includeIfNull: false) - final Map? indirectMap; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is MapTest && - other.mapMapOfString == mapMapOfString && - other.mapOfEnumString == mapOfEnumString && - other.directMap == directMap && - other.indirectMap == indirectMap; - - @override - int get hashCode => - mapMapOfString.hashCode + - mapOfEnumString.hashCode + - directMap.hashCode + - indirectMap.hashCode; - - factory MapTest.fromJson(Map json) => - _$MapTestFromJson(json); - - Map toJson() => _$MapTestToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} - -enum MapTestMapOfEnumStringEnum { - @JsonValue(r'UPPER') - UPPER, - @JsonValue(r'lower') - lower, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart deleted file mode 100644 index 7045930e1616..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ /dev/null @@ -1,56 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/animal.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'mixed_properties_and_additional_properties_class.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class MixedPropertiesAndAdditionalPropertiesClass { - /// Returns a new [MixedPropertiesAndAdditionalPropertiesClass] instance. - MixedPropertiesAndAdditionalPropertiesClass({ - this.uuid, - this.dateTime, - this.map, - }); - - @JsonKey(name: r'uuid', required: false, includeIfNull: false) - final String? uuid; - - @JsonKey(name: r'dateTime', required: false, includeIfNull: false) - final DateTime? dateTime; - - @JsonKey(name: r'map', required: false, includeIfNull: false) - final Map? map; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is MixedPropertiesAndAdditionalPropertiesClass && - other.uuid == uuid && - other.dateTime == dateTime && - other.map == map; - - @override - int get hashCode => uuid.hashCode + dateTime.hashCode + map.hashCode; - - factory MixedPropertiesAndAdditionalPropertiesClass.fromJson( - Map json) => - _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); - - Map toJson() => - _$MixedPropertiesAndAdditionalPropertiesClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart deleted file mode 100644 index 31f363f60b96..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model200_response.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'model200_response.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Model200Response { - /// Returns a new [Model200Response] instance. - Model200Response({ - this.name, - this.class_, - }); - - @JsonKey(name: r'name', required: false, includeIfNull: false) - final int? name; - - @JsonKey(name: r'class', required: false, includeIfNull: false) - final String? class_; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Model200Response && other.name == name && other.class_ == class_; - - @override - int get hashCode => name.hashCode + class_.hashCode; - - factory Model200Response.fromJson(Map json) => - _$Model200ResponseFromJson(json); - - Map toJson() => _$Model200ResponseToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart deleted file mode 100644 index 420ab5a1f4dd..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_client.dart +++ /dev/null @@ -1,41 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'model_client.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ModelClient { - /// Returns a new [ModelClient] instance. - ModelClient({ - this.client, - }); - - @JsonKey(name: r'client', required: false, includeIfNull: false) - final String? client; - - @override - bool operator ==(Object other) => - identical(this, other) || other is ModelClient && other.client == client; - - @override - int get hashCode => client.hashCode; - - factory ModelClient.fromJson(Map json) => - _$ModelClientFromJson(json); - - Map toJson() => _$ModelClientToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart deleted file mode 100644 index 67b79a2a5c9a..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_enum_class.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum ModelEnumClass { - @JsonValue(r'_abc') - abc, - @JsonValue(r'-efg') - efg, - @JsonValue(r'(xyz)') - leftParenthesisXyzRightParenthesis, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart deleted file mode 100644 index 24ab5b777009..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_file.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'model_file.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ModelFile { - /// Returns a new [ModelFile] instance. - ModelFile({ - this.sourceURI, - }); - - /// Test capitalization - @JsonKey(name: r'sourceURI', required: false, includeIfNull: false) - final String? sourceURI; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ModelFile && other.sourceURI == sourceURI; - - @override - int get hashCode => sourceURI.hashCode; - - factory ModelFile.fromJson(Map json) => - _$ModelFileFromJson(json); - - Map toJson() => _$ModelFileToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart deleted file mode 100644 index b2d3f190af9e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_list.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'model_list.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ModelList { - /// Returns a new [ModelList] instance. - ModelList({ - this.n123list, - }); - - @JsonKey(name: r'123-list', required: false, includeIfNull: false) - final String? n123list; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ModelList && other.n123list == n123list; - - @override - int get hashCode => n123list.hashCode; - - factory ModelList.fromJson(Map json) => - _$ModelListFromJson(json); - - Map toJson() => _$ModelListToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart deleted file mode 100644 index 1d2547c95628..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/model_return.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'model_return.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ModelReturn { - /// Returns a new [ModelReturn] instance. - ModelReturn({ - this.return_, - }); - - @JsonKey(name: r'return', required: false, includeIfNull: false) - final int? return_; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ModelReturn && other.return_ == return_; - - @override - int get hashCode => return_.hashCode; - - factory ModelReturn.fromJson(Map json) => - _$ModelReturnFromJson(json); - - Map toJson() => _$ModelReturnToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart deleted file mode 100644 index 0aad5dcc0480..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/name.dart +++ /dev/null @@ -1,61 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'name.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Name { - /// Returns a new [Name] instance. - Name({ - required this.name, - this.snakeCase, - this.property, - this.n123number, - }); - - @JsonKey(name: r'name', required: true, includeIfNull: false) - final int name; - - @JsonKey(name: r'snake_case', required: false, includeIfNull: false) - final int? snakeCase; - - @JsonKey(name: r'property', required: false, includeIfNull: false) - final String? property; - - @JsonKey(name: r'123Number', required: false, includeIfNull: false) - final int? n123number; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Name && - other.name == name && - other.snakeCase == snakeCase && - other.property == property && - other.n123number == n123number; - - @override - int get hashCode => - name.hashCode + - snakeCase.hashCode + - property.hashCode + - n123number.hashCode; - - factory Name.fromJson(Map json) => _$NameFromJson(json); - - Map toJson() => _$NameToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart deleted file mode 100644 index 66e3f84395b6..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/nullable_class.dart +++ /dev/null @@ -1,121 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'nullable_class.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class NullableClass { - /// Returns a new [NullableClass] instance. - NullableClass({ - this.integerProp, - this.numberProp, - this.booleanProp, - this.stringProp, - this.dateProp, - this.datetimeProp, - this.arrayNullableProp, - this.arrayAndItemsNullableProp, - this.arrayItemsNullable, - this.objectNullableProp, - this.objectAndItemsNullableProp, - this.objectItemsNullable, - }); - - @JsonKey(name: r'integer_prop', required: false, includeIfNull: false) - final int? integerProp; - - @JsonKey(name: r'number_prop', required: false, includeIfNull: false) - final num? numberProp; - - @JsonKey(name: r'boolean_prop', required: false, includeIfNull: false) - final bool? booleanProp; - - @JsonKey(name: r'string_prop', required: false, includeIfNull: false) - final String? stringProp; - - @JsonKey(name: r'date_prop', required: false, includeIfNull: false) - final DateTime? dateProp; - - @JsonKey(name: r'datetime_prop', required: false, includeIfNull: false) - final DateTime? datetimeProp; - - @JsonKey(name: r'array_nullable_prop', required: false, includeIfNull: false) - final List? arrayNullableProp; - - @JsonKey( - name: r'array_and_items_nullable_prop', - required: false, - includeIfNull: false) - final List? arrayAndItemsNullableProp; - - @JsonKey(name: r'array_items_nullable', required: false, includeIfNull: false) - final List? arrayItemsNullable; - - @JsonKey(name: r'object_nullable_prop', required: false, includeIfNull: false) - final Map? objectNullableProp; - - @JsonKey( - name: r'object_and_items_nullable_prop', - required: false, - includeIfNull: false) - final Map? objectAndItemsNullableProp; - - @JsonKey( - name: r'object_items_nullable', required: false, includeIfNull: false) - final Map? objectItemsNullable; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is NullableClass && - other.integerProp == integerProp && - other.numberProp == numberProp && - other.booleanProp == booleanProp && - other.stringProp == stringProp && - other.dateProp == dateProp && - other.datetimeProp == datetimeProp && - other.arrayNullableProp == arrayNullableProp && - other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && - other.arrayItemsNullable == arrayItemsNullable && - other.objectNullableProp == objectNullableProp && - other.objectAndItemsNullableProp == objectAndItemsNullableProp && - other.objectItemsNullable == objectItemsNullable; - - @override - int get hashCode => - (integerProp == null ? 0 : integerProp.hashCode) + - (numberProp == null ? 0 : numberProp.hashCode) + - (booleanProp == null ? 0 : booleanProp.hashCode) + - (stringProp == null ? 0 : stringProp.hashCode) + - (dateProp == null ? 0 : dateProp.hashCode) + - (datetimeProp == null ? 0 : datetimeProp.hashCode) + - (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + - (arrayAndItemsNullableProp == null - ? 0 - : arrayAndItemsNullableProp.hashCode) + - arrayItemsNullable.hashCode + - (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + - (objectAndItemsNullableProp == null - ? 0 - : objectAndItemsNullableProp.hashCode) + - objectItemsNullable.hashCode; - - factory NullableClass.fromJson(Map json) => - _$NullableClassFromJson(json); - - Map toJson() => _$NullableClassToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart deleted file mode 100644 index 75022ee68437..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/number_only.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'number_only.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class NumberOnly { - /// Returns a new [NumberOnly] instance. - NumberOnly({ - this.justNumber, - }); - - @JsonKey(name: r'JustNumber', required: false, includeIfNull: false) - final num? justNumber; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is NumberOnly && other.justNumber == justNumber; - - @override - int get hashCode => justNumber.hashCode; - - factory NumberOnly.fromJson(Map json) => - _$NumberOnlyFromJson(json); - - Map toJson() => _$NumberOnlyToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart deleted file mode 100644 index fc0b71e6fe86..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/object_with_deprecated_fields.dart +++ /dev/null @@ -1,64 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:openapi/src/model/bar.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'object_with_deprecated_fields.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ObjectWithDeprecatedFields { - /// Returns a new [ObjectWithDeprecatedFields] instance. - ObjectWithDeprecatedFields({ - this.uuid, - this.id, - this.deprecatedRef, - this.bars, - }); - - @JsonKey(name: r'uuid', required: false, includeIfNull: false) - final String? uuid; - - @Deprecated('id has been deprecated') - @JsonKey(name: r'id', required: false, includeIfNull: false) - final num? id; - - @Deprecated('deprecatedRef has been deprecated') - @JsonKey(name: r'deprecatedRef', required: false, includeIfNull: false) - final DeprecatedObject? deprecatedRef; - - @Deprecated('bars has been deprecated') - @JsonKey(name: r'bars', required: false, includeIfNull: false) - final List? bars; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ObjectWithDeprecatedFields && - other.uuid == uuid && - other.id == id && - other.deprecatedRef == deprecatedRef && - other.bars == bars; - - @override - int get hashCode => - uuid.hashCode + id.hashCode + deprecatedRef.hashCode + bars.hashCode; - - factory ObjectWithDeprecatedFields.fromJson(Map json) => - _$ObjectWithDeprecatedFieldsFromJson(json); - - Map toJson() => _$ObjectWithDeprecatedFieldsToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart deleted file mode 100644 index f468d2d44086..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/one_of_primitive_child.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'one_of_primitive_child.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class OneOfPrimitiveChild { - /// Returns a new [OneOfPrimitiveChild] instance. - OneOfPrimitiveChild({ - this.name, - }); - - @JsonKey(name: r'name', required: false, includeIfNull: false) - final String? name; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is OneOfPrimitiveChild && other.name == name; - - @override - int get hashCode => name.hashCode; - - factory OneOfPrimitiveChild.fromJson(Map json) => - _$OneOfPrimitiveChildFromJson(json); - - Map toJson() => _$OneOfPrimitiveChildToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart deleted file mode 100644 index e5bcbae3225e..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/order.dart +++ /dev/null @@ -1,90 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'order.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Order { - /// Returns a new [Order] instance. - Order({ - this.id, - this.petId, - this.quantity, - this.shipDate, - this.status, - this.complete = false, - }); - - @JsonKey(name: r'id', required: false, includeIfNull: false) - final int? id; - - @JsonKey(name: r'petId', required: false, includeIfNull: false) - final int? petId; - - @JsonKey(name: r'quantity', required: false, includeIfNull: false) - final int? quantity; - - @JsonKey(name: r'shipDate', required: false, includeIfNull: false) - final DateTime? shipDate; - - /// Order Status - @JsonKey(name: r'status', required: false, includeIfNull: false) - final OrderStatusEnum? status; - - @JsonKey( - defaultValue: false, - name: r'complete', - required: false, - includeIfNull: false) - final bool? complete; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Order && - other.id == id && - other.petId == petId && - other.quantity == quantity && - other.shipDate == shipDate && - other.status == status && - other.complete == complete; - - @override - int get hashCode => - id.hashCode + - petId.hashCode + - quantity.hashCode + - shipDate.hashCode + - status.hashCode + - complete.hashCode; - - factory Order.fromJson(Map json) => _$OrderFromJson(json); - - Map toJson() => _$OrderToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} - -/// Order Status -enum OrderStatusEnum { - @JsonValue(r'placed') - placed, - @JsonValue(r'approved') - approved, - @JsonValue(r'delivered') - delivered, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart deleted file mode 100644 index df6d371f533f..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_composite.dart +++ /dev/null @@ -1,54 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'outer_composite.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class OuterComposite { - /// Returns a new [OuterComposite] instance. - OuterComposite({ - this.myNumber, - this.myString, - this.myBoolean, - }); - - @JsonKey(name: r'my_number', required: false, includeIfNull: false) - final num? myNumber; - - @JsonKey(name: r'my_string', required: false, includeIfNull: false) - final String? myString; - - @JsonKey(name: r'my_boolean', required: false, includeIfNull: false) - final bool? myBoolean; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is OuterComposite && - other.myNumber == myNumber && - other.myString == myString && - other.myBoolean == myBoolean; - - @override - int get hashCode => - myNumber.hashCode + myString.hashCode + myBoolean.hashCode; - - factory OuterComposite.fromJson(Map json) => - _$OuterCompositeFromJson(json); - - Map toJson() => _$OuterCompositeToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart deleted file mode 100644 index 2d1326c259bf..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum OuterEnum { - @JsonValue(r'placed') - placed, - @JsonValue(r'approved') - approved, - @JsonValue(r'delivered') - delivered, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart deleted file mode 100644 index 45919f099158..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_default_value.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum OuterEnumDefaultValue { - @JsonValue(r'placed') - placed, - @JsonValue(r'approved') - approved, - @JsonValue(r'delivered') - delivered, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart deleted file mode 100644 index b91ca3455678..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum OuterEnumInteger { - @JsonValue(0) - number0, - @JsonValue(1) - number1, - @JsonValue(2) - number2, - @JsonValue(11184809) - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart deleted file mode 100644 index 799321b37c85..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ /dev/null @@ -1,17 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum OuterEnumIntegerDefaultValue { - @JsonValue(0) - number0, - @JsonValue(1) - number1, - @JsonValue(2) - number2, - @JsonValue(11184809) - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart deleted file mode 100644 index 7620543d1f4a..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/outer_object_with_enum_property.dart +++ /dev/null @@ -1,43 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'outer_object_with_enum_property.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class OuterObjectWithEnumProperty { - /// Returns a new [OuterObjectWithEnumProperty] instance. - OuterObjectWithEnumProperty({ - required this.value, - }); - - @JsonKey(name: r'value', required: true, includeIfNull: false) - final OuterEnumInteger value; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is OuterObjectWithEnumProperty && other.value == value; - - @override - int get hashCode => value.hashCode; - - factory OuterObjectWithEnumProperty.fromJson(Map json) => - _$OuterObjectWithEnumPropertyFromJson(json); - - Map toJson() => _$OuterObjectWithEnumPropertyToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart deleted file mode 100644 index 72f8126a7929..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/parent.dart +++ /dev/null @@ -1,40 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'parent.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Parent { - /// Returns a new [Parent] instance. - Parent({ - required this.fruitType, - }); - - @JsonKey(name: r'fruitType', required: true, includeIfNull: false) - final String fruitType; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Parent && other.fruitType == fruitType; - - @override - int get hashCode => fruitType.hashCode; - - factory Parent.fromJson(Map json) => _$ParentFromJson(json); - - Map toJson() => _$ParentToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart deleted file mode 100644 index 816d59814caf..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pasta.dart +++ /dev/null @@ -1,81 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'pasta.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Pasta { - /// Returns a new [Pasta] instance. - Pasta({ - this.vendor, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'vendor', required: false, includeIfNull: false) - final String? vendor; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Pasta && - other.vendor == vendor && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - vendor.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory Pasta.fromJson(Map json) => _$PastaFromJson(json); - - Map toJson() => _$PastaToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart deleted file mode 100644 index c3c4b5b6e009..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pet.dart +++ /dev/null @@ -1,88 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'pet.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Pet { - /// Returns a new [Pet] instance. - Pet({ - this.id, - this.category, - required this.name, - required this.photoUrls, - this.tags, - this.status, - }); - - @JsonKey(name: r'id', required: false, includeIfNull: false) - final int? id; - - @JsonKey(name: r'category', required: false, includeIfNull: false) - final Category? category; - - @JsonKey(name: r'name', required: true, includeIfNull: false) - final String name; - - @JsonKey(name: r'photoUrls', required: true, includeIfNull: false) - final Set photoUrls; - - @JsonKey(name: r'tags', required: false, includeIfNull: false) - final List? tags; - - /// pet status in the store - @JsonKey(name: r'status', required: false, includeIfNull: false) - final PetStatusEnum? status; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Pet && - other.id == id && - other.category == category && - other.name == name && - other.photoUrls == photoUrls && - other.tags == tags && - other.status == status; - - @override - int get hashCode => - id.hashCode + - category.hashCode + - name.hashCode + - photoUrls.hashCode + - tags.hashCode + - status.hashCode; - - factory Pet.fromJson(Map json) => _$PetFromJson(json); - - Map toJson() => _$PetToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} - -/// pet status in the store -enum PetStatusEnum { - @JsonValue(r'available') - available, - @JsonValue(r'pending') - pending, - @JsonValue(r'sold') - sold, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart deleted file mode 100644 index 32d80d992a50..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza.dart +++ /dev/null @@ -1,81 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/entity.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'pizza.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Pizza { - /// Returns a new [Pizza] instance. - Pizza({ - this.pizzaSize, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'pizzaSize', required: false, includeIfNull: false) - final num? pizzaSize; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Pizza && - other.pizzaSize == pizzaSize && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - pizzaSize.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory Pizza.fromJson(Map json) => _$PizzaFromJson(json); - - Map toJson() => _$PizzaToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart deleted file mode 100644 index 07d031e8c289..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/pizza_speziale.dart +++ /dev/null @@ -1,82 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/pizza.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'pizza_speziale.g.dart'; - -// ignore_for_file: unused_import - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class PizzaSpeziale { - /// Returns a new [PizzaSpeziale] instance. - PizzaSpeziale({ - this.toppings, - this.href, - this.id, - this.atSchemaLocation, - this.atBaseType, - required this.atType, - }); - - @JsonKey(name: r'toppings', required: false, includeIfNull: false) - final String? toppings; - - /// Hyperlink reference - @JsonKey(name: r'href', required: false, includeIfNull: false) - final String? href; - - /// unique identifier - @JsonKey(name: r'id', required: false, includeIfNull: false) - final String? id; - - /// A URI to a JSON-Schema file that defines additional attributes and relationships - @JsonKey(name: r'@schemaLocation', required: false, includeIfNull: false) - final String? atSchemaLocation; - - /// When sub-classing, this defines the super-class - @JsonKey(name: r'@baseType', required: false, includeIfNull: false) - final String? atBaseType; - - /// When sub-classing, this defines the sub-class Extensible name - @JsonKey(name: r'@type', required: true, includeIfNull: false) - final String atType; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is PizzaSpeziale && - other.toppings == toppings && - other.href == href && - other.id == id && - other.atSchemaLocation == atSchemaLocation && - other.atBaseType == atBaseType && - other.atType == atType; - - @override - int get hashCode => - toppings.hashCode + - href.hashCode + - id.hashCode + - atSchemaLocation.hashCode + - atBaseType.hashCode + - atType.hashCode; - - factory PizzaSpeziale.fromJson(Map json) => - _$PizzaSpezialeFromJson(json); - - Map toJson() => _$PizzaSpezialeToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart deleted file mode 100644 index 38c57afbafd8..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/read_only_first.dart +++ /dev/null @@ -1,46 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'read_only_first.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class ReadOnlyFirst { - /// Returns a new [ReadOnlyFirst] instance. - ReadOnlyFirst({ - this.bar, - this.baz, - }); - - @JsonKey(name: r'bar', required: false, includeIfNull: false) - final String? bar; - - @JsonKey(name: r'baz', required: false, includeIfNull: false) - final String? baz; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ReadOnlyFirst && other.bar == bar && other.baz == baz; - - @override - int get hashCode => bar.hashCode + baz.hashCode; - - factory ReadOnlyFirst.fromJson(Map json) => - _$ReadOnlyFirstFromJson(json); - - Map toJson() => _$ReadOnlyFirstToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart deleted file mode 100644 index 783d766acc82..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/single_ref_type.dart +++ /dev/null @@ -1,15 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -enum SingleRefType { - @JsonValue(r'admin') - admin, - @JsonValue(r'user') - user, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart deleted file mode 100644 index fe1029818a7f..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/special_model_name.dart +++ /dev/null @@ -1,47 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'special_model_name.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class SpecialModelName { - /// Returns a new [SpecialModelName] instance. - SpecialModelName({ - this.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, - }); - - @JsonKey( - name: r'$special[property.name]', required: false, includeIfNull: false) - final int? dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is SpecialModelName && - other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - - @override - int get hashCode => - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - .hashCode; - - factory SpecialModelName.fromJson(Map json) => - _$SpecialModelNameFromJson(json); - - Map toJson() => _$SpecialModelNameToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart deleted file mode 100644 index e1c5a2c8cc1c..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/tag.dart +++ /dev/null @@ -1,45 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'tag.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class Tag { - /// Returns a new [Tag] instance. - Tag({ - this.id, - this.name, - }); - - @JsonKey(name: r'id', required: false, includeIfNull: false) - final int? id; - - @JsonKey(name: r'name', required: false, includeIfNull: false) - final String? name; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Tag && other.id == id && other.name == name; - - @override - int get hashCode => id.hashCode + name.hashCode; - - factory Tag.fromJson(Map json) => _$TagFromJson(json); - - Map toJson() => _$TagToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart deleted file mode 100644 index f1da4cd38cab..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/model/user.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'user.g.dart'; - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class User { - /// Returns a new [User] instance. - User({ - this.id, - this.username, - this.firstName, - this.lastName, - this.email, - this.password, - this.phone, - this.userStatus, - }); - - @JsonKey(name: r'id', required: false, includeIfNull: false) - final int? id; - - @JsonKey(name: r'username', required: false, includeIfNull: false) - final String? username; - - @JsonKey(name: r'firstName', required: false, includeIfNull: false) - final String? firstName; - - @JsonKey(name: r'lastName', required: false, includeIfNull: false) - final String? lastName; - - @JsonKey(name: r'email', required: false, includeIfNull: false) - final String? email; - - @JsonKey(name: r'password', required: false, includeIfNull: false) - final String? password; - - @JsonKey(name: r'phone', required: false, includeIfNull: false) - final String? phone; - - /// User Status - @JsonKey(name: r'userStatus', required: false, includeIfNull: false) - final int? userStatus; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is User && - other.id == id && - other.username == username && - other.firstName == firstName && - other.lastName == lastName && - other.email == email && - other.password == password && - other.phone == phone && - other.userStatus == userStatus; - - @override - int get hashCode => - id.hashCode + - username.hashCode + - firstName.hashCode + - lastName.hashCode + - email.hashCode + - password.hashCode + - phone.hashCode + - userStatus.hashCode; - - factory User.fromJson(Map json) => _$UserFromJson(json); - - Map toJson() => _$UserToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart deleted file mode 100644 index e9148e54da0d..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_base.dart +++ /dev/null @@ -1,68 +0,0 @@ -/// The general rule for implementing this class is -/// json == serialize(deserialize(json)) -/// object == deserialize(serialize(object)) -/// Where json in this context means a dart primitive -/// JSON = String | num | bool | null | Uint8List | List | Map -abstract class SerializationRepositoryBase { - const SerializationRepositoryBase(); - - FutureOr serialize( - T src, - TypeInfo inputTypeInfo, { - Object? context, - }); - FutureOr deserialize( - Object? value, - TypeInfo targetTypeInfo, { - Object? context, - }); -} - -/// A modified version of `built_value`'s `FullType` class, found here -/// https://github.com/google/built_value.dart/blob/ee22d400a69c673330481a6da1f0796b90bb369b/built_value/lib/serializer.dart -/// It holds type information known by the spec (including generic type parameters) -class TypeInfo { - final Type root; - final bool nullable; - final List parameters; - - /// The [Object] type. - static const TypeInfo object = TypeInfo(Object); - - const TypeInfo(this.root, [this.parameters = const []]) : nullable = false; - const TypeInfo.nullable(this.root, [this.parameters = const []]) - : nullable = true; - - @override - bool operator ==(dynamic other) { - if (identical(other, this)) return true; - if (other is! TypeInfo) return false; - if (root != other.root) return false; - if (nullable != other.nullable) return false; - if (parameters.length != other.parameters.length) return false; - for (var i = 0; i != parameters.length; ++i) { - if (parameters[i] != other.parameters[i]) return false; - } - return true; - } - - @override - int get hashCode { - return Object.hash(root, Object.hashAll(parameters), nullable); - } - - @override - String toString() => - (parameters.isEmpty - ? _getRawName(root) - : '${_getRawName(root)}<${parameters.join(", ")}>') + - _nullabilitySuffix; - - String get _nullabilitySuffix => nullable ? '?' : ''; - - static String _getRawName(Type? type) { - var name = type.toString(); - var genericsStart = name.indexOf('<'); - return genericsStart == -1 ? name : name.substring(0, genericsStart); - } -} diff --git a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart b/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart deleted file mode 100644 index 9cd7bec2c338..000000000000 --- a/samples/openapi3/client/petstore/dart-next/dio/json_serializable/lib/src/repository_impl.dart +++ /dev/null @@ -1,350 +0,0 @@ -import 'dart:convert'; -import 'dart:typed_data'; -import 'repository_base.dart'; -import 'package:openapi/models.dart'; - -class JsonSerializableRepository extends SerializationRepositoryBase { - JsonSerializableRepository(); - - /// Transforms an object of arbitrary type [T] (whose information is passed in inputTypeInfo) to a dart primitive - @override - FutureOr serialize(T src, TypeInfo inputTypeInfo, - {Object? context}) { - if (src == null) { - return null; - } - if (src is String) { - return src; - } - if (src is bool) { - return src; - } - if (src is DateTime) { - return src.toIso8601String(); - } - if (src is num) { - return src; - } - if (src is Uint8List) { - return src; - } - if (src is Iterable) { - return src - .map((value) => - serialize(value, inputTypeInfo.parameters[0], context: context)) - .toList(); - } - if (src is Map) { - return src.map((key, value) => MapEntry( - //Json Map keys must always be strings - serialize(key, inputTypeInfo.parameters[0], context: context) - .toString(), - serialize(value, inputTypeInfo.parameters[1], context: context))); - } - - if (context is Object? Function(Object?)) { - return context(src); - } - - try { - return (src as dynamic).toJson(); - } on NoSuchMethodError { - assert(false, ''' - Failed to serialize the object properly, falling back to `toString()` - '''); - return src.toString(); - } - } - - /// Transforms a dart primitive to an object of arbitrary type [T] (whose information is passed in inputTypeInfo) - @override - T deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context}) { - //Don't rely on T being accurate here, since it won't get passed for generic arguments. - if (value == null) { - return null as T; - } - final targetRootType = targetTypeInfo.root; - if (targetRootType == T) { - //short circuit if we already have the output as the input - return value as T; - } - switch (targetRootType) { - case String: - return value.toString() as T; - case double: - return (value is num - ? value.toDouble() - : double.tryParse(value.toString())) as T; - case int: - return (value is num ? value.toInt() : int.tryParse(value.toString())) - as T; - case num: - return (value is num ? value : num.tryParse(value.toString())) as T; - case bool: - return (value is bool ? value : bool.tryParse(value.toString())) as T; - case DateTime: - return (value is DateTime ? value : DateTime.tryParse(value.toString())) - as T; - case Iterable: - case List: - case Set: - if (value is! Iterable) { - throw Exception('Cannot deserialize'); - } - final mappedItems = value.map((v) => - deserialize(v, targetTypeInfo.parameters[0], context: context)); - if (targetRootType == List) { - return List.from(mappedItems); - } else if (targetRootType == Set) { - return Set.from(mappedItems); - } else if (targetRootType == Iterable) { - return mappedItems; - } else { - throw Exception('Cannot deserialize'); - } - case Map: - if (value is! Map) { - throw Exception('Cannot deserialize'); - } - return value.map((k, v) => MapEntry( - deserialize(k, targetTypeInfo.parameters[0], context: context), - deserialize(v, targetTypeInfo.parameters[1], context: context))); - case AdditionalPropertiesClass: - return AdditionalPropertiesClass.fromJson(value as Map) - as T; - case Addressable: - return Addressable.fromJson(value as Map) as T; - case AllOfWithSingleRef: - return AllOfWithSingleRef.fromJson(value as Map) as T; - case Animal: - return Animal.fromJson(value as Map) as T; - case ApiResponse: - return ApiResponse.fromJson(value as Map) as T; - case Apple: - return Apple.fromJson(value as Map) as T; - case AppleAllOfDisc: - return AppleAllOfDisc.fromJson(value as Map) as T; - case AppleGrandparentDisc: - return AppleGrandparentDisc.fromJson(value as Map) - as T; - case AppleOneOfDisc: - return AppleOneOfDisc.fromJson(value as Map) as T; - case AppleReqDisc: - return AppleReqDisc.fromJson(value as Map) as T; - case AppleVariant1: - return AppleVariant1.fromJson(value as Map) as T; - case ArrayOfArrayOfNumberOnly: - return ArrayOfArrayOfNumberOnly.fromJson(value as Map) - as T; - case ArrayOfNumberOnly: - return ArrayOfNumberOnly.fromJson(value as Map) as T; - case ArrayTest: - return ArrayTest.fromJson(value as Map) as T; - case Banana: - return Banana.fromJson(value as Map) as T; - case BananaAllOfDisc: - return BananaAllOfDisc.fromJson(value as Map) as T; - case BananaGrandparentDisc: - return BananaGrandparentDisc.fromJson(value as Map) - as T; - case BananaOneOfDisc: - return BananaOneOfDisc.fromJson(value as Map) as T; - case BananaReqDisc: - return BananaReqDisc.fromJson(value as Map) as T; - case Bar: - return Bar.fromJson(value as Map) as T; - case BarCreate: - return BarCreate.fromJson(value as Map) as T; - case BarRef: - return BarRef.fromJson(value as Map) as T; - case BarRefOrValue: - return BarRefOrValue.fromJson(value as Map) as T; - case Capitalization: - return Capitalization.fromJson(value as Map) as T; - case Cat: - return Cat.fromJson(value as Map) as T; - case Category: - return Category.fromJson(value as Map) as T; - case ClassModel: - return ClassModel.fromJson(value as Map) as T; - case ComposedDiscMissingFromProperties: - return ComposedDiscMissingFromProperties.fromJson( - value as Map) as T; - case ComposedDiscOptionalTypeCorrect: - return ComposedDiscOptionalTypeCorrect.fromJson( - value as Map) as T; - case ComposedDiscOptionalTypeInconsistent: - return ComposedDiscOptionalTypeInconsistent.fromJson( - value as Map) as T; - case ComposedDiscOptionalTypeIncorrect: - return ComposedDiscOptionalTypeIncorrect.fromJson( - value as Map) as T; - case ComposedDiscRequiredInconsistent: - return ComposedDiscRequiredInconsistent.fromJson( - value as Map) as T; - case ComposedDiscTypeInconsistent: - return ComposedDiscTypeInconsistent.fromJson( - value as Map) as T; - case ComposedDiscTypeIncorrect: - return ComposedDiscTypeIncorrect.fromJson(value as Map) - as T; - case DeprecatedObject: - return DeprecatedObject.fromJson(value as Map) as T; - case DiscMissingFromProperties: - return DiscMissingFromProperties.fromJson(value as Map) - as T; - case DiscOptionalTypeCorrect: - return DiscOptionalTypeCorrect.fromJson(value as Map) - as T; - case DiscOptionalTypeIncorrect: - return DiscOptionalTypeIncorrect.fromJson(value as Map) - as T; - case DiscTypeIncorrect: - return DiscTypeIncorrect.fromJson(value as Map) as T; - case Dog: - return Dog.fromJson(value as Map) as T; - case Entity: - return Entity.fromJson(value as Map) as T; - case EntityRef: - return EntityRef.fromJson(value as Map) as T; - case EnumArrays: - return EnumArrays.fromJson(value as Map) as T; - case EnumTest: - return EnumTest.fromJson(value as Map) as T; - case Extensible: - return Extensible.fromJson(value as Map) as T; - case FileSchemaTestClass: - return FileSchemaTestClass.fromJson(value as Map) as T; - case Foo: - return Foo.fromJson(value as Map) as T; - case FooBasicGetDefaultResponse: - return FooBasicGetDefaultResponse.fromJson( - value as Map) as T; - case FooRef: - return FooRef.fromJson(value as Map) as T; - case FooRefOrValue: - return FooRefOrValue.fromJson(value as Map) as T; - case FormatTest: - return FormatTest.fromJson(value as Map) as T; - case Fruit: - return Fruit.fromJson(value as Map) as T; - case FruitAllOfDisc: - return FruitAllOfDisc.fromJson(value as Map) as T; - case FruitAnyOfDisc: - return FruitAnyOfDisc.fromJson(value as Map) as T; - case FruitGrandparentDisc: - return FruitGrandparentDisc.fromJson(value as Map) - as T; - case FruitInlineDisc: - return FruitInlineDisc.fromJson(value as Map) as T; - case FruitInlineDiscOneOf: - return FruitInlineDiscOneOf.fromJson(value as Map) - as T; - case FruitInlineDiscOneOf1: - return FruitInlineDiscOneOf1.fromJson(value as Map) - as T; - case FruitInlineInlineDisc: - return FruitInlineInlineDisc.fromJson(value as Map) - as T; - case FruitInlineInlineDiscOneOf: - return FruitInlineInlineDiscOneOf.fromJson( - value as Map) as T; - case FruitInlineInlineDiscOneOf1: - return FruitInlineInlineDiscOneOf1.fromJson( - value as Map) as T; - case FruitInlineInlineDiscOneOfOneOf: - return FruitInlineInlineDiscOneOfOneOf.fromJson( - value as Map) as T; - case FruitOneOfDisc: - return FruitOneOfDisc.fromJson(value as Map) as T; - case FruitReqDisc: - return FruitReqDisc.fromJson(value as Map) as T; - case FruitType: - return FruitType.fromJson(value as Map) as T; - case FruitVariant1: - return FruitVariant1.fromJson(value as Map) as T; - case GigaOneOf: - return GigaOneOf.fromJson(value as Map) as T; - case GrapeVariant1: - return GrapeVariant1.fromJson(value as Map) as T; - case HasOnlyReadOnly: - return HasOnlyReadOnly.fromJson(value as Map) as T; - case HealthCheckResult: - return HealthCheckResult.fromJson(value as Map) as T; - case MapTest: - return MapTest.fromJson(value as Map) as T; - case MixedPropertiesAndAdditionalPropertiesClass: - return MixedPropertiesAndAdditionalPropertiesClass.fromJson( - value as Map) as T; - case Model200Response: - return Model200Response.fromJson(value as Map) as T; - case ModelClient: - return ModelClient.fromJson(value as Map) as T; - case ModelEnumClass: - //TODO: find a way to support enums - return value as T; - case ModelFile: - return ModelFile.fromJson(value as Map) as T; - case ModelList: - return ModelList.fromJson(value as Map) as T; - case ModelReturn: - return ModelReturn.fromJson(value as Map) as T; - case Name: - return Name.fromJson(value as Map) as T; - case NullableClass: - return NullableClass.fromJson(value as Map) as T; - case NumberOnly: - return NumberOnly.fromJson(value as Map) as T; - case ObjectWithDeprecatedFields: - return ObjectWithDeprecatedFields.fromJson( - value as Map) as T; - case OneOfPrimitiveChild: - return OneOfPrimitiveChild.fromJson(value as Map) as T; - case Order: - return Order.fromJson(value as Map) as T; - case OuterComposite: - return OuterComposite.fromJson(value as Map) as T; - case OuterEnum: - //TODO: find a way to support enums - return value as T; - case OuterEnumDefaultValue: - //TODO: find a way to support enums - return value as T; - case OuterEnumInteger: - //TODO: find a way to support enums - return value as T; - case OuterEnumIntegerDefaultValue: - //TODO: find a way to support enums - return value as T; - case OuterObjectWithEnumProperty: - return OuterObjectWithEnumProperty.fromJson( - value as Map) as T; - case Parent: - return Parent.fromJson(value as Map) as T; - case Pasta: - return Pasta.fromJson(value as Map) as T; - case Pet: - return Pet.fromJson(value as Map) as T; - case Pizza: - return Pizza.fromJson(value as Map) as T; - case PizzaSpeziale: - return PizzaSpeziale.fromJson(value as Map) as T; - case ReadOnlyFirst: - return ReadOnlyFirst.fromJson(value as Map) as T; - case SingleRefType: - //TODO: find a way to support enums - return value as T; - case SpecialModelName: - return SpecialModelName.fromJson(value as Map) as T; - case Tag: - return Tag.fromJson(value as Map) as T; - case User: - return User.fromJson(value as Map) as T; - default: - if (value is T) { - return value; - } - throw Exception('Cannot deserialize'); - } - } -} From 46401f33656ccf093f6128989e2c8ab5d9839591 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 05:21:23 +0200 Subject: [PATCH 25/31] fix pom paths --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5536194bdfe9..4ad95e296e26 100644 --- a/pom.xml +++ b/pom.xml @@ -1328,8 +1328,8 @@ samples/openapi3/client/petstore/dart-dio/oneof_primitive samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable - samples/openapi3/client/petstore/dart-next/dio/built_value - samples/openapi3/client/petstore/dart-next/dio/json_serializable + samples/client/echo_api/dart/dio/built_value + samples/client/echo_api/dart/dio/json_serializable From 13ff9b925742ee6811d3428e19e58eda91ed039e Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 17 Jun 2023 19:27:27 +0200 Subject: [PATCH 26/31] mark dart-next as experimental --- docs/generators/dart-next.md | 2 +- .../openapitools/codegen/languages/DartNextClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/dart-next.md b/docs/generators/dart-next.md index 8bb32b61555f..5d3f229df2ab 100644 --- a/docs/generators/dart-next.md +++ b/docs/generators/dart-next.md @@ -7,7 +7,7 @@ title: Documentation for the dart-next Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dart-next | pass this to the generate command after -g | -| generator stability | STABLE | | +| generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Dart | | | generator default templating engine | mustache | | diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java index 52beefc22bf7..b8401ee1ce04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -120,7 +120,7 @@ public DartNextClientCodegen() { SchemaSupportFeature.oneOf, SchemaSupportFeature.anyOf)); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.STABLE) + .stability(Stability.EXPERIMENTAL) .build(); outputFolder = "generated-code/dart-next"; From 0f580208089c4a798e4a7a96b5f131da8fcc00fa Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Mon, 3 Jul 2023 13:12:45 +0200 Subject: [PATCH 27/31] Regenerate generator readme --- docs/generators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generators.md b/docs/generators.md index 33e322d81496..7467b58f9c22 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -21,7 +21,7 @@ The following generators are available: * [csharp-netcore](generators/csharp-netcore.md) * [dart](generators/dart.md) * [dart-dio](generators/dart-dio.md) -* [dart-next](generators/dart-next.md) +* [dart-next (experimental)](generators/dart-next.md) * [eiffel](generators/eiffel.md) * [elixir](generators/elixir.md) * [elm](generators/elm.md) From 2f2f528f2e04ee04c9f851049abbf9f21a976388 Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Mon, 3 Jul 2023 13:37:37 +0200 Subject: [PATCH 28/31] Improve sample execution * use much newer exec plugin * run pub via dart sub command --- .../client/echo_api/dart/dio/built_value/pom.xml | 15 ++++++++------- .../echo_api/dart/dio/json_serializable/pom.xml | 11 ++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/samples/client/echo_api/dart/dio/built_value/pom.xml b/samples/client/echo_api/dart/dio/built_value/pom.xml index 128da6843047..26b922ed34e8 100644 --- a/samples/client/echo_api/dart/dio/built_value/pom.xml +++ b/samples/client/echo_api/dart/dio/built_value/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.openapitools - DartNextDioBuiltValueTests + DartNextDioBuiltValueSample pom 1.0.0-SNAPSHOT - DartDio Petstore Client Lib Fake + Dart Echo API Sample (dio/built_value) @@ -24,7 +24,6 @@ org.codehaus.mojo exec-maven-plugin - 1.2.1 pub-get @@ -33,8 +32,9 @@ exec - pub + dart + pub get @@ -46,8 +46,9 @@ exec - pub + dart + pub run build_runner build @@ -75,7 +76,6 @@ exec - dart test @@ -89,8 +89,9 @@ ../built_value_tests - pub + dart + pub get diff --git a/samples/client/echo_api/dart/dio/json_serializable/pom.xml b/samples/client/echo_api/dart/dio/json_serializable/pom.xml index 8ec5f024ed74..d4d82ba9718d 100644 --- a/samples/client/echo_api/dart/dio/json_serializable/pom.xml +++ b/samples/client/echo_api/dart/dio/json_serializable/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.openapitools - DartNextDioJsonSerializableTests + DartNextDioJsonSerializableSample pom 1.0.0-SNAPSHOT - DartDio Petstore Client Lib Fake Json Serializable + Dart Echo API Sample (dio/json_serializable) @@ -24,7 +24,6 @@ org.codehaus.mojo exec-maven-plugin - 1.2.1 pub-get @@ -33,8 +32,9 @@ exec - pub + dart + pub get @@ -46,8 +46,9 @@ exec - pub + dart + pub run build_runner build From 8e599cbf6a633b94801229ac995a399e048de316 Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Mon, 3 Jul 2023 13:37:46 +0200 Subject: [PATCH 29/31] Nit picks --- .../openapitools/codegen/languages/DartNextClientCodegen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java index b8401ee1ce04..7f7dd4bc35d9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -103,7 +103,7 @@ public class DartNextClientCodegen extends DartNextAbstractCodegen { private TemplateManager templateManager; - private Map supportedSerializationLibraries = new LinkedHashMap<>(); + private final Map supportedSerializationLibraries = new LinkedHashMap<>(); public DartNextClientCodegen() { super(); @@ -149,7 +149,7 @@ public DartNextClientCodegen() { final CliOption finalProperties = CliOption.newBoolean(FINAL_PROPERTIES, "Whether properties are marked as final when using Json Serializable for serialization"); - finalProperties.setDefault("true"); + finalProperties.setDefault(FINAL_PROPERTIES_DEFAULT_VALUE); cliOptions.add(finalProperties); final Map dateOptions = new HashMap<>(); From 49b49830a6f6ea46cdc17d76032ecfcbfdd2cc1f Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Wed, 2 Aug 2023 03:06:26 +0300 Subject: [PATCH 30/31] fix part generation --- .../resources/dart-next/libraries/dio/api.mustache | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache index 11e92d04f84d..74d4c9e9fab1 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api.mustache @@ -13,7 +13,17 @@ import 'package:{{pubName}}/models.dart'; {{#imports}}import '{{.}}'; {{/imports}} +{{#operation}} +{{#allParams}} +{{^isModel}} +{{#enumName}} +{{#-first}} part '{{classFilename}}.g.dart'; +{{/-first}} +{{/enumName}} +{{/isModel}} +{{/allParams}} +{{/operation}} {{>libraries/dio/api_typed}} {{>libraries/dio/api_raw}} From f5236efc66cda7126b2aa02fd00dff0759de450f Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Wed, 2 Aug 2023 04:18:35 +0300 Subject: [PATCH 31/31] async changes --- .../languages/DartNextAbstractCodegen.java | 2 +- .../languages/DartNextClientCodegen.java | 4 +- .../libraries/dio/api_typed.mustache | 12 +- .../dart-next/libraries/dio/api_util.mustache | 56 ++++----- .../built_value/repository_impl.mustache | 2 +- .../repository_impl.mustache | 1 + .../serialization/repository_base.mustache | 6 +- .../dio/built_value/.openapi-generator/FILES | 109 ++++++++++++++++ .../lib/src/api/another_fake_api.dart | 5 +- .../dio/built_value/lib/src/api/bar_api.dart | 5 +- .../built_value/lib/src/api/default_api.dart | 13 +- .../dio/built_value/lib/src/api/fake_api.dart | 118 +++++++++--------- .../src/api/fake_classname_tags123_api.dart | 5 +- .../dio/built_value/lib/src/api/foo_api.dart | 8 +- .../dio/built_value/lib/src/api/pet_api.dart | 42 +++---- .../built_value/lib/src/api/store_api.dart | 13 +- .../dio/built_value/lib/src/api/user_api.dart | 23 ++-- .../dio/built_value/lib/src/api_util.dart | 56 ++++----- .../built_value/lib/src/repository_base.dart | 6 +- .../built_value/lib/src/repository_impl.dart | 2 +- .../additional_properties_class_test.dart | 9 +- .../built_value/test/addressable_test.dart | 9 +- .../test/all_of_with_single_ref_test.dart | 9 +- .../dio/built_value/test/animal_test.dart | 9 +- .../test/another_fake_api_test.dart | 6 +- .../built_value/test/api_response_test.dart | 13 +- .../test/apple_all_of_disc_test.dart | 9 +- .../test/apple_grandparent_disc_test.dart | 9 +- .../test/apple_one_of_disc_test.dart | 9 +- .../built_value/test/apple_req_disc_test.dart | 9 +- .../dart/dio/built_value/test/apple_test.dart | 5 +- .../built_value/test/apple_variant1_test.dart | 5 +- .../array_of_array_of_number_only_test.dart | 5 +- .../test/array_of_number_only_test.dart | 5 +- .../dio/built_value/test/array_test_test.dart | 13 +- .../test/banana_all_of_disc_test.dart | 9 +- .../test/banana_grandparent_disc_test.dart | 9 +- .../test/banana_one_of_disc_test.dart | 9 +- .../test/banana_req_disc_test.dart | 9 +- .../dio/built_value/test/banana_test.dart | 5 +- .../dio/built_value/test/bar_api_test.dart | 6 +- .../dio/built_value/test/bar_create_test.dart | 33 +++-- .../test/bar_ref_or_value_test.dart | 21 +++- .../dio/built_value/test/bar_ref_test.dart | 21 +++- .../dart/dio/built_value/test/bar_test.dart | 33 +++-- .../built_value/test/capitalization_test.dart | 27 ++-- .../dart/dio/built_value/test/cat_test.dart | 13 +- .../dio/built_value/test/category_test.dart | 9 +- .../built_value/test/class_model_test.dart | 5 +- ...sed_disc_missing_from_properties_test.dart | 5 +- ...posed_disc_optional_type_correct_test.dart | 5 +- ..._disc_optional_type_inconsistent_test.dart | 5 +- ...sed_disc_optional_type_incorrect_test.dart | 5 +- ...posed_disc_required_inconsistent_test.dart | 5 +- .../composed_disc_type_inconsistent_test.dart | 5 +- .../composed_disc_type_incorrect_test.dart | 5 +- .../built_value/test/default_api_test.dart | 26 +++- .../test/deprecated_object_test.dart | 5 +- .../disc_missing_from_properties_test.dart | 5 +- .../test/disc_optional_type_correct_test.dart | 5 +- .../disc_optional_type_incorrect_test.dart | 5 +- .../test/disc_type_incorrect_test.dart | 5 +- .../dart/dio/built_value/test/dog_test.dart | 13 +- .../dio/built_value/test/entity_ref_test.dart | 29 +++-- .../dio/built_value/test/entity_test.dart | 21 +++- .../built_value/test/enum_arrays_test.dart | 9 +- .../dio/built_value/test/enum_test_test.dart | 33 +++-- .../dio/built_value/test/extensible_test.dart | 13 +- .../dio/built_value/test/fake_api_test.dart | 78 ++++++++---- .../test/fake_classname_tags123_api_test.dart | 6 +- .../test/file_schema_test_class_test.dart | 9 +- .../dio/built_value/test/foo_api_test.dart | 10 +- .../foo_basic_get_default_response_test.dart | 5 +- .../test/foo_ref_or_value_test.dart | 21 +++- .../dio/built_value/test/foo_ref_test.dart | 25 +++- .../dart/dio/built_value/test/foo_test.dart | 29 +++-- .../built_value/test/format_test_test.dart | 65 +++++++--- .../test/fruit_all_of_disc_test.dart | 5 +- .../test/fruit_any_of_disc_test.dart | 5 +- .../test/fruit_grandparent_disc_test.dart | 5 +- .../test/fruit_inline_disc_one_of1_test.dart | 9 +- .../test/fruit_inline_disc_one_of_test.dart | 9 +- .../test/fruit_inline_disc_test.dart | 13 +- ...fruit_inline_inline_disc_one_of1_test.dart | 9 +- ...inline_inline_disc_one_of_one_of_test.dart | 5 +- .../fruit_inline_inline_disc_one_of_test.dart | 9 +- .../test/fruit_inline_inline_disc_test.dart | 5 +- .../test/fruit_one_of_disc_test.dart | 5 +- .../built_value/test/fruit_req_disc_test.dart | 13 +- .../dart/dio/built_value/test/fruit_test.dart | 13 +- .../dio/built_value/test/fruit_type_test.dart | 5 +- .../built_value/test/fruit_variant1_test.dart | 9 +- .../built_value/test/giga_one_of_test.dart | 5 +- .../built_value/test/grape_variant1_test.dart | 5 +- .../test/has_only_read_only_test.dart | 9 +- .../test/health_check_result_test.dart | 5 +- .../dio/built_value/test/map_test_test.dart | 17 ++- ..._and_additional_properties_class_test.dart | 13 +- .../test/model200_response_test.dart | 9 +- .../built_value/test/model_client_test.dart | 5 +- .../test/model_enum_class_test.dart | 4 +- .../dio/built_value/test/model_file_test.dart | 5 +- .../dio/built_value/test/model_list_test.dart | 5 +- .../built_value/test/model_return_test.dart | 5 +- .../dart/dio/built_value/test/name_test.dart | 17 ++- .../built_value/test/nullable_class_test.dart | 49 ++++++-- .../built_value/test/number_only_test.dart | 5 +- .../object_with_deprecated_fields_test.dart | 17 ++- .../test/one_of_primitive_child_test.dart | 5 +- .../dart/dio/built_value/test/order_test.dart | 25 +++- .../test/outer_composite_test.dart | 13 +- .../test/outer_enum_default_value_test.dart | 4 +- ...outer_enum_integer_default_value_test.dart | 4 +- .../test/outer_enum_integer_test.dart | 4 +- .../dio/built_value/test/outer_enum_test.dart | 4 +- .../outer_object_with_enum_property_test.dart | 5 +- .../dio/built_value/test/parent_test.dart | 5 +- .../dart/dio/built_value/test/pasta_test.dart | 25 +++- .../dio/built_value/test/pet_api_test.dart | 50 +++++--- .../dart/dio/built_value/test/pet_test.dart | 25 +++- .../built_value/test/pizza_speziale_test.dart | 25 +++- .../dart/dio/built_value/test/pizza_test.dart | 25 +++- .../test/read_only_first_test.dart | 9 +- .../test/single_ref_type_test.dart | 4 +- .../test/special_model_name_test.dart | 7 +- .../dio/built_value/test/store_api_test.dart | 20 ++- .../dart/dio/built_value/test/tag_test.dart | 9 +- .../dio/built_value/test/user_api_test.dart | 44 +++++-- .../dart/dio/built_value/test/user_test.dart | 33 +++-- 129 files changed, 1378 insertions(+), 534 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java index e19066d0ca4d..ccd92373b12b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextAbstractCodegen.java @@ -539,7 +539,7 @@ public String getTypeDeclaration(Schema p) { if (ModelUtils.isMapSchema(target)) { // Note: ModelUtils.isMapSchema(p) returns true when p is a composed schema that also defines // additionalproperties: true - Schema inner = getAdditionalProperties(target); + Schema inner = ModelUtils.getAdditionalProperties(target); if (inner == null) { LOGGER.error("`{}` (map property) does not have a proper inner type defined. Default to type:string", p.getName()); inner = new StringSchema().description("TODO default missing map inner type to string"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java index 7f7dd4bc35d9..b1bca5e5fac5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartNextClientCodegen.java @@ -740,8 +740,8 @@ private void adaptToDartInheritance(Map objs) { /// setLegacyDiscriminatorBehavior(false) /// this ensures 1-1 schema mapping instead of 1-many @Override - protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { - CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema, openAPI); + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema) { + CodegenDiscriminator sub = super.createDiscriminator(schemaName, schema); Discriminator originalDiscriminator = schema.getDiscriminator(); if (originalDiscriminator != null) { Map originalMapping = originalDiscriminator.getMapping(); diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache index 5b7a3bcf108e..d5419ffac53c 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_typed.mustache @@ -43,7 +43,7 @@ class {{classname}} { {{#hasFormParams}} final _bodyMap = { {{#formParams}} - {{^required}}if ({{{paramName}}} != null) {{/required}}r'{{{baseName}}}': encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}), + {{^required}}if ({{{paramName}}} != null) {{/required}}r'{{{baseName}}}': await encodeFormParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}), {{/formParams}} }; {{#isMultipart}} @@ -54,15 +54,15 @@ class {{classname}} { {{/isMultipart}} {{/hasFormParams}} {{#bodyParam}} - _bodyData = encodeBodyParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}); + _bodyData = await encodeBodyParameter(_repository, {{{paramName}}}, {{>types/recursion_type_info}}); {{/bodyParam}} {{/hasBodyOrFormParams}} final _response = await rawApi.{{nickname}}( {{#allParams}}{{#isPathParam}} - {{paramName}}: encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}),{{/isPathParam}}{{#isQueryParam}} - {{paramName}}: encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}),{{/isQueryParam}}{{#isHeaderParam}} - {{paramName}}: encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}), {{/isHeaderParam}}{{/allParams}} + {{paramName}}: await encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}),{{/isPathParam}}{{#isQueryParam}} + {{paramName}}: await encodeQueryParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}, {{#collectionFormat}}format: ListFormat.{{.}},{{/collectionFormat}}),{{/isQueryParam}}{{#isHeaderParam}} + {{paramName}}: await encodeStringParameter(_repository, {{paramName}}, {{>types/recursion_type_info}}), {{/isHeaderParam}}{{/allParams}} {{#hasConsumes}} body: _bodyData, requestContentType: '{{#prioritizedContentTypes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/prioritizedContentTypes}}',{{/hasConsumes}} @@ -83,7 +83,7 @@ class {{classname}} { try { final rawResponse = _response.data; {{#returnProperty}} - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, {{>types/recursion_type_info}}); + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, {{>types/recursion_type_info}}); {{/returnProperty}} } catch (error, stackTrace) { throw DioException( diff --git a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache index cca5b3427a0a..e6357fd191b6 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/libraries/dio/api_util.mustache @@ -1,57 +1,48 @@ import 'package:dio/dio.dart'; +import 'dart:async'; import 'dart:convert'; import 'package:openapi/models.dart'; import 'dart:typed_data'; /// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -Object encodeFormParameter( +Future encodeFormParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; +) async { + return repository.serialize( + value, + type, + ); } -String encodeStringParameter( +Future encodeStringParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - return repository.serialize(value, type).toString(); +) async { + return (await repository.serialize(value, type)).toString(); } -Object encodeBodyParameter( +Future encodeBodyParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( +) async { + return await repository.serialize( value, type, - ); - return serialized; + ); } -Object encodeQueryParameter( +Future encodeQueryParameter( SerializationRepositoryBase repository, T value, TypeInfo type, { ListFormat format = ListFormat.multi, -}) { +}) async { if (value == null) { - return ''; + return null; } if (value is String || value is num || value is bool) { return value; @@ -67,22 +58,25 @@ Object encodeQueryParameter( return serialized; } -ListParam encodeCollectionQueryParameter( +Future> encodeCollectionQueryParameter( SerializationRepositoryBase repository, Iterable value, TypeInfo type, { ListFormat format = ListFormat.multi, -}) { - final serialized = repository.serialize( +}) async { + final serialized = await repository.serialize( value, type, ); + if (serialized == null) { + return ListParam([], format); + } if (serialized is Iterable) { return ListParam(serialized.toList(), format); } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } -TOutput decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) { - return repository.deserialize(value, type); +Future decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) async { + return await repository.deserialize(value, type); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache index d06ea0b8765d..2c7beee1e417 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/built_value/repository_impl.mustache @@ -1,5 +1,5 @@ {{>header}} - +import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache index ec1eb6a29167..85b20e8b3ae3 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/json_serializable/repository_impl.mustache @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:async'; import 'dart:typed_data'; import 'repository_base.dart'; import 'package:{{pubName}}/models.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache index c4c2def37aa6..fa1f81f13c5b 100644 --- a/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache +++ b/modules/openapi-generator/src/main/resources/dart-next/serialization/repository_base.mustache @@ -1,3 +1,5 @@ +import 'dart:async'; + /// The general rule for implementing this class is /// json == serialize(deserialize(json)) /// object == deserialize(serialize(object)) @@ -6,8 +8,8 @@ abstract class SerializationRepositoryBase { const SerializationRepositoryBase(); - FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); } /// A modified version of `built_value`'s `FullType` class, found here diff --git a/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES index 58cb7a2275e9..18008f8208c3 100644 --- a/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES +++ b/samples/client/echo_api/dart/dio/built_value/.openapi-generator/FILES @@ -236,3 +236,112 @@ lib/src/repository_base.dart lib/src/repository_impl.dart lib/src/serializers.dart pubspec.yaml +test/additional_properties_class_test.dart +test/addressable_test.dart +test/all_of_with_single_ref_test.dart +test/animal_test.dart +test/another_fake_api_test.dart +test/api_response_test.dart +test/apple_all_of_disc_test.dart +test/apple_grandparent_disc_test.dart +test/apple_one_of_disc_test.dart +test/apple_req_disc_test.dart +test/apple_test.dart +test/apple_variant1_test.dart +test/array_of_array_of_number_only_test.dart +test/array_of_number_only_test.dart +test/array_test_test.dart +test/banana_all_of_disc_test.dart +test/banana_grandparent_disc_test.dart +test/banana_one_of_disc_test.dart +test/banana_req_disc_test.dart +test/banana_test.dart +test/bar_api_test.dart +test/bar_create_test.dart +test/bar_ref_or_value_test.dart +test/bar_ref_test.dart +test/bar_test.dart +test/capitalization_test.dart +test/cat_test.dart +test/category_test.dart +test/class_model_test.dart +test/composed_disc_missing_from_properties_test.dart +test/composed_disc_optional_type_correct_test.dart +test/composed_disc_optional_type_inconsistent_test.dart +test/composed_disc_optional_type_incorrect_test.dart +test/composed_disc_required_inconsistent_test.dart +test/composed_disc_type_inconsistent_test.dart +test/composed_disc_type_incorrect_test.dart +test/default_api_test.dart +test/deprecated_object_test.dart +test/disc_missing_from_properties_test.dart +test/disc_optional_type_correct_test.dart +test/disc_optional_type_incorrect_test.dart +test/disc_type_incorrect_test.dart +test/dog_test.dart +test/entity_ref_test.dart +test/entity_test.dart +test/enum_arrays_test.dart +test/enum_test_test.dart +test/extensible_test.dart +test/fake_api_test.dart +test/fake_classname_tags123_api_test.dart +test/file_schema_test_class_test.dart +test/foo_api_test.dart +test/foo_basic_get_default_response_test.dart +test/foo_ref_or_value_test.dart +test/foo_ref_test.dart +test/foo_test.dart +test/format_test_test.dart +test/fruit_all_of_disc_test.dart +test/fruit_any_of_disc_test.dart +test/fruit_grandparent_disc_test.dart +test/fruit_inline_disc_one_of1_test.dart +test/fruit_inline_disc_one_of_test.dart +test/fruit_inline_disc_test.dart +test/fruit_inline_inline_disc_one_of1_test.dart +test/fruit_inline_inline_disc_one_of_one_of_test.dart +test/fruit_inline_inline_disc_one_of_test.dart +test/fruit_inline_inline_disc_test.dart +test/fruit_one_of_disc_test.dart +test/fruit_req_disc_test.dart +test/fruit_test.dart +test/fruit_type_test.dart +test/fruit_variant1_test.dart +test/giga_one_of_test.dart +test/grape_variant1_test.dart +test/has_only_read_only_test.dart +test/health_check_result_test.dart +test/map_test_test.dart +test/mixed_properties_and_additional_properties_class_test.dart +test/model200_response_test.dart +test/model_client_test.dart +test/model_enum_class_test.dart +test/model_file_test.dart +test/model_list_test.dart +test/model_return_test.dart +test/name_test.dart +test/nullable_class_test.dart +test/number_only_test.dart +test/object_with_deprecated_fields_test.dart +test/one_of_primitive_child_test.dart +test/order_test.dart +test/outer_composite_test.dart +test/outer_enum_default_value_test.dart +test/outer_enum_integer_default_value_test.dart +test/outer_enum_integer_test.dart +test/outer_enum_test.dart +test/outer_object_with_enum_property_test.dart +test/parent_test.dart +test/pasta_test.dart +test/pet_api_test.dart +test/pet_test.dart +test/pizza_speziale_test.dart +test/pizza_test.dart +test/read_only_first_test.dart +test/single_ref_type_test.dart +test/special_model_name_test.dart +test/store_api_test.dart +test/tag_test.dart +test/user_api_test.dart +test/user_test.dart diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart index 37e8fcbda65d..6df08905607b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/another_fake_api.dart @@ -12,7 +12,6 @@ import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; -part 'another_fake_api.g.dart'; class AnotherFakeApi { @@ -45,7 +44,7 @@ class AnotherFakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, modelClient, const TypeInfo( ModelClient @@ -69,7 +68,7 @@ class AnotherFakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( ModelClient diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart index b70423894fba..4de07ba6196b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/bar_api.dart @@ -13,7 +13,6 @@ import 'package:openapi/models.dart'; import 'package:openapi/src/model/bar.dart'; import 'package:openapi/src/model/bar_create.dart'; -part 'bar_api.g.dart'; class BarApi { @@ -46,7 +45,7 @@ class BarApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, barCreate, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, barCreate, const TypeInfo( BarCreate @@ -70,7 +69,7 @@ class BarApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( Bar diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart index 923c671c1f3c..a72f9758407b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/default_api.dart @@ -17,7 +17,6 @@ import 'package:openapi/src/model/fruit_all_of_disc.dart'; import 'package:openapi/src/model/fruit_variant1.dart'; import 'package:openapi/src/model/giga_one_of.dart'; -part 'default_api.g.dart'; class DefaultApi { @@ -63,7 +62,7 @@ class DefaultApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( FooBasicGetDefaultResponse @@ -129,7 +128,7 @@ class DefaultApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( GigaOneOf @@ -195,7 +194,7 @@ class DefaultApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( Fruit @@ -248,7 +247,7 @@ class DefaultApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + _bodyData = await encodeBodyParameter(_repository, body, const TypeInfo.nullable( JsonObject @@ -308,7 +307,7 @@ class DefaultApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( FruitVariant1 @@ -374,7 +373,7 @@ class DefaultApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( FruitAllOfDisc diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart index 821054b216ce..0f374540241a 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_api.dart @@ -68,7 +68,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( HealthCheckResult @@ -125,7 +125,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, pet, const TypeInfo( Pet @@ -135,14 +135,14 @@ class FakeApi { final _response = await rawApi.fakeHttpSignatureTest( - query1: encodeQueryParameter(_repository, query1, const TypeInfo( + query1: await encodeQueryParameter(_repository, query1, const TypeInfo( String ) , ), - header1: encodeStringParameter(_repository, header1, const TypeInfo( + header1: await encodeStringParameter(_repository, header1, const TypeInfo( String @@ -186,7 +186,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, body, const TypeInfo( bool @@ -210,7 +210,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( bool @@ -263,7 +263,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, outerComposite, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, outerComposite, const TypeInfo( OuterComposite @@ -287,7 +287,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( OuterComposite @@ -340,7 +340,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, body, const TypeInfo( num @@ -364,7 +364,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( num @@ -417,7 +417,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, body, const TypeInfo( String @@ -441,7 +441,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( String @@ -494,7 +494,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, outerObjectWithEnumProperty, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, outerObjectWithEnumProperty, const TypeInfo( OuterObjectWithEnumProperty @@ -518,7 +518,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( OuterObjectWithEnumProperty @@ -571,7 +571,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, body, const TypeInfo.nullable( + _bodyData = await encodeBodyParameter(_repository, body, const TypeInfo.nullable( MultipartFile @@ -618,7 +618,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, fileSchemaTestClass, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, fileSchemaTestClass, const TypeInfo( FileSchemaTestClass @@ -667,7 +667,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, user, const TypeInfo( User @@ -677,7 +677,7 @@ class FakeApi { final _response = await rawApi.testBodyWithQueryParams( - query: encodeQueryParameter(_repository, query, const TypeInfo( + query: await encodeQueryParameter(_repository, query, const TypeInfo( String @@ -721,7 +721,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, modelClient, const TypeInfo( ModelClient @@ -745,7 +745,7 @@ class FakeApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( ModelClient @@ -825,98 +825,98 @@ class FakeApi { }) async { Object? _bodyData; final _bodyMap = { - if (integer != null) r'integer': encodeFormParameter(_repository, integer, const TypeInfo( + if (integer != null) r'integer': await encodeFormParameter(_repository, integer, const TypeInfo( int ) ), - if (int32 != null) r'int32': encodeFormParameter(_repository, int32, const TypeInfo( + if (int32 != null) r'int32': await encodeFormParameter(_repository, int32, const TypeInfo( int ) ), - if (int64 != null) r'int64': encodeFormParameter(_repository, int64, const TypeInfo( + if (int64 != null) r'int64': await encodeFormParameter(_repository, int64, const TypeInfo( int ) ), - r'number': encodeFormParameter(_repository, number, const TypeInfo( + r'number': await encodeFormParameter(_repository, number, const TypeInfo( num ) ), - if (float != null) r'float': encodeFormParameter(_repository, float, const TypeInfo( + if (float != null) r'float': await encodeFormParameter(_repository, float, const TypeInfo( double ) ), - r'double': encodeFormParameter(_repository, double_, const TypeInfo( + r'double': await encodeFormParameter(_repository, double_, const TypeInfo( double ) ), - if (string != null) r'string': encodeFormParameter(_repository, string, const TypeInfo( + if (string != null) r'string': await encodeFormParameter(_repository, string, const TypeInfo( String ) ), - r'pattern_without_delimiter': encodeFormParameter(_repository, patternWithoutDelimiter, const TypeInfo( + r'pattern_without_delimiter': await encodeFormParameter(_repository, patternWithoutDelimiter, const TypeInfo( String ) ), - r'byte': encodeFormParameter(_repository, byte, const TypeInfo( + r'byte': await encodeFormParameter(_repository, byte, const TypeInfo( String ) ), - if (binary != null) r'binary': encodeFormParameter(_repository, binary, const TypeInfo( + if (binary != null) r'binary': await encodeFormParameter(_repository, binary, const TypeInfo( Uint8List ) ), - if (date != null) r'date': encodeFormParameter(_repository, date, const TypeInfo( + if (date != null) r'date': await encodeFormParameter(_repository, date, const TypeInfo( Date ) ), - if (dateTime != null) r'dateTime': encodeFormParameter(_repository, dateTime, const TypeInfo( + if (dateTime != null) r'dateTime': await encodeFormParameter(_repository, dateTime, const TypeInfo( DateTime ) ), - if (password != null) r'password': encodeFormParameter(_repository, password, const TypeInfo( + if (password != null) r'password': await encodeFormParameter(_repository, password, const TypeInfo( String ) ), - if (callback != null) r'callback': encodeFormParameter(_repository, callback, const TypeInfo( + if (callback != null) r'callback': await encodeFormParameter(_repository, callback, const TypeInfo( String @@ -982,7 +982,7 @@ class FakeApi { }) async { Object? _bodyData; final _bodyMap = { - if (enumFormStringArray != null) r'enum_form_string_array': encodeFormParameter(_repository, enumFormStringArray, const TypeInfo( + if (enumFormStringArray != null) r'enum_form_string_array': await encodeFormParameter(_repository, enumFormStringArray, const TypeInfo( BuiltList, [ const TypeInfo( @@ -995,7 +995,7 @@ class FakeApi { ]) ), - if (enumFormString != null) r'enum_form_string': encodeFormParameter(_repository, enumFormString, const TypeInfo( + if (enumFormString != null) r'enum_form_string': await encodeFormParameter(_repository, enumFormString, const TypeInfo( EnumFormStringEnum @@ -1007,7 +1007,7 @@ class FakeApi { final _response = await rawApi.testEnumParameters( - enumHeaderStringArray: encodeStringParameter(_repository, enumHeaderStringArray, const TypeInfo( + enumHeaderStringArray: await encodeStringParameter(_repository, enumHeaderStringArray, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1020,14 +1020,14 @@ class FakeApi { ]) ), - enumHeaderString: encodeStringParameter(_repository, enumHeaderString, const TypeInfo( + enumHeaderString: await encodeStringParameter(_repository, enumHeaderString, const TypeInfo( EnumHeaderStringEnum ) ), - enumQueryStringArray: encodeQueryParameter(_repository, enumQueryStringArray, const TypeInfo( + enumQueryStringArray: await encodeQueryParameter(_repository, enumQueryStringArray, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1040,28 +1040,28 @@ class FakeApi { ]) , format: ListFormat.multi,), - enumQueryString: encodeQueryParameter(_repository, enumQueryString, const TypeInfo( + enumQueryString: await encodeQueryParameter(_repository, enumQueryString, const TypeInfo( EnumQueryStringEnum ) , ), - enumQueryInteger: encodeQueryParameter(_repository, enumQueryInteger, const TypeInfo( + enumQueryInteger: await encodeQueryParameter(_repository, enumQueryInteger, const TypeInfo( EnumQueryIntegerEnum ) , ), - enumQueryDouble: encodeQueryParameter(_repository, enumQueryDouble, const TypeInfo( + enumQueryDouble: await encodeQueryParameter(_repository, enumQueryDouble, const TypeInfo( EnumQueryDoubleEnum ) , ), - enumQueryModelArray: encodeQueryParameter(_repository, enumQueryModelArray, const TypeInfo( + enumQueryModelArray: await encodeQueryParameter(_repository, enumQueryModelArray, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1123,42 +1123,42 @@ class FakeApi { final _response = await rawApi.testGroupParameters( - requiredStringGroup: encodeQueryParameter(_repository, requiredStringGroup, const TypeInfo( + requiredStringGroup: await encodeQueryParameter(_repository, requiredStringGroup, const TypeInfo( int ) , ), - requiredBooleanGroup: encodeStringParameter(_repository, requiredBooleanGroup, const TypeInfo( + requiredBooleanGroup: await encodeStringParameter(_repository, requiredBooleanGroup, const TypeInfo( bool ) ), - requiredInt64Group: encodeQueryParameter(_repository, requiredInt64Group, const TypeInfo( + requiredInt64Group: await encodeQueryParameter(_repository, requiredInt64Group, const TypeInfo( int ) , ), - stringGroup: encodeQueryParameter(_repository, stringGroup, const TypeInfo( + stringGroup: await encodeQueryParameter(_repository, stringGroup, const TypeInfo( int ) , ), - booleanGroup: encodeStringParameter(_repository, booleanGroup, const TypeInfo( + booleanGroup: await encodeStringParameter(_repository, booleanGroup, const TypeInfo( bool ) ), - int64Group: encodeQueryParameter(_repository, int64Group, const TypeInfo( + int64Group: await encodeQueryParameter(_repository, int64Group, const TypeInfo( int @@ -1201,7 +1201,7 @@ class FakeApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, requestBody, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, requestBody, const TypeInfo( BuiltMap, [ TypeInfo(String), const TypeInfo( @@ -1257,14 +1257,14 @@ class FakeApi { }) async { Object? _bodyData; final _bodyMap = { - r'param': encodeFormParameter(_repository, param, const TypeInfo( + r'param': await encodeFormParameter(_repository, param, const TypeInfo( String ) ), - r'param2': encodeFormParameter(_repository, param2, const TypeInfo( + r'param2': await encodeFormParameter(_repository, param2, const TypeInfo( String @@ -1327,7 +1327,7 @@ class FakeApi { final _response = await rawApi.testQueryParameterCollectionFormat( - pipe: encodeQueryParameter(_repository, pipe, const TypeInfo( + pipe: await encodeQueryParameter(_repository, pipe, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1340,7 +1340,7 @@ class FakeApi { ]) , format: ListFormat.pipes,), - ioutil: encodeQueryParameter(_repository, ioutil, const TypeInfo( + ioutil: await encodeQueryParameter(_repository, ioutil, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1353,7 +1353,7 @@ class FakeApi { ]) , format: ListFormat.csv,), - http: encodeQueryParameter(_repository, http, const TypeInfo( + http: await encodeQueryParameter(_repository, http, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1366,7 +1366,7 @@ class FakeApi { ]) , format: ListFormat.ssv,), - url: encodeQueryParameter(_repository, url, const TypeInfo( + url: await encodeQueryParameter(_repository, url, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1379,7 +1379,7 @@ class FakeApi { ]) , format: ListFormat.csv,), - context: encodeQueryParameter(_repository, context, const TypeInfo( + context: await encodeQueryParameter(_repository, context, const TypeInfo( BuiltList, [ const TypeInfo( @@ -1392,14 +1392,14 @@ class FakeApi { ]) , format: ListFormat.multi,), - allowEmpty: encodeQueryParameter(_repository, allowEmpty, const TypeInfo( + allowEmpty: await encodeQueryParameter(_repository, allowEmpty, const TypeInfo( String ) , ), - language: encodeQueryParameter(_repository, language, const TypeInfo( + language: await encodeQueryParameter(_repository, language, const TypeInfo( BuiltMap, [ TypeInfo(String), const TypeInfo( diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart index 4b738508ff61..9562e3ef0516 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/fake_classname_tags123_api.dart @@ -12,7 +12,6 @@ import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; import 'package:openapi/src/model/model_client.dart'; -part 'fake_classname_tags123_api.g.dart'; class FakeClassnameTags123Api { @@ -45,7 +44,7 @@ class FakeClassnameTags123Api { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, modelClient, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, modelClient, const TypeInfo( ModelClient @@ -69,7 +68,7 @@ class FakeClassnameTags123Api { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( ModelClient diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart index 8a31381a45e4..3d46f23a463b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/foo_api.dart @@ -10,10 +10,10 @@ import 'package:built_value/serializer.dart'; import 'package:openapi/src/repository_base.dart'; import 'package:openapi/src/api_util.dart'; import 'package:openapi/models.dart'; +import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/foo.dart'; import 'package:openapi/src/model/foo_ref_or_value.dart'; -part 'foo_api.g.dart'; class FooApi { @@ -46,7 +46,7 @@ class FooApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, foo, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, foo, const TypeInfo( Foo @@ -70,7 +70,7 @@ class FooApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( FooRefOrValue @@ -136,7 +136,7 @@ class FooApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( BuiltList, [ const TypeInfo( diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart index d65f20abe9c6..435aa41e2c3b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/pet_api.dart @@ -47,7 +47,7 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, pet, const TypeInfo( Pet @@ -98,14 +98,14 @@ class PetApi { final _response = await rawApi.deletePet( - petId: encodeStringParameter(_repository, petId, const TypeInfo( + petId: await encodeStringParameter(_repository, petId, const TypeInfo( int ) ), - apiKey: encodeStringParameter(_repository, apiKey, const TypeInfo( + apiKey: await encodeStringParameter(_repository, apiKey, const TypeInfo( String @@ -150,7 +150,7 @@ class PetApi { final _response = await rawApi.findPetsByStatus( - status: encodeQueryParameter(_repository, status, const TypeInfo( + status: await encodeQueryParameter(_repository, status, const TypeInfo( BuiltList, [ const TypeInfo( @@ -176,7 +176,7 @@ class PetApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( BuiltList, [ const TypeInfo( @@ -238,7 +238,7 @@ class PetApi { final _response = await rawApi.findPetsByTags( - tags: encodeQueryParameter(_repository, tags, const TypeInfo( + tags: await encodeQueryParameter(_repository, tags, const TypeInfo( BuiltSet, [ const TypeInfo( @@ -264,7 +264,7 @@ class PetApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( BuiltSet, [ const TypeInfo( @@ -325,7 +325,7 @@ class PetApi { final _response = await rawApi.getPetById( - petId: encodeStringParameter(_repository, petId, const TypeInfo( + petId: await encodeStringParameter(_repository, petId, const TypeInfo( int @@ -345,7 +345,7 @@ class PetApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( Pet @@ -398,7 +398,7 @@ class PetApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, pet, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, pet, const TypeInfo( Pet @@ -450,14 +450,14 @@ class PetApi { }) async { Object? _bodyData; final _bodyMap = { - if (name != null) r'name': encodeFormParameter(_repository, name, const TypeInfo( + if (name != null) r'name': await encodeFormParameter(_repository, name, const TypeInfo( String ) ), - if (status != null) r'status': encodeFormParameter(_repository, status, const TypeInfo( + if (status != null) r'status': await encodeFormParameter(_repository, status, const TypeInfo( String @@ -469,7 +469,7 @@ class PetApi { final _response = await rawApi.updatePetWithForm( - petId: encodeStringParameter(_repository, petId, const TypeInfo( + petId: await encodeStringParameter(_repository, petId, const TypeInfo( int @@ -518,14 +518,14 @@ class PetApi { }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + if (additionalMetadata != null) r'additionalMetadata': await encodeFormParameter(_repository, additionalMetadata, const TypeInfo( String ) ), - if (file != null) r'file': encodeFormParameter(_repository, file, const TypeInfo( + if (file != null) r'file': await encodeFormParameter(_repository, file, const TypeInfo( MultipartFile @@ -537,7 +537,7 @@ class PetApi { final _response = await rawApi.uploadFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo( + petId: await encodeStringParameter(_repository, petId, const TypeInfo( int @@ -558,7 +558,7 @@ class PetApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( ApiResponse @@ -616,14 +616,14 @@ class PetApi { }) async { Object? _bodyData; final _bodyMap = { - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_repository, additionalMetadata, const TypeInfo( + if (additionalMetadata != null) r'additionalMetadata': await encodeFormParameter(_repository, additionalMetadata, const TypeInfo( String ) ), - r'requiredFile': encodeFormParameter(_repository, requiredFile, const TypeInfo( + r'requiredFile': await encodeFormParameter(_repository, requiredFile, const TypeInfo( MultipartFile @@ -635,7 +635,7 @@ class PetApi { final _response = await rawApi.uploadFileWithRequiredFile( - petId: encodeStringParameter(_repository, petId, const TypeInfo( + petId: await encodeStringParameter(_repository, petId, const TypeInfo( int @@ -656,7 +656,7 @@ class PetApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( ApiResponse diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart index 7a14f7a28ff8..be557dc64816 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/store_api.dart @@ -13,7 +13,6 @@ import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/order.dart'; -part 'store_api.g.dart'; class StoreApi { @@ -48,7 +47,7 @@ class StoreApi { final _response = await rawApi.deleteOrder( - orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + orderId: await encodeStringParameter(_repository, orderId, const TypeInfo( String @@ -104,7 +103,7 @@ class StoreApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( BuiltMap, [ TypeInfo(String), const TypeInfo( @@ -165,7 +164,7 @@ class StoreApi { final _response = await rawApi.getOrderById( - orderId: encodeStringParameter(_repository, orderId, const TypeInfo( + orderId: await encodeStringParameter(_repository, orderId, const TypeInfo( int @@ -185,7 +184,7 @@ class StoreApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( Order @@ -238,7 +237,7 @@ class StoreApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, order, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, order, const TypeInfo( Order @@ -262,7 +261,7 @@ class StoreApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( Order diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart index a70612cfedfb..caeb7be4f811 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api/user_api.dart @@ -13,7 +13,6 @@ import 'package:openapi/models.dart'; import 'package:built_collection/built_collection.dart'; import 'package:openapi/src/model/user.dart'; -part 'user_api.g.dart'; class UserApi { @@ -46,7 +45,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, user, const TypeInfo( User @@ -93,7 +92,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, user, const TypeInfo( BuiltList, [ const TypeInfo( @@ -146,7 +145,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, user, const TypeInfo( BuiltList, [ const TypeInfo( @@ -201,7 +200,7 @@ class UserApi { final _response = await rawApi.deleteUser( - username: encodeStringParameter(_repository, username, const TypeInfo( + username: await encodeStringParameter(_repository, username, const TypeInfo( String @@ -246,7 +245,7 @@ class UserApi { final _response = await rawApi.getUserByName( - username: encodeStringParameter(_repository, username, const TypeInfo( + username: await encodeStringParameter(_repository, username, const TypeInfo( String @@ -266,7 +265,7 @@ class UserApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( User @@ -323,14 +322,14 @@ class UserApi { final _response = await rawApi.loginUser( - username: encodeQueryParameter(_repository, username, const TypeInfo( + username: await encodeQueryParameter(_repository, username, const TypeInfo( String ) , ), - password: encodeQueryParameter(_repository, password, const TypeInfo( + password: await encodeQueryParameter(_repository, password, const TypeInfo( String @@ -350,7 +349,7 @@ class UserApi { try { final rawResponse = _response.data; - _responseData = rawResponse == null ? null : decodeResponse(_repository, rawResponse, const TypeInfo( + _responseData = rawResponse == null ? null : await decodeResponse(_repository, rawResponse, const TypeInfo( String @@ -441,7 +440,7 @@ class UserApi { ProgressCallback? onReceiveProgress, }) async { Object? _bodyData; - _bodyData = encodeBodyParameter(_repository, user, const TypeInfo( + _bodyData = await encodeBodyParameter(_repository, user, const TypeInfo( User @@ -451,7 +450,7 @@ class UserApi { final _response = await rawApi.updateUser( - username: encodeStringParameter(_repository, username, const TypeInfo( + username: await encodeStringParameter(_repository, username, const TypeInfo( String diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart index cca5b3427a0a..e6357fd191b6 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/api_util.dart @@ -1,57 +1,48 @@ import 'package:dio/dio.dart'; +import 'dart:async'; import 'dart:convert'; import 'package:openapi/models.dart'; import 'dart:typed_data'; /// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -Object encodeFormParameter( +Future encodeFormParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( - value, - type, - ); - return serialized; +) async { + return repository.serialize( + value, + type, + ); } -String encodeStringParameter( +Future encodeStringParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - return repository.serialize(value, type).toString(); +) async { + return (await repository.serialize(value, type)).toString(); } -Object encodeBodyParameter( +Future encodeBodyParameter( SerializationRepositoryBase repository, T value, TypeInfo type, -) { - if (value == null) { - return ''; - } - final serialized = repository.serialize( +) async { + return await repository.serialize( value, type, - ); - return serialized; + ); } -Object encodeQueryParameter( +Future encodeQueryParameter( SerializationRepositoryBase repository, T value, TypeInfo type, { ListFormat format = ListFormat.multi, -}) { +}) async { if (value == null) { - return ''; + return null; } if (value is String || value is num || value is bool) { return value; @@ -67,22 +58,25 @@ Object encodeQueryParameter( return serialized; } -ListParam encodeCollectionQueryParameter( +Future> encodeCollectionQueryParameter( SerializationRepositoryBase repository, Iterable value, TypeInfo type, { ListFormat format = ListFormat.multi, -}) { - final serialized = repository.serialize( +}) async { + final serialized = await repository.serialize( value, type, ); + if (serialized == null) { + return ListParam([], format); + } if (serialized is Iterable) { return ListParam(serialized.toList(), format); } throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); } -TOutput decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) { - return repository.deserialize(value, type); +Future decodeResponse(SerializationRepositoryBase repository, TInput value, TypeInfo type) async { + return await repository.deserialize(value, type); } \ No newline at end of file diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart index c4c2def37aa6..fa1f81f13c5b 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_base.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + /// The general rule for implementing this class is /// json == serialize(deserialize(json)) /// object == deserialize(serialize(object)) @@ -6,8 +8,8 @@ abstract class SerializationRepositoryBase { const SerializationRepositoryBase(); - FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); - FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); + FutureOr serialize(T src, TypeInfo inputTypeInfo, {Object? context,}); + FutureOr deserialize(Object? value, TypeInfo targetTypeInfo, {Object? context,}); } /// A modified version of `built_value`'s `FullType` class, found here diff --git a/samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart index c92bf3371b72..5d7c14063a21 100644 --- a/samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart +++ b/samples/client/echo_api/dart/dio/built_value/lib/src/repository_impl.dart @@ -2,7 +2,7 @@ // AUTO-GENERATED FILE, DO NOT MODIFY! // - +import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; diff --git a/samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart index c07a9bc22ba0..40e022fed3e9 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/additional_properties_class_test.dart @@ -8,9 +8,14 @@ void main() { group(AdditionalPropertiesClass, () { // BuiltMap mapProperty - test('to test the property `mapProperty`', () async {}); + test('to test the property `mapProperty`', () async { + + }); // BuiltMap> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async {}); + test('to test the property `mapOfMapProperty`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart b/samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart index 1bcecbfd9fd9..c4a77a1cf650 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/addressable_test.dart @@ -9,10 +9,15 @@ void main() { group(Addressable, () { // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart index c3c9e614338b..490f494682ae 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/all_of_with_single_ref_test.dart @@ -8,9 +8,14 @@ void main() { group(AllOfWithSingleRef, () { // String username - test('to test the property `username`', () async {}); + test('to test the property `username`', () async { + + }); // SingleRefType singleRefType - test('to test the property `singleRefType`', () async {}); + test('to test the property `singleRefType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/animal_test.dart b/samples/client/echo_api/dart/dio/built_value/test/animal_test.dart index 27ac771d0488..0aa21d74dfcd 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/animal_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/animal_test.dart @@ -8,9 +8,14 @@ void main() { group(Animal, () { // String className - test('to test the property `className`', () async {}); + test('to test the property `className`', () async { + + }); // String color (default value: 'red') - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart index 5b98fa2a4e0a..0757e851b3a6 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/another_fake_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for AnotherFakeApi void main() { final instance = Openapi().getAnotherFakeApi(); @@ -11,6 +12,9 @@ void main() { // To test special tags and operation ID starting with number // //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async {}); + test('test call123testSpecialTags', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart index 4eff382b9c65..59c1e9c586a0 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/api_response_test.dart @@ -8,12 +8,19 @@ void main() { group(ApiResponse, () { // int code - test('to test the property `code`', () async {}); + test('to test the property `code`', () async { + + }); // String type - test('to test the property `type`', () async {}); + test('to test the property `type`', () async { + + }); // String message - test('to test the property `message`', () async {}); + test('to test the property `message`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart index a60557855cf7..67dd9dde51f9 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_all_of_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(AppleAllOfDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart index 6d63b53809f9..85880e3d6b86 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_grandparent_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(AppleGrandparentDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart index 17c2c40475ec..2ccf5b7eb6f8 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_one_of_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(AppleOneOfDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart index 725750c8a2cf..0ac1e13b40ed 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_req_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(AppleReqDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_test.dart index 2c70979c9b51..22b482545d13 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_test.dart @@ -8,6 +8,9 @@ void main() { group(Apple, () { // String kind - test('to test the property `kind`', () async {}); + test('to test the property `kind`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart index bac42d3d78cb..0151ca4c20a5 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/apple_variant1_test.dart @@ -8,6 +8,9 @@ void main() { group(AppleVariant1, () { // String kind - test('to test the property `kind`', () async {}); + test('to test the property `kind`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart index 1d1a4465426a..02602681bdbe 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/array_of_array_of_number_only_test.dart @@ -8,6 +8,9 @@ void main() { group(ArrayOfArrayOfNumberOnly, () { // BuiltList> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async {}); + test('to test the property `arrayArrayNumber`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart index 491cea2fe307..edb8aa49e919 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/array_of_number_only_test.dart @@ -8,6 +8,9 @@ void main() { group(ArrayOfNumberOnly, () { // BuiltList arrayNumber - test('to test the property `arrayNumber`', () async {}); + test('to test the property `arrayNumber`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart index e33be3375c3b..2a1a3f6d05c2 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/array_test_test.dart @@ -8,12 +8,19 @@ void main() { group(ArrayTest, () { // BuiltList arrayOfString - test('to test the property `arrayOfString`', () async {}); + test('to test the property `arrayOfString`', () async { + + }); // BuiltList> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async {}); + test('to test the property `arrayArrayOfInteger`', () async { + + }); // BuiltList> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async {}); + test('to test the property `arrayArrayOfModel`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart index cf66d3a165f9..76cca6a7f004 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/banana_all_of_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(BananaAllOfDisc, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart index 2f9969c1733a..1e661c1bd49f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/banana_grandparent_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(BananaGrandparentDisc, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart index 973707c9dd6a..486de1e22edb 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/banana_one_of_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(BananaOneOfDisc, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart index 70e07cc4b1a1..4ab55caa6802 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/banana_req_disc_test.dart @@ -8,9 +8,14 @@ void main() { group(BananaReqDisc, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/banana_test.dart b/samples/client/echo_api/dart/dio/built_value/test/banana_test.dart index 0678b7d72e9d..4f894091034a 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/banana_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/banana_test.dart @@ -8,6 +8,9 @@ void main() { group(Banana, () { // num count - test('to test the property `count`', () async {}); + test('to test the property `count`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart index b85771fca95b..58c9cede8213 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/bar_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for BarApi void main() { final instance = Openapi().getBarApi(); @@ -9,6 +10,9 @@ void main() { // Create a Bar // //Future createBar(BarCreate barCreate) async - test('test createBar', () async {}); + test('test createBar', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart index 4a3ea406fdb7..a33ea27b37e4 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/bar_create_test.dart @@ -8,32 +8,49 @@ void main() { group(BarCreate, () { // String barPropA - test('to test the property `barPropA`', () async {}); + test('to test the property `barPropA`', () async { + + }); // String fooPropB - test('to test the property `fooPropB`', () async {}); + test('to test the property `fooPropB`', () async { + + }); // FooRefOrValue foo - test('to test the property `foo`', () async {}); + test('to test the property `foo`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart index b8890050e0c5..b87ff202d239 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_or_value_test.dart @@ -9,22 +9,33 @@ void main() { group(BarRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart index acd5cb762a2f..9487e640203f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/bar_ref_test.dart @@ -9,22 +9,33 @@ void main() { group(BarRef, () { // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/bar_test.dart b/samples/client/echo_api/dart/dio/built_value/test/bar_test.dart index 8d6eb79ac955..5c2c67f5ae76 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/bar_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/bar_test.dart @@ -8,31 +8,48 @@ void main() { group(Bar, () { // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // String barPropA - test('to test the property `barPropA`', () async {}); + test('to test the property `barPropA`', () async { + + }); // String fooPropB - test('to test the property `fooPropB`', () async {}); + test('to test the property `fooPropB`', () async { + + }); // FooRefOrValue foo - test('to test the property `foo`', () async {}); + test('to test the property `foo`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart b/samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart index 585d6d62657e..151fda310a24 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/capitalization_test.dart @@ -8,22 +8,35 @@ void main() { group(Capitalization, () { // String smallCamel - test('to test the property `smallCamel`', () async {}); + test('to test the property `smallCamel`', () async { + + }); // String capitalCamel - test('to test the property `capitalCamel`', () async {}); + test('to test the property `capitalCamel`', () async { + + }); // String smallSnake - test('to test the property `smallSnake`', () async {}); + test('to test the property `smallSnake`', () async { + + }); // String capitalSnake - test('to test the property `capitalSnake`', () async {}); + test('to test the property `capitalSnake`', () async { + + }); // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async {}); + test('to test the property `sCAETHFlowPoints`', () async { + + }); - // Name of the pet + // Name of the pet // String ATT_NAME - test('to test the property `ATT_NAME`', () async {}); + test('to test the property `ATT_NAME`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/cat_test.dart b/samples/client/echo_api/dart/dio/built_value/test/cat_test.dart index 37ddce486e87..898a27283f66 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/cat_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/cat_test.dart @@ -8,12 +8,19 @@ void main() { group(Cat, () { // String className - test('to test the property `className`', () async {}); + test('to test the property `className`', () async { + + }); // String color (default value: 'red') - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); // bool declawed - test('to test the property `declawed`', () async {}); + test('to test the property `declawed`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/category_test.dart b/samples/client/echo_api/dart/dio/built_value/test/category_test.dart index 33e7f0eb3817..126f133c887f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/category_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/category_test.dart @@ -8,9 +8,14 @@ void main() { group(Category, () { // int id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // String name (default value: 'default-name') - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart b/samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart index 61ff5834b458..14bed24b5a34 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/class_model_test.dart @@ -8,6 +8,9 @@ void main() { group(ClassModel, () { // String classField - test('to test the property `classField`', () async {}); + test('to test the property `classField`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart index df4bfa1fde89..bea72d8d3874 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_missing_from_properties_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscMissingFromProperties, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart index 07e3393ce709..cb269e29feda 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_correct_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart index e7dbb5928f9a..47e6c8eb1b96 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_inconsistent_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscOptionalTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart index 0881c1656115..6a6e5fe5856d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_optional_type_incorrect_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart index 66a290d8945e..78826cc59f3d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_required_inconsistent_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscRequiredInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart index b03c47bad3ea..63f54c3f2f3e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_inconsistent_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscTypeInconsistent, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart index ce7b12f0d535..f173a14b00f6 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/composed_disc_type_incorrect_test.dart @@ -8,6 +8,9 @@ void main() { group(ComposedDiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart index 3330a732290e..d6284b93034d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/default_api_test.dart @@ -1,27 +1,41 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for DefaultApi void main() { final instance = Openapi().getDefaultApi(); group(DefaultApi, () { //Future fooBasicGet() async - test('test fooBasicGet', () async {}); + test('test fooBasicGet', () async { + + }); //Future list() async - test('test list', () async {}); + test('test list', () async { + + }); //Future oneofGet() async - test('test oneofGet', () async {}); + test('test oneofGet', () async { + + }); //Future test({ JsonObject body }) async - test('test test', () async {}); + test('test test', () async { + + }); //Future variant1Get() async - test('test variant1Get', () async {}); + test('test variant1Get', () async { + + }); //Future variant2Get() async - test('test variant2Get', () async {}); + test('test variant2Get', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart b/samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart index a921940cfbba..3bdc8aea4c5d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/deprecated_object_test.dart @@ -8,6 +8,9 @@ void main() { group(DeprecatedObject, () { // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart index ba42a35b5787..bb18991d6968 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/disc_missing_from_properties_test.dart @@ -8,6 +8,9 @@ void main() { group(DiscMissingFromProperties, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart index bb317950a76c..44b2c350eb91 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_correct_test.dart @@ -8,6 +8,9 @@ void main() { group(DiscOptionalTypeCorrect, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart index 99434f6da66e..6e73d4e6bb40 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/disc_optional_type_incorrect_test.dart @@ -8,6 +8,9 @@ void main() { group(DiscOptionalTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart b/samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart index c2a907a4a142..d5ab15bcff73 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/disc_type_incorrect_test.dart @@ -8,6 +8,9 @@ void main() { group(DiscTypeIncorrect, () { // int fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/dog_test.dart b/samples/client/echo_api/dart/dio/built_value/test/dog_test.dart index 473aa680ac0c..f8d6c721171a 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/dog_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/dog_test.dart @@ -8,12 +8,19 @@ void main() { group(Dog, () { // String className - test('to test the property `className`', () async {}); + test('to test the property `className`', () async { + + }); // String color (default value: 'red') - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); // String breed - test('to test the property `breed`', () async {}); + test('to test the property `breed`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart index 70d28bc3226f..7610daf76a74 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/entity_ref_test.dart @@ -9,30 +9,45 @@ void main() { group(EntityRef, () { // Name of the related entity. // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); // The actual type of the target instance when needed for disambiguation. // String atReferredType - test('to test the property `atReferredType`', () async {}); + test('to test the property `atReferredType`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/entity_test.dart b/samples/client/echo_api/dart/dio/built_value/test/entity_test.dart index d8c1fddd1705..6d6c818f265b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/entity_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/entity_test.dart @@ -9,22 +9,33 @@ void main() { group(Entity, () { // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart b/samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart index 3ec881278f35..509ceb91e36e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/enum_arrays_test.dart @@ -8,9 +8,14 @@ void main() { group(EnumArrays, () { // String justSymbol - test('to test the property `justSymbol`', () async {}); + test('to test the property `justSymbol`', () async { + + }); // BuiltList arrayEnum - test('to test the property `arrayEnum`', () async {}); + test('to test the property `arrayEnum`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart index 115876ca53aa..90598431361b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/enum_test_test.dart @@ -8,27 +8,44 @@ void main() { group(EnumTest, () { // String enumString - test('to test the property `enumString`', () async {}); + test('to test the property `enumString`', () async { + + }); // String enumStringRequired - test('to test the property `enumStringRequired`', () async {}); + test('to test the property `enumStringRequired`', () async { + + }); // int enumInteger - test('to test the property `enumInteger`', () async {}); + test('to test the property `enumInteger`', () async { + + }); // double enumNumber - test('to test the property `enumNumber`', () async {}); + test('to test the property `enumNumber`', () async { + + }); // OuterEnum outerEnum - test('to test the property `outerEnum`', () async {}); + test('to test the property `outerEnum`', () async { + + }); // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async {}); + test('to test the property `outerEnumInteger`', () async { + + }); // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async {}); + test('to test the property `outerEnumDefaultValue`', () async { + + }); // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async {}); + test('to test the property `outerEnumIntegerDefaultValue`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart b/samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart index 2c9d0014abe0..34ef96c21cd3 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/extensible_test.dart @@ -9,14 +9,21 @@ void main() { group(Extensible, () { // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart index 03e275390fca..61d46be0cd9f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fake_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for FakeApi void main() { final instance = Openapi().getFakeApi(); @@ -9,96 +10,131 @@ void main() { // Health check endpoint // //Future fakeHealthGet() async - test('test fakeHealthGet', () async {}); + test('test fakeHealthGet', () async { + + }); // test http signature authentication // //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async {}); + test('test fakeHttpSignatureTest', () async { + + }); // Test serialization of outer boolean types // //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async {}); + test('test fakeOuterBooleanSerialize', () async { + + }); // Test serialization of object with outer number type // //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async {}); + test('test fakeOuterCompositeSerialize', () async { + + }); // Test serialization of outer number types // //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async {}); + test('test fakeOuterNumberSerialize', () async { + + }); // Test serialization of outer string types // //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async {}); + test('test fakeOuterStringSerialize', () async { + + }); // Test serialization of enum (int) properties with examples // //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async {}); + test('test fakePropertyEnumIntegerSerialize', () async { + + }); // For this test, the body has to be a binary file. // //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async {}); + test('test testBodyWithBinary', () async { + + }); // For this test, the body for this request must reference a schema named `File`. // //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async {}); + test('test testBodyWithFileSchema', () async { + + }); //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async {}); + test('test testBodyWithQueryParams', () async { + + }); // To test \"client\" model // // To test \"client\" model // //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async {}); + test('test testClientModel', () async { + + }); - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 // //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async {}); + test('test testEndpointParameters', () async { + + }); // To test enum parameters // // To test enum parameters // //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumQueryModelArray, BuiltList enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async {}); + test('test testEnumParameters', () async { + + }); // Fake endpoint to test group parameters (optional) // // Fake endpoint to test group parameters (optional) // //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async {}); + test('test testGroupParameters', () async { + + }); // test inline additionalProperties // - // + // // //Future testInlineAdditionalProperties(BuiltMap requestBody) async - test('test testInlineAdditionalProperties', () async {}); + test('test testInlineAdditionalProperties', () async { + + }); // test json serialization of form data // - // + // // //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async {}); + test('test testJsonFormData', () async { + + }); // To test the collection format in query parameters // //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async - test('test testQueryParameterCollectionFormat', () async {}); + test('test testQueryParameterCollectionFormat', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart index e2b2e38526dd..d07b8ee850bf 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fake_classname_tags123_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for FakeClassnameTags123Api void main() { final instance = Openapi().getFakeClassnameTags123Api(); @@ -11,6 +12,9 @@ void main() { // To test class name in snake case // //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async {}); + test('test testClassname', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart index 1264053bcb2d..09fd67587633 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/file_schema_test_class_test.dart @@ -8,9 +8,14 @@ void main() { group(FileSchemaTestClass, () { // ModelFile file - test('to test the property `file`', () async {}); + test('to test the property `file`', () async { + + }); // BuiltList files - test('to test the property `files`', () async {}); + test('to test the property `files`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart index 66daa2bdb5b2..d10dabe192bd 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/foo_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for FooApi void main() { final instance = Openapi().getFooApi(); @@ -9,11 +10,16 @@ void main() { // Create a Foo // //Future createFoo({ Foo foo }) async - test('test createFoo', () async {}); + test('test createFoo', () async { + + }); // GET all Foos // //Future> getAllFoos() async - test('test getAllFoos', () async {}); + test('test getAllFoos', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart index 4efb1929b0e8..2355d28d6e9e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/foo_basic_get_default_response_test.dart @@ -8,6 +8,9 @@ void main() { group(FooBasicGetDefaultResponse, () { // Foo string - test('to test the property `string`', () async {}); + test('to test the property `string`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart index b167f0627ffd..fd0493074f0a 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_or_value_test.dart @@ -9,22 +9,33 @@ void main() { group(FooRefOrValue, () { // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart index 7eb4462f80f7..b54542e7773b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/foo_ref_test.dart @@ -8,26 +8,39 @@ void main() { group(FooRef, () { // String foorefPropA - test('to test the property `foorefPropA`', () async {}); + test('to test the property `foorefPropA`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/foo_test.dart b/samples/client/echo_api/dart/dio/built_value/test/foo_test.dart index 5bd90ef32ed2..d6888100f6bd 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/foo_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/foo_test.dart @@ -8,29 +8,44 @@ void main() { group(Foo, () { // String fooPropA - test('to test the property `fooPropA`', () async {}); + test('to test the property `fooPropA`', () async { + + }); // String fooPropB - test('to test the property `fooPropB`', () async {}); + test('to test the property `fooPropB`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart index 672761823d83..1aae302fe6e6 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/format_test_test.dart @@ -8,53 +8,86 @@ void main() { group(FormatTest, () { // int integer - test('to test the property `integer`', () async {}); + test('to test the property `integer`', () async { + + }); // int int32 - test('to test the property `int32`', () async {}); + test('to test the property `int32`', () async { + + }); // int int64 - test('to test the property `int64`', () async {}); + test('to test the property `int64`', () async { + + }); // num number - test('to test the property `number`', () async {}); + test('to test the property `number`', () async { + + }); // double float - test('to test the property `float`', () async {}); + test('to test the property `float`', () async { + + }); // double double_ - test('to test the property `double_`', () async {}); + test('to test the property `double_`', () async { + + }); // double decimal - test('to test the property `decimal`', () async {}); + test('to test the property `decimal`', () async { + + }); // String string - test('to test the property `string`', () async {}); + test('to test the property `string`', () async { + + }); // String byte - test('to test the property `byte`', () async {}); + test('to test the property `byte`', () async { + + }); // Uint8List binary - test('to test the property `binary`', () async {}); + test('to test the property `binary`', () async { + + }); // Date date - test('to test the property `date`', () async {}); + test('to test the property `date`', () async { + + }); // DateTime dateTime - test('to test the property `dateTime`', () async {}); + test('to test the property `dateTime`', () async { + + }); // String uuid - test('to test the property `uuid`', () async {}); + test('to test the property `uuid`', () async { + + }); // String password - test('to test the property `password`', () async {}); + test('to test the property `password`', () async { + + }); // A string that is a 10 digit number. Can have leading zeros. // String patternWithDigits - test('to test the property `patternWithDigits`', () async {}); + test('to test the property `patternWithDigits`', () async { + + }); // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async {}); + test('to test the property `patternWithDigitsAndDelimiter`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart index f819488cacd7..0c5a0c94b5a2 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_all_of_disc_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitAllOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart index 083549013a3a..d681791cf233 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_any_of_disc_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitAnyOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart index e2b0902cdf1e..2c846c4f0fbf 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_grandparent_disc_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitGrandparentDisc, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart index 9f76c006f85b..89e960a80e12 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of1_test.dart @@ -8,9 +8,14 @@ void main() { group(FruitInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart index 867200109263..ecb67890a553 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_one_of_test.dart @@ -8,9 +8,14 @@ void main() { group(FruitInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart index 289554d087d9..d30e8a372635 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_disc_test.dart @@ -8,12 +8,19 @@ void main() { group(FruitInlineDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart index 8698c0c9b737..8c68ea279329 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of1_test.dart @@ -8,9 +8,14 @@ void main() { group(FruitInlineInlineDiscOneOf1, () { // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart index 0db995287f6c..763900f0b417 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_one_of_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitInlineInlineDiscOneOfOneOf, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart index 0871a31ca2d1..481e0ef28d3b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_one_of_test.dart @@ -8,9 +8,14 @@ void main() { group(FruitInlineInlineDiscOneOf, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart index 01dc0d7ba46b..c8c31be34fff 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_inline_inline_disc_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitInlineInlineDisc, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart index 809de19ee018..ea556220176d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_one_of_disc_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitOneOfDisc, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart index b35113f22b3b..800d81b06bdf 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_req_disc_test.dart @@ -8,12 +8,19 @@ void main() { group(FruitReqDisc, () { // int seeds - test('to test the property `seeds`', () async {}); + test('to test the property `seeds`', () async { + + }); // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); // int length - test('to test the property `length`', () async {}); + test('to test the property `length`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart index dbc551de8fab..754264134074 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_test.dart @@ -8,12 +8,19 @@ void main() { group(Fruit, () { // String color - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); // String kind - test('to test the property `kind`', () async {}); + test('to test the property `kind`', () async { + + }); // num count - test('to test the property `count`', () async {}); + test('to test the property `count`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart index 43aa0db383b2..4b6b0c7aaf51 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_type_test.dart @@ -8,6 +8,9 @@ void main() { group(FruitType, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart index 63fa22d46499..f96a78ae85b7 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/fruit_variant1_test.dart @@ -8,9 +8,14 @@ void main() { group(FruitVariant1, () { // String color - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); // String kind - test('to test the property `kind`', () async {}); + test('to test the property `kind`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart b/samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart index 04b8c85290ee..c29bd533837b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/giga_one_of_test.dart @@ -8,6 +8,9 @@ void main() { group(GigaOneOf, () { // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart b/samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart index 87696795e46b..952375bc2b0f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/grape_variant1_test.dart @@ -8,6 +8,9 @@ void main() { group(GrapeVariant1, () { // String color - test('to test the property `color`', () async {}); + test('to test the property `color`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart index c0db81ee6dfc..fe29de48575c 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/has_only_read_only_test.dart @@ -8,9 +8,14 @@ void main() { group(HasOnlyReadOnly, () { // String bar - test('to test the property `bar`', () async {}); + test('to test the property `bar`', () async { + + }); // String foo - test('to test the property `foo`', () async {}); + test('to test the property `foo`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart b/samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart index 09374fc01b6c..1d59d8a8d112 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/health_check_result_test.dart @@ -8,6 +8,9 @@ void main() { group(HealthCheckResult, () { // String nullableMessage - test('to test the property `nullableMessage`', () async {}); + test('to test the property `nullableMessage`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart b/samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart index 855a2a7075bf..2fb8db875105 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/map_test_test.dart @@ -8,15 +8,24 @@ void main() { group(MapTest, () { // BuiltMap> mapMapOfString - test('to test the property `mapMapOfString`', () async {}); + test('to test the property `mapMapOfString`', () async { + + }); // BuiltMap mapOfEnumString - test('to test the property `mapOfEnumString`', () async {}); + test('to test the property `mapOfEnumString`', () async { + + }); // BuiltMap directMap - test('to test the property `directMap`', () async {}); + test('to test the property `directMap`', () async { + + }); // BuiltMap indirectMap - test('to test the property `indirectMap`', () async {}); + test('to test the property `indirectMap`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart index 25f4383f9a2f..dafafae5b472 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/mixed_properties_and_additional_properties_class_test.dart @@ -8,12 +8,19 @@ void main() { group(MixedPropertiesAndAdditionalPropertiesClass, () { // String uuid - test('to test the property `uuid`', () async {}); + test('to test the property `uuid`', () async { + + }); // DateTime dateTime - test('to test the property `dateTime`', () async {}); + test('to test the property `dateTime`', () async { + + }); // BuiltMap map - test('to test the property `map`', () async {}); + test('to test the property `map`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart index 75e433c1960e..d7d724ce997e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model200_response_test.dart @@ -8,9 +8,14 @@ void main() { group(Model200Response, () { // int name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); // String classField - test('to test the property `classField`', () async {}); + test('to test the property `classField`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart index 2e99f627104a..72ea87cc0a64 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model_client_test.dart @@ -8,6 +8,9 @@ void main() { group(ModelClient, () { // String client - test('to test the property `client`', () async {}); + test('to test the property `client`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart index fa31f816801c..03e5855bf004 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model_enum_class_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for ModelEnumClass void main() { - group(ModelEnumClass, () {}); + + group(ModelEnumClass, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart index 1f5e162d4d53..bc7069a89bd4 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model_file_test.dart @@ -9,6 +9,9 @@ void main() { group(ModelFile, () { // Test capitalization // String sourceURI - test('to test the property `sourceURI`', () async {}); + test('to test the property `sourceURI`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart index c8b1ec50b4f2..1e5f472f3d61 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model_list_test.dart @@ -8,6 +8,9 @@ void main() { group(ModelList, () { // String n123list - test('to test the property `n123list`', () async {}); + test('to test the property `n123list`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart b/samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart index cae8e13559e6..45d6463bcde7 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/model_return_test.dart @@ -8,6 +8,9 @@ void main() { group(ModelReturn, () { // int return_ - test('to test the property `return_`', () async {}); + test('to test the property `return_`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/name_test.dart b/samples/client/echo_api/dart/dio/built_value/test/name_test.dart index 3dae7f131506..455d8a0b9bad 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/name_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/name_test.dart @@ -8,15 +8,24 @@ void main() { group(Name, () { // int name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); // int snakeCase - test('to test the property `snakeCase`', () async {}); + test('to test the property `snakeCase`', () async { + + }); // String property - test('to test the property `property`', () async {}); + test('to test the property `property`', () async { + + }); // int n123number - test('to test the property `n123number`', () async {}); + test('to test the property `n123number`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart b/samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart index 2bedc2c5d07f..e8bbd567bb14 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/nullable_class_test.dart @@ -8,39 +8,64 @@ void main() { group(NullableClass, () { // int integerProp - test('to test the property `integerProp`', () async {}); + test('to test the property `integerProp`', () async { + + }); // num numberProp - test('to test the property `numberProp`', () async {}); + test('to test the property `numberProp`', () async { + + }); // bool booleanProp - test('to test the property `booleanProp`', () async {}); + test('to test the property `booleanProp`', () async { + + }); // String stringProp - test('to test the property `stringProp`', () async {}); + test('to test the property `stringProp`', () async { + + }); // Date dateProp - test('to test the property `dateProp`', () async {}); + test('to test the property `dateProp`', () async { + + }); // DateTime datetimeProp - test('to test the property `datetimeProp`', () async {}); + test('to test the property `datetimeProp`', () async { + + }); // BuiltList arrayNullableProp - test('to test the property `arrayNullableProp`', () async {}); + test('to test the property `arrayNullableProp`', () async { + + }); // BuiltList arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async {}); + test('to test the property `arrayAndItemsNullableProp`', () async { + + }); // BuiltList arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async {}); + test('to test the property `arrayItemsNullable`', () async { + + }); // BuiltMap objectNullableProp - test('to test the property `objectNullableProp`', () async {}); + test('to test the property `objectNullableProp`', () async { + + }); // BuiltMap objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async {}); + test('to test the property `objectAndItemsNullableProp`', () async { + + }); // BuiltMap objectItemsNullable - test('to test the property `objectItemsNullable`', () async {}); + test('to test the property `objectItemsNullable`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart b/samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart index 51c99d0940ae..a3144be404d4 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/number_only_test.dart @@ -8,6 +8,9 @@ void main() { group(NumberOnly, () { // num justNumber - test('to test the property `justNumber`', () async {}); + test('to test the property `justNumber`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart b/samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart index 8bc4de110c80..d22575d850f0 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/object_with_deprecated_fields_test.dart @@ -8,15 +8,24 @@ void main() { group(ObjectWithDeprecatedFields, () { // String uuid - test('to test the property `uuid`', () async {}); + test('to test the property `uuid`', () async { + + }); // num id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async {}); + test('to test the property `deprecatedRef`', () async { + + }); // BuiltList bars - test('to test the property `bars`', () async {}); + test('to test the property `bars`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart b/samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart index e6a050464f76..c398b53088f0 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/one_of_primitive_child_test.dart @@ -8,6 +8,9 @@ void main() { group(OneOfPrimitiveChild, () { // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/order_test.dart b/samples/client/echo_api/dart/dio/built_value/test/order_test.dart index b1e140131007..2737c4bb6d6b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/order_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/order_test.dart @@ -8,22 +8,35 @@ void main() { group(Order, () { // int id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // int petId - test('to test the property `petId`', () async {}); + test('to test the property `petId`', () async { + + }); // int quantity - test('to test the property `quantity`', () async {}); + test('to test the property `quantity`', () async { + + }); // DateTime shipDate - test('to test the property `shipDate`', () async {}); + test('to test the property `shipDate`', () async { + + }); // Order Status // String status - test('to test the property `status`', () async {}); + test('to test the property `status`', () async { + + }); // bool complete (default value: false) - test('to test the property `complete`', () async {}); + test('to test the property `complete`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart index dfb42ab6eb07..609209a6adff 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_composite_test.dart @@ -8,12 +8,19 @@ void main() { group(OuterComposite, () { // num myNumber - test('to test the property `myNumber`', () async {}); + test('to test the property `myNumber`', () async { + + }); // String myString - test('to test the property `myString`', () async {}); + test('to test the property `myString`', () async { + + }); // bool myBoolean - test('to test the property `myBoolean`', () async {}); + test('to test the property `myBoolean`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart index a5c83f615194..502c8326be58 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_default_value_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumDefaultValue void main() { - group(OuterEnumDefaultValue, () {}); + + group(OuterEnumDefaultValue, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart index 49ebbfcead7f..c535fe8ac354 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_default_value_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumIntegerDefaultValue void main() { - group(OuterEnumIntegerDefaultValue, () {}); + + group(OuterEnumIntegerDefaultValue, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart index 3c6b81305c71..d945bc8c489d 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_integer_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnumInteger void main() { - group(OuterEnumInteger, () {}); + + group(OuterEnumInteger, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart index 4ee10f379d5e..8e11eb02fb8a 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_enum_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for OuterEnum void main() { - group(OuterEnum, () {}); + + group(OuterEnum, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart b/samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart index e0d4c80f00c8..53532aae9c75 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/outer_object_with_enum_property_test.dart @@ -8,6 +8,9 @@ void main() { group(OuterObjectWithEnumProperty, () { // OuterEnumInteger value - test('to test the property `value`', () async {}); + test('to test the property `value`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/parent_test.dart b/samples/client/echo_api/dart/dio/built_value/test/parent_test.dart index 0b04c690c5eb..656e58714ae0 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/parent_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/parent_test.dart @@ -8,6 +8,9 @@ void main() { group(Parent, () { // String fruitType - test('to test the property `fruitType`', () async {}); + test('to test the property `fruitType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart index 1883898d1e68..21fd7d2af32a 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/pasta_test.dart @@ -8,26 +8,39 @@ void main() { group(Pasta, () { // String vendor - test('to test the property `vendor`', () async {}); + test('to test the property `vendor`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart index 373d26c1a5ee..a23dda20c185 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/pet_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for PetApi void main() { final instance = Openapi().getPetApi(); @@ -8,65 +9,84 @@ void main() { group(PetApi, () { // Add a new pet to the store // - // + // // //Future addPet(Pet pet) async - test('test addPet', () async {}); + test('test addPet', () async { + + }); // Deletes a pet // - // + // // //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async {}); + test('test deletePet', () async { + + }); // Finds Pets by status // // Multiple status values can be provided with comma separated strings // //Future> findPetsByStatus(BuiltList status) async - test('test findPetsByStatus', () async {}); + test('test findPetsByStatus', () async { + + }); // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // //Future> findPetsByTags(BuiltSet tags) async - test('test findPetsByTags', () async {}); + test('test findPetsByTags', () async { + + }); // Find pet by ID // // Returns a single pet // //Future getPetById(int petId) async - test('test getPetById', () async {}); + test('test getPetById', () async { + + }); // Update an existing pet // - // + // // //Future updatePet(Pet pet) async - test('test updatePet', () async {}); + test('test updatePet', () async { + + }); // Updates a pet in the store with form data // - // + // // //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async {}); + test('test updatePetWithForm', () async { + + }); // uploads an image // - // + // // //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async {}); + test('test uploadFile', () async { + + }); // uploads an image (required) // - // + // // //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async {}); + test('test uploadFileWithRequiredFile', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/pet_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pet_test.dart index bc228a2447a8..e1f81f3f947e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/pet_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/pet_test.dart @@ -8,22 +8,35 @@ void main() { group(Pet, () { // int id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // Category category - test('to test the property `category`', () async {}); + test('to test the property `category`', () async { + + }); // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); // BuiltSet photoUrls - test('to test the property `photoUrls`', () async {}); + test('to test the property `photoUrls`', () async { + + }); // BuiltList tags - test('to test the property `tags`', () async {}); + test('to test the property `tags`', () async { + + }); // pet status in the store // String status - test('to test the property `status`', () async {}); + test('to test the property `status`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart index 84d5ef417e99..9a49ca408907 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/pizza_speziale_test.dart @@ -8,26 +8,39 @@ void main() { group(PizzaSpeziale, () { // String toppings - test('to test the property `toppings`', () async {}); + test('to test the property `toppings`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart b/samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart index bab1b1c52812..f14838fbb0e9 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/pizza_test.dart @@ -8,26 +8,39 @@ void main() { group(Pizza, () { // num pizzaSize - test('to test the property `pizzaSize`', () async {}); + test('to test the property `pizzaSize`', () async { + + }); // Hyperlink reference // String href - test('to test the property `href`', () async {}); + test('to test the property `href`', () async { + + }); // unique identifier // String id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // A URI to a JSON-Schema file that defines additional attributes and relationships // String atSchemaLocation - test('to test the property `atSchemaLocation`', () async {}); + test('to test the property `atSchemaLocation`', () async { + + }); // When sub-classing, this defines the super-class // String atBaseType - test('to test the property `atBaseType`', () async {}); + test('to test the property `atBaseType`', () async { + + }); // When sub-classing, this defines the sub-class Extensible name // String atType - test('to test the property `atType`', () async {}); + test('to test the property `atType`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart b/samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart index 900cc8bfe94f..7e5e43c6f1d5 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/read_only_first_test.dart @@ -8,9 +8,14 @@ void main() { group(ReadOnlyFirst, () { // String bar - test('to test the property `bar`', () async {}); + test('to test the property `bar`', () async { + + }); // String baz - test('to test the property `baz`', () async {}); + test('to test the property `baz`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart b/samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart index 2c265f0d24ae..5cd85add393e 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/single_ref_type_test.dart @@ -3,5 +3,7 @@ import 'package:openapi/openapi.dart'; // tests for SingleRefType void main() { - group(SingleRefType, () {}); + + group(SingleRefType, () { + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart b/samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart index d2c7227d6a25..15f2b00fd3fe 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/special_model_name_test.dart @@ -8,8 +8,9 @@ void main() { group(SpecialModelName, () { // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test( - 'to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', - () async {}); + test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart index ed22c06ba895..c43f648131e8 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/store_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for StoreApi void main() { final instance = Openapi().getStoreApi(); @@ -11,27 +12,36 @@ void main() { // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // //Future deleteOrder(String orderId) async - test('test deleteOrder', () async {}); + test('test deleteOrder', () async { + + }); // Returns pet inventories by status // // Returns a map of status codes to quantities // //Future> getInventory() async - test('test getInventory', () async {}); + test('test getInventory', () async { + + }); // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions // //Future getOrderById(int orderId) async - test('test getOrderById', () async {}); + test('test getOrderById', () async { + + }); // Place an order for a pet // - // + // // //Future placeOrder(Order order) async - test('test placeOrder', () async {}); + test('test placeOrder', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/tag_test.dart b/samples/client/echo_api/dart/dio/built_value/test/tag_test.dart index 25be1ec749a4..012a5ef8d957 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/tag_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/tag_test.dart @@ -8,9 +8,14 @@ void main() { group(Tag, () { // int id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // String name - test('to test the property `name`', () async {}); + test('to test the property `name`', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart b/samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart index 0ea7ac6d3868..1843b2d2200b 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/user_api_test.dart @@ -1,6 +1,7 @@ import 'package:test/test.dart'; import 'package:openapi/openapi.dart'; + /// tests for UserApi void main() { final instance = Openapi().getUserApi(); @@ -11,55 +12,72 @@ void main() { // This can only be done by the logged in user. // //Future createUser(User user) async - test('test createUser', () async {}); + test('test createUser', () async { + + }); // Creates list of users with given input array // - // + // // //Future createUsersWithArrayInput(BuiltList user) async - test('test createUsersWithArrayInput', () async {}); + test('test createUsersWithArrayInput', () async { + + }); // Creates list of users with given input array // - // + // // //Future createUsersWithListInput(BuiltList user) async - test('test createUsersWithListInput', () async {}); + test('test createUsersWithListInput', () async { + + }); // Delete user // // This can only be done by the logged in user. // //Future deleteUser(String username) async - test('test deleteUser', () async {}); + test('test deleteUser', () async { + + }); // Get user by user name // - // + // // //Future getUserByName(String username) async - test('test getUserByName', () async {}); + test('test getUserByName', () async { + + }); // Logs user into the system // - // + // // //Future loginUser(String username, String password) async - test('test loginUser', () async {}); + test('test loginUser', () async { + + }); // Logs out current logged in user session // - // + // // //Future logoutUser() async - test('test logoutUser', () async {}); + test('test logoutUser', () async { + + }); // Updated user // // This can only be done by the logged in user. // //Future updateUser(String username, User user) async - test('test updateUser', () async {}); + test('test updateUser', () async { + + }); + }); } diff --git a/samples/client/echo_api/dart/dio/built_value/test/user_test.dart b/samples/client/echo_api/dart/dio/built_value/test/user_test.dart index c106b8f486b0..a396d8769c1f 100644 --- a/samples/client/echo_api/dart/dio/built_value/test/user_test.dart +++ b/samples/client/echo_api/dart/dio/built_value/test/user_test.dart @@ -8,28 +8,45 @@ void main() { group(User, () { // int id - test('to test the property `id`', () async {}); + test('to test the property `id`', () async { + + }); // String username - test('to test the property `username`', () async {}); + test('to test the property `username`', () async { + + }); // String firstName - test('to test the property `firstName`', () async {}); + test('to test the property `firstName`', () async { + + }); // String lastName - test('to test the property `lastName`', () async {}); + test('to test the property `lastName`', () async { + + }); // String email - test('to test the property `email`', () async {}); + test('to test the property `email`', () async { + + }); // String password - test('to test the property `password`', () async {}); + test('to test the property `password`', () async { + + }); // String phone - test('to test the property `phone`', () async {}); + test('to test the property `phone`', () async { + + }); // User Status // int userStatus - test('to test the property `userStatus`', () async {}); + test('to test the property `userStatus`', () async { + + }); + }); }